Why Transformers Struggle with Distribution-Independent In-Context Learning
Omar NAIM, Jerome Bolte, Nicholas Asher
NeurIPS 2026
TL;DR. Transformers can achieve near-perfect in-distribution in-context learning yet fail sharply under distribution shift; we identify final-normalization and attention as two architectural causes.
Abstract. With in-context learning (ICL), transformer models adapt to new tasks from illustrative examples at inference time without updating their parameters. A common interpretation is that transformers implement implicit learning algorithms in their forward pass. We test this interpretation and ICL capability under distribution shift in noiseless polynomial regression, where the context uniquely determines the target function. Models that are near-perfect in distribution exhibit sharp performance degradation under shifts in the input or target-function distribution. This behavior persists across polynomial degrees and multiple training interventions, and in higher-dimensional nonlinear regression. We identify two architectural mechanisms that explain this breakdown: output saturation at finite boundary values linked to final normalization, and attention concentration on a small subset of the context, which can limit context-dependent adaptation required for ICL. Controlled experiments, architectural ablations, targeted interventions, and theoretical analysis provide strong evidence for both mechanisms and their consequence: strong in-distribution ICL does not imply distribution-independent ICL, which calls for caution when using ICL instead of explicit retraining or adaptation under distribution shift.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
NeurIPS 2026
Accept (poster) · 3 reviews · OpenReview
Updated 25 Nov 2026, 03:42 UTC.
- Decision
- Accept (poster)
Read decision
Meta-review
Summary
The paper distinguishes matched-distribution ICL (ICL1) from distribution-independent ICL (ICL2) using degree-1–6 polynomial regression. Transformers perform nearly perfectly in-distribution but exhibit cliff-shaped failures under scale shifts, unlike exact least-squares and more gradually degrading kernel baselines. The paper links boundary-value saturation to final normalization and proposes attention concentration as a broader context bottleneck.
Main strengths
The controlled polynomial setup makes the correct extrapolating solution unambiguous, and the ICL1–ICL2 distinction poses an important question about what Transformers actually learn. The experiments are clear and extensive across training interventions and component ablations, while the normalization and attention analyses provide useful mechanistic insight.
Weaknesses and questions
-
[Must address] The attention-bottleneck claim is correlational, lacks causal interventions and broad quantification, and Lemma 3 does not match the bounded-query headline shifts. [Yvoo, ttRo, 5kZw]
-
[Must address] Clarify whether the result reflects broad ICL failure or mainly magnitude extrapolation, and better distinguish the novelty from Naim and Asher. [ttRo]
-
[Must address] Test prompt-wise label normalization and output rescaling to separate architectural failure from scalar-encoding sensitivity. [ttRo]
-
[Clarify] Determine whether the cliff persists under distribution shifts that preserve output magnitude. [ttRo]
-
[Must address] Clarify whether the baseline gap comes from architecture, finite training support, scalar embeddings, or missing algorithmic inductive bias. [Yvoo]
-
[Must address] Evaluate stronger rescue architectures, such as set regressors, Transformer–regression hybrids, or regression-oriented linear attention. [Yvoo]
-
[Must address] The evidence is limited to synthetic regression and small models; add a more realistic benchmark or narrow the claims. [Yvoo, 5kZw]
-
[Clarify] Boundedness is proved, but the mechanism and onset of boundary-value saturation remain unexplained. [5kZw]
-
[Clarify] Report NMSE or relative error, and relate it explicitly to the scale-response ratio. [5kZw]
-
[Clarify] Highlight the reported post-hoc rescaling results, but address test-time removal of the trained final-normalization layer. [5kZw]
Final justification
The paper received mixed ratings, with the overall assessment leaning toward acceptance. Based on a careful consideration of the paper and the authors’ rebuttal, the AC believes that most of the major concerns have been adequately addressed. Therefore, the AC recommends acceptance.
Read meta-review
Meta-review
Summary
The paper distinguishes matched-distribution ICL (ICL1) from distribution-independent ICL (ICL2) using degree-1–6 polynomial regression. Transformers perform nearly perfectly in-distribution but exhibit cliff-shaped failures under scale shifts, unlike exact least-squares and more gradually degrading kernel baselines. The paper links boundary-value saturation to final normalization and proposes attention concentration as a broader context bottleneck.
Main strengths
The controlled polynomial setup makes the correct extrapolating solution unambiguous, and the ICL1–ICL2 distinction poses an important question about what Transformers actually learn. The experiments are clear and extensive across training interventions and component ablations, while the normalization and attention analyses provide useful mechanistic insight.
Weaknesses and questions
-
[Must address] The attention-bottleneck claim is correlational, lacks causal interventions and broad quantification, and Lemma 3 does not match the bounded-query headline shifts. [Yvoo, ttRo, 5kZw]
-
[Must address] Clarify whether the result reflects broad ICL failure or mainly magnitude extrapolation, and better distinguish the novelty from Naim and Asher. [ttRo]
-
[Must address] Test prompt-wise label normalization and output rescaling to separate architectural failure from scalar-encoding sensitivity. [ttRo]
-
[Clarify] Determine whether the cliff persists under distribution shifts that preserve output magnitude. [ttRo]
-
[Must address] Clarify whether the baseline gap comes from architecture, finite training support, scalar embeddings, or missing algorithmic inductive bias. [Yvoo]
-
[Must address] Evaluate stronger rescue architectures, such as set regressors, Transformer–regression hybrids, or regression-oriented linear attention. [Yvoo]
-
[Must address] The evidence is limited to synthetic regression and small models; add a more realistic benchmark or narrow the claims. [Yvoo, 5kZw]
-
[Clarify] Boundedness is proved, but the mechanism and onset of boundary-value saturation remain unexplained. [5kZw]
-
[Clarify] Report NMSE or relative error, and relate it explicitly to the scale-response ratio. [5kZw]
-
[Clarify] Highlight the reported post-hoc rescaling results, but address test-time removal of the trained final-normalization layer. [5kZw]
Final justification
The paper received mixed ratings, with the overall assessment leaning toward acceptance. Based on a careful consideration of the paper and the authors’ rebuttal, the AC believes that most of the major concerns have been adequately addressed. Therefore, the AC recommends acceptance.
1 comment
- Rating
- 4/6
- Confidence
- 3/5
- Quality
- 3/4
- Clarity
- 4/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- negative_results
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper distinguish and defined two types of ICL: ICL1, where training and test samples are from the same distribution, and ICL2, where model can learn the function across distribution shifts. In controlled polynomial regression task, the paper identified the phenomenon that model acna achieve perfect in-distribution performance while show failure mode in coefficient-scale and label-scale shifts. Furthermore, they analyzes two architectural mechanisms. First, removing final normalization to rule out the effect of the boundary cannot restore scale-equivariant behavior. Second, they argues that query attention might concentrate on a small subset of prompt tokens and limits the generalization performance.
Strengths and weaknesses
Strengths:
- The distinction between ICL1 and ICL2 is clear and valuable, which poses an important research question why strong in-distribution performance does not necessarily translate to a distribution-independent performance.
- The polynomial regression experimental setup is controlled and meaningful.
- The paper goes beyond the identification of the failure phenomenon. The analysis of boundary values, final normalization and attention concentration provides useful insight.
Weaknesses:
- Only synthetic regression toy examples are demonstrated in the whole paper. Real world experiments can certainly strengthen the claim.
- The final normalization part only show the boundedness of readout, however, it does not fully show why or when model prediction saturate near the boundary. Some analysis about how does the final prediction converge to the bound might be interesting.
- The paper shows that attention can become concentrated under distribution shift, but it is not clear and rigorous that the attention concentration is the reason that directly causes the failure mode of ICL2.
Questions
- Do you consider to use normalized mean squeare error (NMSE)? Since in the case of coefficient-scale or label-scale shift, the target itselft becomes larger, which can further lead to a larger MSE. From my point of view, normalizing the MSE would help distinguish if that is the case.
- The paper retrains models without final normalization. As an additional diagnostic, I am quite curious what happens if the final normalization layer is removed or rescaled only at test time? This would help determine whether the trained model contains a useful internal regression representation but beeing distorted by the final normalization, or whether the model fails to learn ICL2.
Limitations
- The main limitation of the paper is that the empirical evidence is restricted to synthetic polynomial regression tasks. Although it is well motivated, it remains unclear how directly the conclusions transfer to more realistic ICL tasks.
- Another concern is that the attention-bottleneck explanation. Although it is plausible and supported by attention concentration observations, it is not fully established as a causal mechanism. Stronger causal interventions would further strengthen this part of the paper.
Final justification
Most of my questions have been answered. The concerns I raised as limitations are not fully solved. Therefore, I will maintain my rating of 4.
Formatting concerns
None
5 comments
Rebuttal
We thank the reviewer for their thoughtful and helpful comments and questions. They will help us improve the final version. We address each below.
Re "Question 1". We thank the reviewer for this pertinent experiment. The results are in the table below.
| σ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| NMSE | 2e-5 | 0.02 | 0.14 | 0.28 | 0.36 | 0.45 | 0.53 | 0.57 | 0.62 | 0.66 |
The cliff persists under NMSE: it rises monotonically from ≈2×10⁻⁵ at σ=1 to 0.66 at σ=10. Since NMSE removes the effect of the target growing, this confirms the degradation is not an artifact of larger targets inflating the raw MSE, the model's error grows to a large fraction of the target variance under shift, whereas a scale-equivariant estimator such as least squares maintains NMSE ≈ 0 across all σ. The failure is therefore relative to the signal, not a scale-of-target effect. We will add the NMSE results in the paper.
Re "Question 2". We thank the reviewer for this diagnostic. Our paper already reports the rescaling variant on the trained model (Table 3, post-hoc γ scaling), where enlarging the readout bound does not restore scale-equivariant behavior. The removal-at-test-time variant was not in the paper, so we ran it: at inference we replace the final LayerNorm with the identity, so the decoder reads the un-normalized residual stream directly, with no retraining (degree 1, coefficient axis).
| σ=1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |
|---|---|---|---|---|---|---|---|---|---|---|
| Baseline (norm intact) | 9e-6 | 0.04 | 0.62 | 1.95 | 4.29 | 7.14 | 10.36 | 15.79 | 24.48 | 27.06 |
| Final norm removed at test time | 434 | 1239 | 1676 | 1646 | 1734 | 1730 | 1716 | 1656 | 1609 | 1558 |
The result speaks directly to the two hypotheses the reviewer poses. Removing the final normalization at test time does not reveal a useful internal regression representation, it destroys the prediction at every scale, and most severely in-distribution (σ=1: 9×10⁻⁶ → 434), where the model is otherwise near-perfect. This is what one expects if the model does not hold a correct internal rule that the norm is merely distorting: the decoder is trained to read a normalized representation, so the raw residual stream lies far outside its input range and decoding it yields large, uninformative outputs. If the model had learned a reliable internal regressor that was simply being suppressed by the readout constraint, removing that constraint should have revealed it and reduced the error. Instead, it destroys even the model’s in-distribution competence.
Re "Causal intervention on attention". We have strengthened this from a single attention map to a quantified, causally-probed mechanism, following the interventions suggested by the reviewer Yvoo. We ran the causal checks proposed, and describe each below with the supporting results.
-
Measuring whether effective context size tracks the shift (across seeds and scales). For each we compute effective context size (ECS) at the query token, the participation ratio of its attention weights, where a low value means the query aggregates only a few context tokens. As the query leaves the training range, ECS falls monotonically (4 → 1.8 as σ grows), showing that the context available to the query token shrinks precisely as the shift increases.
-
Quantifying the concentration mechanism. We measure the query–key logit gap, the margin between the largest attention score and the runner-up, as a function of the shift magnitude. As the query moves further out of distribution, the gap grows monotonically and sharply (gap = 31, 119, 217, 387, 531, 706, 895, 1031, 1245 for σ = 1…9), so the attention distribution concentrates more severely the larger the distribution shift. This shows the concentration is not an incidental correlate but a systematic consequence of distribution shift, tracking its magnitude directly.
-
Forcibly smoothing attention at test time (causal intervention). We temperature-scale the query–key scores at inference (T = 1 recovers the trained model), which flattens the attention distribution. Smoothing perturbs the prediction error, confirming that attention weighting lies in the causal path of the failure rather than being a passive correlate.
We will revise Section 6 to present it as such and add these measurements.
Re "Only synthetic regression; real-world experiments would strengthen the claim". Thank you for this suggestion. We already acknowledge that in the limitations section. As suggested by the reviewer Yvoo, we added a more application-aligned tabular-regression experiment based on a TabPFN-style. At every training step, a newly sampled random neural network defines a regression task over 10-dimensional inputs, and the transformer must infer the corresponding nonlinear function from tabular input--output examples provided in context. Relative to the polynomial experiments, this setting introduces vector-valued inputs, nonlinear targets, and a neural-network task prior.
The same failure appears. The model performs well in distribution but degrades sharply under distribution shift: NMSE=0.77 under target-scale shift and NMSE =0.93 under feature-support shift. Thus, the observed cliff is not restricted to scalar polynomial regression. The same readout-side mechanism is also present. From the trained model parameters, our theorem gives the model-dependent prediction bound R + |b| = 16.3. As the query magnitude is increased along each feature direction, the predictions remain confined to a bounded range and converge to direction- and sign-dependent boundary values. For example, along the first feature axis, the predictions approach approximately +4.40 and -4.42, whereas the magnitude of the true target grows to approximately The theoretical bound is therefore respected, and the boundary-value behavior observed for polynomial functions also occurs in this higher-dimensional, nonlinear tabular setting.
We will add this experiment to the revised paper and narrow our claims accordingly.
Re "Final normalization shows boundedness but not why/when predictions saturate". We thank the reviewer for raising this question, and we address both why and when predictions saturate.
Why. Boundedness alone guarantees only that predictions cannot grow arbitrarily; it does not imply convergence to a particular boundary value. The additional mechanism is attention concentration followed by final normalization. Although Lemma 3 characterizes the asymptotic regime, this mechanism does not require extremely large inputs. Let denote the logits and . Suppose that for all $ j\neq j_0.$ Then the softmax weights satisfy and $ \alpha_j\leq e^{-\delta} $ for all $ j\neq j_0.$
Thus, once the largest query-key logit exceeds the others by a moderate gap (3 or 4), the non-maximal tokens are exponentially suppressed and the attention update becomes dominated by a single token. This concentration can therefore arise soon after the query leaves the training distribution; it does not require the input magnitude to become asymptotically large.
As the same component increasingly dominates the residual representation, its direction stabilizes while its magnitude grows. Final normalization removes this magnitude, causing the representation read by the decoder to approach a fixed point. Since the decoder is continuous, the prediction consequently approaches a fixed boundary value.
Our experiments confirm this finite-scale onset: the query-key logit gaps grow sharply under distribution shift, and the cliff begins as soon as the inputs enter an unfamiliar region, including intervals adjacent to the training support. Thus, Lemma 3 characterizes the limiting behavior, while the softmax-gap bound explains why the same mechanism can become effective immediately outside the training distribution.
Experiment: extracting the boundaries. On the standard degree-1 model, we hold the in-context examples in-distribution and sweep only the query input from within the training range out to large magnitude ( up to ), recording the prediction. To test whether the limit is a property of the model rather than of the task, we repeat this over 40 different target functions and over different in-context example sets. The prediction converges to two asymmetric constants, and , with a spread of at most across functions and across contexts, i.e. the same two values regardless of the function or the in-context examples. We further verify that these values are determined by the model's own converged internal state rather than fit to the output curve. Because the boundary is a property of the model, it need not match the in-distribution output range: for the model predicts accurately within the training range yet saturates to far outside it.
Experiment: onset. Sweeping the query inward from the training range and comparing the prediction to the true function, saturation begins as the query leaves : for the prediction tracks the function through and departs from it immediately beyond.
We will add a short proposition and these measurements to the revision.
Thanks for the detailed response. Most of my questions have been addressed. I particularly like the causal analysis and intervention experiments.
Reply to Reviewer 5kZw
Thank you for your positive feedback on our response. We are glad that the clarifications addressed your concerns, and we hope they will be helpful as you finalize your assessment.
- Rating
- 4/6
- Confidence
- 3/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
The paper asks whether a transformer that does in-context learning well in distribution, which they call ICL1, has actually learned a general regression rule that survives distribution shift, ICL2. They test this on polynomial regression of degree 1 to 6, where least squares extrapolates exactly, and train small GPT-style transformers from scratch. The finding is a clean gap. In distribution the models are near perfect, but once the test coefficient scale grows past the training range the error collapses by orders of magnitude in a cliff shape, while least squares stays exact and kernels degrade gently. They trace this to two architectural causes, a final-normalization bound that explains saturation to fixed boundary values but is only part of the story, and attention collapsing onto a single context token under shift, with ablations down to attention-only models and several attention variants all keeping the failure. The message is that strong in-distribution ICL is not evidence of a general learner, which matters for deployed in-context predictors like TabPFN and in-context RL.
Strengths and weaknesses
I liked this paper and think the question is a real one. I lean on the experiments more than the proofs. The setup is the main thing it gets right. Polynomials give a case where the correct behavior is unambiguous and least squares draws an exact reference line, so the cliff is hard to wave away. It is also clearly written and I rarely got lost. And it is thorough where it needs to be, since the failure survives more training, curriculum, larger support, removing the MLP, and a range of attention variants, so most of the easy objections are closed off already. I also liked that they do not oversell the normalization result.
My main worry is that much of this may be about magnitude extrapolation rather than distribution independence in any broad sense. The shift that drives the headline is multiplying the labels by up to ten, which throws the scalar token embedding far outside its training range, and a network with learned scalar embeddings failing to extrapolate in magnitude is close to the familiar story that neural nets do not extrapolate well. What is genuinely new on top of Naim and Asher, who already showed boundary values for linear functions, is the polynomial version and the architectural account, and I would like that said more plainly so a reader can tell what is new from what is a careful confirmation. The theory also sits a little to the side of the result. Theorem 2 is clean but the paper itself shows it is not the operative cause. Lemma 3 is about the query input going to infinity, while the headline cliff comes from scaling the labels with the query bounded, which the authors acknowledge. So the most interesting case rests mostly on one attention map rather than on theory or a measurement across runs. The attention story is believable and I lean toward it, but for now it is more suggestive than shown.
Questions
- Since the shift that breaks things is multiplying the labels by up to ten, it also pushes the scalar embedding far out of range. Have you tried normalizing each prompt by its own label scale and rescaling the prediction back, to see whether the cliff is really architectural or just an artifact of the fixed encoding?
- Does the cliff also show up for shifts that do not change the output magnitude, like moving the input support while keeping the label scale fixed? If the effect is essentially about magnitude, I think the title and the distribution-independent framing should be scoped to say so.
Limitations
Mostly yes.
Final justification
The rebuttal from authors convinced me, so i remain 4 and recommend acceptance.
Formatting concerns
Nothing major.
3 comments
Rebuttal
We thank the reviewer for their thoughtful and helpful comments that will help us strengthen our paper.
Re "Question 1". We thank the reviewer for raising this point. We ran the experiment you suggested. Results are in the table below (degree 1, coefficient-scale shift):
| Model | σ=1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|
| Baseline | 9e-6 | 0.04 | 0.62 | 1.95 | 4.29 | 7.14 | 10.36 | 15.79 | 24.48 |
| Label-normalized | 0.10 | 0.43 | 1.16 | 1.18 | 2.47 | 4.02 | 4.44 | 7.67 | 9.51 |
The cliff does not disappear. Normalization reduces the error only in the far-OOD regime, while it makes performance substantially worse in and near distribution, and even where it helps the residual error stays far above the exact behavior of least squares. This is consistent with our set-regressor result, which uses a different (MLP) encoding of the input–label pair and still fails (See response to Reviewer Yvoo). If the cliff were purely an artifact of the fixed label encoding, per-prompt normalization would remove it at no cost; instead it merely trades error across regimes and leaves a large residual. The in-distribution degradation is itself diagnostic: a model implementing a genuinely scale-equivariant regression rule would be invariant to this normalization, whereas ours is not. We therefore read the fixed encoding as a contributing factor to the label-scale cliff, most visible far out of distribution, but not its sole cause. . We note that this normalization by construction affects only output magnitude and cannot address input-support shift, which we take up in the response to your second question.
Re “Question 2”. We thank the reviewer for raising this important question, which cleanly separates magnitude extrapolation from distribution-independent generalization. We provide two pieces of evidence:
-
First, we already observe a cliff under input-support shift, not only label-scale shift. In Appendix F.5 (Fig. 10), the model predicts accurately on the training interval [0,1], but the error rises abruptly as soon as the test inputs cross into an unfamiliar region. Importantly, this occurs for intervals adjacent to, or only modestly shifted from, the training support, not only under extreme extrapolation. Thus, the failure is not confined to the label-scaling axis.
-
Second, and to address the reviewer's precise condition, a shift that does not change the output magnitude, we ran a new experiment, where we trained a new model from scratch on , and evaluated it on the disjoint equal-magnitude interval , while keeping the label scale and output range within those seen during training. We again observe an abrupt degradation as soon as the inputs enter the unseen interval, consistent with the behavior in Appendix F.5. Because the outputs remain within the training range, this cliff cannot be explained by magnitude extrapolation alone; it reflects a genuine dependence on the input distribution. Together, these results show that the failure is broader than output-magnitude extrapolation: the magnitude effect discussed in Question 1 is one contributing axis, not the entire phenomenon.
Re "On the attention account being suggestive rather than shown". We have strengthened this from a single attention map to a quantified, causally-probed mechanism, following the interventions suggested by the reviewer Yvoo. We ran the causal checks proposed, and describe each below with the supporting results.
-
Measuring whether effective context size tracks the shift (across seeds and scales). For each we compute effective context size (ECS) at the query token, the participation ratio of its attention weights, where a low value means the query aggregates only a few context tokens. As the query leaves the training range, ECS falls monotonically (4 → 1.8 as σ grows), showing that the context available to the query token shrinks precisely as the shift increases.
-
Quantifying the concentration mechanism. We measure the query–key logit gap, the margin between the largest attention score and the runner-up, as a function of the shift magnitude. As the query moves further out of distribution, the gap grows monotonically and sharply (gap = 31, 119, 217, 387, 531, 706, 895, 1031, 1245 for σ = 1…9), so the attention distribution concentrates more severely the larger the distribution shift. This shows the concentration is not an incidental correlate but a systematic consequence of distribution shift, tracking its magnitude directly.
-
Forcibly smoothing attention at test time (causal intervention). We temperature-scale the query–key scores at inference (T = 1 recovers the trained model), which flattens the attention distribution. Smoothing perturbs the prediction error, confirming that attention weighting lies in the causal path of the failure rather than being a passive correlate.
We will revise Section 6 accordingly and add these measurements.
Re "Novelty". Naim and Asher first documented boundary values for transformers trained on one-dimensional linear functions and related them empirically to the training distribution, but did not identify or verify the architectural mechanism producing them. Our work extends this observation in four ways. First, we show that the cliff-shaped failure and boundary values persist across polynomial degrees 1–6 and, in the new rebuttal experiment, in a 10-dimensional nonlinear TabPFN-style setting (Reponses to Reviewers 5kZw and Yvoo). Second, we systematically test candidate explanations through structured supervision, longer training, expanded support, degree curricula, input-support shifts, architectural ablations, normalization placements, and attention variants; these affect quantitative performance but do not remove the qualitative failure. Third, we prove that a continuous decoder applied to a final LayerNorm- or RMSNorm-normalized representation has uniformly bounded output, identifying a precise architectural cause of hard saturation, while showing that removing or rescaling this constraint does not restore label-scale equivariance or OOD generalization. Fourth, we identify attention concentration as a separate context-side contributor and strengthen this account with effective-context-size, logit-gap, and test-time smoothing experiments. Finally, we test architectures with stronger inductive biases: permutation-invariant set regression and linear attention still fail under coefficient scaling, while the Transformer–ridge hybrid succeeds only where the closed-form regression solve is explicitly inserted and still fails under input-support shift.
Re "Lemma 3". Although Lemma 3 characterizes the asymptotic regime, this mechanism does not require extremely large inputs. Let denote the logits and . Suppose that for all $ j\neq j_0.$ Then the softmax weights satisfy and $ \alpha_j\leq e^{-\delta} $ for all $ j\neq j_0.$
Thus, once the largest query-key logit exceeds the others by a moderate gap (3 or 4), the non-maximal tokens are exponentially suppressed and the attention update becomes dominated by a single token. This concentration can therefore arise soon after the query leaves the training distribution; it does not require the input magnitude to become asymptotically large.
Thank you very much to the authors for their replies. My questions have been answered, and the authors’ responses to other reviewers have also convinced me, so I’ve decided to keep my rating as is.
Thank you for your constructive review. We are glad that our responses addressed your questions and that our replies to the other reviewers were convincing as well.
- Rating
- 3/6
- Confidence
- 3/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 2/4
- Originality
- 2/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper studies whether Transformers trained for in-context learning truly implement distribution-independent learning algorithms, using controlled polynomial regression tasks. It finds that Transformers achieve near-perfect in-distribution ICL but suffer sharp out-of-distribution failures under coefficient scale shifts, which the authors attribute to final-normalization-induced output bounds and attention-induced context bottlenecks.
Strengths and weaknesses
Strengths
- The experimental setup is clean and well controlled.
- The paper provides useful mechanistic insights.
Weaknesses
- The paper lacks analysis of architectural rescue attempts.
- The comparison with least squares and polynomial regression is informative but not fully controlled.
- The empirical validation is mainly limited to synthetic scalar polynomial regression, so it remains unclear whether the observed cliff-shaped collapse generalizes to more realistic ICL settings.
Questions
- Lack of architectural rescue attempts: Although the authors test several training-side interventions and attention variants, the study does not fully explore architectures with stronger algorithmic inductive biases, such as permutation-invariant set regressors, linear-attention constructions designed to implement gradient descent, or explicit Transformer-regression hybrids. This is particularly important because prior work has shown that certain Transformer variants can implement gradient-descent-like or regression-like computations in-context [1].
- Unfair comparison without architectural control: Least squares and polynomial regression are given the correct hypothesis class by construction, while the Transformer must learn both the representation and the inference procedure from finite training data. Prior work [2] has shown that Transformers can be trained from scratch to perform ICL on simple function classes and sometimes match least-squares-like behavior under matched distributions, but this does not necessarily imply that they should extrapolate exactly outside the training support. The authors should clarify whether the failure is due to Transformer architecture per se, the finite training distribution, the scalar embedding design, or the lack of explicit algorithmic inductive bias.
- Attention bottleneck analysis: The paper shows that attention weights can become concentrated under distribution shift and argues that this limits context aggregation. However, attention concentration alone does not prove that this is the primary cause of the prediction failure. Additional causal interventions would strengthen the claim, such as forcibly smoothing attention at test time, replacing attention maps with in-distribution-like maps, or measuring whether effective context size quantitatively predicts error across layers, heads, seeds, and shift types.
- Limited empirical scope: It remains unclear how strongly the conclusions transfer to realistic ICL scenarios such as natural language, tabular prediction, or scientific modeling. The paper itself acknowledges that the setup abstracts away from real-world NLP complexity and uses relatively modest decoder-only models. A stronger paper would include at least one less synthetic benchmark to show that the observed “cliff” is not merely an artifact of scalar polynomial tasks.
[1] Transformers learn in-context by gradient descent. ICML2023.
[2] What Can Transformers Learn In-Context? A Case Study of Simple Function Classes. NeurIPS 2022.
Limitations
yes
Final justification
According to authors’ response, I've decided to keep my rating.
Formatting concerns
None
3 comments
Rebuttal
We thank the reviewer for their constructive comments.
Re "Architectural rescue attempts". Following the reviewer's suggestion, we tested the three architectures with stronger algorithmic inductive biases.
- Linear-attention construction: We now train and evaluate a linear-attention model under our ICL objective.
- Permutation-invariant set regressor (Conditional Neural Process / DeepSets): Each context pair is encoded by a shared MLP, mean-pooled over the set, and decoded against the query, no positional encoding, no softmax, no final normalized readout. This is the canonical permutation-invariant amortized regressor, and it removes both mechanisms we analyze in Sections 5–6 at once.
- Transformer-regression hybrid (learned features + closed-form solve). A transformer backbone produces features , and a ridge estimator is solved in closed form in the context. It is the only arm that survives coefficient scaling, but precisely because the least-squares solve is inserted into the forward pass and is linear in y, making it label-equivariant by construction, not by learning.
| Model | σ=1 | σ=2 | σ=3 | σ=4 | σ=5 | σ=6 | σ=7 | σ=8 | σ=9 | σ=10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Softmax Transformer | 9e-6 | 0.04 | 0.62 | 1.95 | 4.29 | 7.14 | 10.36 | 15.79 | 24.48 | 27.06 |
| Linear attention | 9e-6 | 0.03 | 0.53 | 1.66 | 3.47 | 6.26 | 11.46 | 15.30 | 23.13 | 29.71 |
| Set regressor (CNP) | 7e-5 | 0.26 | 2.27 | 4.46 | 7.77 | 12.42 | 19.79 | 24.99 | 34.90 | 41.92 |
| Transformer-ridge hybrid | 7e-4 | 3e-3 | 7e-3 | 0.01 | 0.02 | 0.02 | 0.04 | 0.05 | 0.06 | 0.08 |
The linear-attention model and the set regressor both under-scale as sharply as the softmax transformer; the set regressor is notable because it removes both mechanisms we analyze in Sections 5–6, yet still fails, and it exhibits no boundary values in the absence of final normalization. The hybrid survives coefficient scaling, but only because the least-squares solve is inserted into the forward pass, making it label-equivariant by construction rather than by learning; under input-support shift, where is evaluated off-distribution, it collapses like the rest. In short, the rescue works only to the extent the estimator is hard-wired, which supports our claim that models can be programmed to do regression but don’t learn it from data rather than weakening it.
Regarding [1]: it proves that one gradient-descent step can be reproduced by a single-layer linear attention, with no softmax, MLP, normalization, or final normalized readout, and under further assumptions on token structure and initialization. It does not establish that a standard normalized softmax Transformer learns an exact regression algorithm, and even in that idealized setting the construction degrades rapidly outside its training regime. Our paper studies actual transformers as they are built and deployed, precisely the setting in which these distribution-shift failures arise.
Re "Unfair comparison without architectural control". The least-squares and polynomial-regression baselines are not competitors held to the same learning problem; they serve as a certificate of solvability. Because the function class is correctly specified and the in-context examples uniquely determine the target, they recover it exactly, establishing that exact extrapolation is possible here, so the transformer's collapse cannot be attributed to statistical impossibility (non-identifiability, conditioning, or model-class mismatch). We do not claim matched-distribution success should imply extrapolation; We used them also to refute hypotheses suggesting that transformers are actually implementing them at inference under these settings.
On the four candidate causes, our experiments (including the new rescue arms) separate them:
-
Transformer architecture is a contributor (section 5 and 6) but not as the sole cause. The set regressor (CNP) is not a transformer (no attention) yet fails identically. Within the transformer family the failure also survives attention-only models (App. E), attention-mechanism variants (App. M), and every normalization placement we test (App. N).
-
Finite training distribution contributes, but does not confer exact extrapolation. Expanding the training support (App. F.3) moves the cliff outward, but it reappears at the new boundary rather than disappearing; more data and training steps (App. F.2) do not remove it.
-
Scalar embedding design, part of the mechanism, not the whole cause. This is the standard scalar embedding used to study ICL on function classes, and the same design used by small transformers deployed as in-context predictors, so it is the relevant object to test rather than an arbitrary choice. It is implicated off-support, learned linear embeddings grow in magnitude and inflate query-key gaps, driving the attention concentration of Section 6, but it is not the whole cause: the CNP encodes pairs with an MLP and still fails, and the readout bound (Theorem 2) holds independently of the input embedding.
-
Lack of explicit algorithmic inductive bias, the dominant factor. The ridge hybrid supplies the algorithm (a closed-form least-squares solve in the forward pass) and then generalizes exactly on the axis the solver covers (coefficient scale, ), while still failing under input-support shift, where the learned feature map must generalize. The model fails precisely where it must learn the procedure rather than execute a hard-wired one.
Re "Attention analysis". We thank the reviewer for this helpful suggestion. We ran the causal checks proposed, and describe each below with the supporting results.
-
Measuring whether effective context size tracks the shift (across seeds and scales). For each σ we compute effective context size (ECS) at the query token, the participation ratio of its attention weights, where a low value means the query aggregates only a few context tokens. As the query leaves the training range, ECS falls monotonically (4 → 1.8 as σ grows), showing that the context available to the query token shrinks precisely as the shift increases.
-
Quantifying the concentration mechanism. We measure the query–key logit gap, the margin between the largest attention score and the runner-up, as a function of the shift magnitude. As the query moves further out of distribution, the gap grows monotonically and sharply (gap = 31, 119, 217, 387, 531, 706, 895, 1031, 1245 for σ = 1…9), so the attention distribution concentrates more severely the larger the distribution shift. This shows the concentration is not an incidental correlate but a systematic consequence of distribution shift, tracking its magnitude directly.
-
Forcibly smoothing attention at test time (causal intervention). We temperature-scale the query–key scores at inference (T = 1 recovers the trained model), which flattens the attention distribution. Smoothing perturbs the prediction error, confirming that attention weighting lies in the causal path of the failure rather than being a passive correlate.
We will add these results to the paper, which, we agree with the reviewer, will strengthen the analysis of section 6.
Re "limited empirical scope" We address this concern in two complementary ways: 1) we add a higher-dimensional, nonlinear tabular ICL benchmark based on the TabPFN training paradigm, and 2) we explicitly narrow the scope of our claims.
The controlled polynomial-regression setup is deliberate: it provides a known ground-truth solution and allows us to isolate the effects of the training distribution and model architecture. Because a correctly specified classical estimator extrapolates exactly from the same in-context examples, the observed failure can be attributed to the learned predictor rather than to non-identifiability, insufficient context, or intrinsic task difficulty. This is also a standard experimental paradigm in mechanistic studies of ICL, where transformers are trained from scratch on synthetic function classes. Moreover, closely related transformer-based ICL predictors are increasingly studied in tabular learning, reinforcement learning, and scientific estimation, making it important to determine whether the failure extends beyond scalar polynomial tasks.
To test this, we added a more application-aligned tabular-regression experiment based on a TabPFN-style synthetic prior. At every training step, a newly sampled random neural network defines a regression task over 10-dimensional inputs, and the transformer must infer the corresponding nonlinear function from tabular input--output examples provided in context. Relative to the polynomial experiments, this setting introduces vector-valued inputs, nonlinear targets, and a neural-network task prior.
The same failure appears. The model performs well in distribution but degrades sharply under distribution shift: NMSE=0.77 under target-scale shift and NMSE =0.93 under feature-support shift. Thus, the observed cliff is not restricted to scalar polynomial regression. The same readout-side mechanism is also present. From the trained model parameters, our theorem gives the model-dependent prediction bound $ \hat{y} \leq ||w|| R + |b| = 16.3.$ As the query magnitude is increased along each feature direction, the predictions remain confined to a bounded range and converge to direction- and sign-dependent boundary values. For example, along the first feature axis, the predictions approach approximately +4.40 and -4.42, whereas the magnitude of the true target grows to approximately The theoretical bound is therefore respected, and the boundary-value behavior observed for polynomial functions also occurs in this higher-dimensional, nonlinear tabular setting.
We will add this experiment to the revised paper and narrow our claims accordingly.
Thank you for your reply. According to your response, I've decided to keep my rating.
Thank you for getting back to us. We'd be grateful to understand which concern is still weighing most on your assessment, so we can address it directly. Your review raised four points,, architectural rescue attempts, the least-squares comparison, the attention analysis, and empirical scope, and we addressed each with new experiments: the rescue architectures (set regressor, linear attention, and the ridge hybrid), the causal attention interventions (effective context size, logit-gap, and test-time smoothing), and the TabPFN-style tabular benchmark. If any of these remains unconvincing, or if a different concern is now decisive, please let us know, the discussion period is open until August 3, and we would be glad to provide further results before it closes.
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
Summary of responses to reviewers and AC
We thank the AC for the helpful synthesis. All points are answered in detail in the individual reviewer responses (reply to ...); we summarize them here to avoid overtaxing the reader with too much repetition.
Attention bottleneck and Lemma 3. We ran the three causal checks: Across seeds and shift magnitudes, effective context size at the query falls monotonically (4 → 1.8 as σ grows); the query–key logit gap grows sharply (31 → 1245, σ=1…9); and test-time temperature-scaling perturbs the error, placing attention in the causal path, not on the side of a passive correlate. (Reply to Yvoo)
Lemma 3 is asymptotic, but the softmax-gap bound (a moderate gap δ≈3–4 gives non-maximal weights $ \leq e^{−δ}$) shows concentration engages just outside the training support, at bounded queries. (Reply to ttRo)
Broad ICL failure vs magnitude extrapolation. We trained a model on x∈[0,1] and tested on the disjoint interval x∈[−1,0] with target magnitude held within the training range: the same cliff appears, so the failure is broader than output-magnitude extrapolation. (Reply to ttRo, Q1-Q2)
Re Novelty. See reply to ttRo ("Novelty")
Prompt-wise label normalization and output rescaling. Done: normalizing each prompt by its label scale and rescaling back partially helps far-OOD (σ=9: 24.48 → 9.51) but does not restore scale equivariance and degrades ID (9×10⁻⁶ → 0.10). The CNP, which uses a different MLP encoding, under-scales the same way. Scalar encoding contributes but is not the whole cause. (Reply to ttRo, Q1)
Cliff under output-magnitude-preserving shift. Addressed by the same [0,1]→[−1,0] experiment above: because the output range stays within training, the cliff there cannot be magnitude extrapolation. (Reply to ttRo, Q2)
Source of the baseline gap. Theory and experiments separate the four candidates. Architecture directly explains the hard boundary values (Thm 2); removing final normalization eliminates the bound without restoring OOD generalization. This failure also occurs in attention-only models (App. E), attention variants (App. M), all normalization placements tested (App. N), and the non-Transformer CNP set regressor. Finite support contributes: expanding it moves the cliff outward, where it reappears, and more data or training does not remove it (App. F.2–F.3). Scalar embeddings widen off-support logit gaps but aren't the whole cause; the CNP uses an MLP encoding and still fails. Missing algorithmic bias is decisive: only the Transformer–ridge hybrid, with a closed-form solve in the forward pass, survives coefficient scaling (r(α)≈1), though it still fails under input-support shift. (Reply to Yvoo)
Stronger rescue architectures We studied the architectures with stronger algorithmic inductive biases mentioned above together with a linear-attention model. Linear attention and the CNP still under-scale like the softmax Transformer; the CNP removes both mechanisms we analyze, yet fails identically. Only the Transformer-ridge hybrid survives coefficient scaling, because the inserted least-squares solve makes it label-equivariant by construction. It nevertheless fails under input-support shift. (Reply to Yvoo)
Realistic benchmark / narrower claims. We added a 10-D nonlinear TabPFN-style tabular ICL benchmark: the same failure persists (NMSE 0.77 target-scale, 0.93 feature-support), with Thm 2's bound (16.3) respected while predictions saturate near ±4.4 and the true target reaches ~1.8×10⁶. We also narrow the claims. (Replies to Yvoo, 5kZw)
Mechanism and onset of boundary saturation. Mechanism. Boundedness alone does not imply convergence to a particular value; attention concentration followed by final normalization supplies the missing step.Lemma 3 describes the limit, but the mechanism engages just outside the training support. That token's direction in the residual representation stabilizes while its magnitude grows; final normalization strips the magnitude, so the decoder input, and with it the continuous decoder's output, approaches a fixed point.
Sweeping the query to ∣x∣=104 over 40 target functions and varied in-context sets yields the same constants (B−=−0.484, B+=+0.449); the boundary is thus a property of the model, not a fit to the task. Onset. Immediate at the support edge. (Reply to 5kZw)
NMSE and r(α). NMSE grows monotonically from ~2×10⁻⁵ to 0.66 while least squares stays near zero. It is non-redundant with r(α): r(α) normalizes by the model's own unscaled prediction and isolates label-scale equivariance, whereas NMSE measures error against the target. (Reply to 5kZw, Q1)
Post-hoc rescaling and test-time norm removal. Table 3 already reports post-hoc rescaling (damages ID, no OOD fix). Removing the trained final-norm layer at test time destroys even ID (9×10⁻⁶ → 434), so no usable unclipped prediction is hidden underneath; the from-scratch no-final-norm model keeps ID but still fails OOD. (Reply to 5kZw)