REVIEW 4 major objections 5 minor 29 references
Re-examining learning linear functions in context
T0 review · 4 major / 5 minor · reviewed 2026-08-12 · deepseek-v4-flash
Pith's one-line read Transformers don't learn linear functions in context — they clip them to a training-range band.
desk verdict Solid empirical documentation of boundary saturation in ICL, but the 'no linear regression' conclusion is an overreach that needs a major revision before publication. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The central object is the pair of boundary values $B^-$ and $B^+$, which are the largest and smallest function outputs the model has memorized from training data. They act as a bandpass filter: for target values just outside the boundaries, the model predicts a constant near the boundary; for values farther out, it predicts a random value inside the interval. This mechanism carries the argument against algorithmic ICL because it explains the observed error patterns and the accuracy-versus-generalizability dilemma. The paper also sketches a projection hypothesis $\pi$ in which the attention layers store pairs of input and output values and interpolate among the closest stored projections.
What would settle it
Train a model on $U(-5,5)$ but with a target function whose values stay within a narrower band, e.g., $f(x)=2x$ with $x\in[-5,5]$ so the maximum possible output is $\pm 10$. If boundary values appear around $\pm 10$, the memorized-extrema account is supported; if they remain near $\pm 30$, the boundary is set by something other than training extrema, such as the unembedding matrix or loss scale.
Extended reading notes
Core claim
The central discovery is that across over 30 transformer architectures, in-context learning of univariate linear functions is governed by training-range saturation: every model has boundary values $B^-$ and $B^+$ beyond which its predictions become constant (near the boundary) or random (within the boundary interval). The paper distinguishes two senses of learning—ICL1, matching expected error on the training distribution, and ICL2, actually recovering the parameters $a,b$ of $f(x)=ax+b$—and shows that while models achieve ICL1, they never achieve ICL2. The boundary values coincide with the extremes encountered in training data, indicating the model memorizes those extremes and uses them as a bandpass filter. Consequently, performance outside the boundaries degrades dramatically, and there is a trade-off: training on narrow distributions gives high accuracy but poor generalization, while training on wider distributions improves generalization but loses precision. The paper argues this rules out the linear-regression account of ICL and instead supports a memory-based projection hypothesis.
Load-bearing premise
The claim rests on the inference that boundary values are set by the largest and smallest function values the model happened to see in training; if those limits instead come from the model's output layer scale or loss-induced variance, the memory-based explanation collapses.
Editorial extensions
If this is right
- In-context learning of linear functions is not an abstract algorithm: models trained on one distribution cannot extrapolate beyond the training range, even though linear regression would trivially do so.
- Accuracy and generalizability trade off: training on a wider function and input distribution extends the boundary values but degrades precision on the original narrow distribution.
- Attention layers are necessary and sufficient for in-context learning of this task; MLP-only models cannot do it.
- The model uses the entire prompt context, not a fixed small subsequence, to make its prediction, contradicting local-averaging accounts like the three-nearest-neighbor proposal.
- Larger models (with more layers and heads) have slightly wider boundary values and better performance within the boundary interval, but still fail beyond it.
Reading between the lines
- Beyond the paper: this boundary-value behavior may explain analogous out-of-distribution failures in larger language models on arithmetic and reasoning tasks; if ICL is memory-based interpolation, any prompt pulling outputs beyond the training range could trigger the same saturation or hallucination pattern.
- Beyond the paper: the accuracy-versus-generalizability trade-off suggests that simply scaling training data may not overcome the dilemma unless the architecture can represent an abstract mapping separate from the training range; architectures that force explicit function representations would be a testable alternative.
- Beyond the paper: the projection hypothesis implies ICL performance is bounded by the density of stored $(x,y)$ pairs near the query; controlling the density of training points in a region and observing whether boundary values and interpolation quality move accordingly would provide a direct test.
- Beyond the paper: benchmarking ICL only on in-distribution test sets (the ICL1 criterion) is misleading; a model can pass such a test while lacking abstract understanding, so benchmark design should always include out-of-distribution probes.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper studies in-context learning (ICL) of univariate linear functions in small transformers trained from scratch on synthetic data. The authors distinguish ICL1 (low error when training and test distributions match) from ICL2 (recovering the linear function's parameters, e.g., via linear regression). They report that their models achieve ICL1 but fail to generalize out-of-distribution, saturating at empirically determined 'boundary values' B- and B+ that they conjecture equal the extrema seen in training. They conclude that transformers do not implement linear regression for this task, propose a memory-based projection hypothesis H to explain the observations, and describe an accuracy-generalization dilemma. The paper includes a large set of experiments across architectures and distributions, with code provided.
Significance. If the central claim were established, it would challenge a substantial body of work suggesting that transformers trained on linear regression tasks implement gradient-descent-like linear regression. The empirical documentation of OOD degradation and saturation across many architectures and training distributions is a useful contribution, and the paper is careful to train from scratch, vary architectures systematically, and provide code. However, the paper's headline conclusion—that 'none of our transformer models use linear regression'—is not supported by the evidence presented, because the authors do not probe or intervene on internal representations, and the boundary-value observations are equally compatible with an internal algorithmic computation followed by a bounded readout. The proposed hypothesis H is also under-specified. The contribution is therefore best viewed as a challenging empirical phenomenon that needs stronger mechanistic evidence before the strong negative claim is accepted.
major comments (4)
- [Section 4, Observation 3; Section 6] The inference from output saturation to 'models do not use linear regression' is a false dichotomy. A transformer whose final LayerNorm/unembedding head is a bounded linear map, trained with squared error, has no loss incentive to emit values far beyond the training range; its outputs would saturate even if the hidden computation were an accurate least-squares estimator that is subsequently clipped or normalized. The paper never inspects hidden activations, ablates the readout, or performs any intervention that would distinguish 'latent linear regression plus bounded readout' from 'non-algorithmic interpolation.' Without such evidence, the central claim that 'none of our transformer models use such techniques' (Section 1) is not established.
- [Section 5, Observation 4(i)] The claim that boundary values B-, B+ are determined by the maximal and minimal function values encountered during training is asserted but not verified. For training with DF=DI=N(0,1), f(x)=ax+b with a,b,x i.i.d. N(0,1) gives f(x) ~ N(0,2), whose standard deviation is sqrt(2)≈1.414; among roughly 1.3 billion training samples the expected maximum is about 9.2, yet the paper reports boundary values near 13.7 for the 12L8AH model (Section 5, Figure 9). This mismatch suggests the boundaries may reflect the scale of the output parameterization (e.g., the unembedding matrix) rather than memorized extrema. The authors should directly test the memorization hypothesis by varying the output head scale independently, or by probing the model to show it encodes the extrema.
- [Section 5, Observation 4(ii); Section 6, Hypothesis H] Observation 4 is partly post-hoc: the parameter alpha_M is a free parameter introduced to fit the saturation curves, and the statement 'B+ < f(v) < B+ + alpha implies hat f_M(v) ≈ B+' is a restatement of the observed saturation rather than a falsifiable prediction. The subsequent hypothesis H (Section 6) is described only in prose, with no formal definition of the projection pi, the stored projections, or the closeness criterion that determines boundary behavior. Appendix G's Proposition 1, which ostensibly gives a precise advantage of H over the 3-nearest-neighbor baseline, contains undefined quantities (i, m, n) and an unproved inequality. A 'mathematically precise hypothesis' requires a formal model that generates testable predictions beyond the data from which it was inferred.
- [Section 4, Observation 2; Table 1] The claimed accuracy-generalization trade-off ('less accuracy' for models trained on larger variance) is evaluated using raw squared error, which is not scale-invariant. A model trained on N(0,10) will naturally have larger squared errors on N(0,1) targets than a model trained on N(0,1) simply because its predictions have larger variance; this does not establish lower precision in a relative sense. Reporting normalized metrics (e.g., R^2, or squared error divided by target variance) would make the trade-off claim meaningful and comparable across training distributions.
minor comments (5)
- [Section 3] The optimization objective writes 'Exi∈DI, f∈DF' but f is sampled from DF as a function; the notation should be made explicit (e.g., f∼DF, x∼DI) to avoid confusion between the function f and the distribution of its values.
- [Tables 1 and 2] Tables 1 and 2 contain overlapping rows and appear to be near-duplicates; the captions also refer to 'Table 2 in the Appendix' in a way that is easy to misread. Please consolidate the tables or cross-reference them precisely.
- [Appendix G] The statement 'P (H(x) < f(xn) + ϵ) = im × ϵn, where i > 0, m, n < 41' is not a well-formed derivation; the variables i, m, n are undefined and the expression does not follow from the previous line. This proposition needs either a rigorous proof or should be removed.
- [Section 6] In the sentence 'the higher the probability that πM(xn) = a yz_n, for a < α_M', the symbol 'a' is used both as the linear function's slope and as a multiplier; this is confusing and should be replaced with a distinct symbol.
- [Section 5 / Appendix E] The text says 'contrary to what [2,23] have suggested' but then discusses [18]'s nearest-neighbor proposal; please ensure all citation numbers match the intended references (there is also an apparent mismatch between [17] and [18] in Section 6).
Circularity Check
Central empirical boundary-value finding is independent; the Section 6 'prediction' by hypothesis H is circular because H is defined from the very B± and α it claims to predict.
-
self definitional
[Section 6 (What and how are the models learning?), following Observation 4 in Section 5]
"The boundary values and the parameter αM from Observation 4 define the limits of what a "close" element is. ... Observation 4 establishes that the projection is not linear over intervals larger than [B−, B+], and that's what our algorithm also predicts."
H is introduced only after Observation 4 and explicitly uses B−, B+, and αM from Observation 4 as inputs; the sentence quoted says the boundary values and αM define what "close" means for H. The non-linear saturation outside [B−, B+] is therefore a direct consequence of how H's "close" set is defined, not an independent empirical consequence. Presenting this as "our algorithm also predicts" is circular: the behavior was baked into the hypothesis before the prediction was made. The parameter α is also a post-hoc correction for model-size differences ('accounts for the fact that larger models ... ICL L functions over a slightly larger number of intermediate values'), not a parameter derived from first principles.
-
other
[Appendix G, Proposition 1 and its proof]
"Proposition 1. P (H(x) < f(xn) +ϵ) >> P(A(x) < f(xn) +ϵ). ... However, as H refines the projection π, P (π(xi) < f(xn) +ϵ) = im × ϵn, where i >0, m, n <41. On the other hand, P (A(x) < f(xn) +ϵ) ≈ 0)."
Proposition 1 is the paper's only formal support for preferring H over the 3-nearest-neighbor baseline, but H is never given a concrete algorithmic specification; it is only sketched as a projection that "refines" π. The proof then asserts P(π(xi) < f(xn)+ε) = im × ε^n without derivation, which simply restates the assumption that H refines π, and asserts P(A(x) < f(xn)+ε) ≈ 0 without calculation. The conclusion that H beats A is therefore assumed in the proof rather than derived from data or from a precise, testable model.
full rationale
The paper's main observational result—transformers trained on in-context linear-function data saturate at training-range boundaries and lose accuracy when f(x) is outside [B−,B+]—is not circular: it is supported by controlled training on U(−5,5), where the known maximum 30 is observed as the saturation value, and by error measurements across many architectures and distributions. The central inference that models do not perform linear regression is an interpretation of these observations; one may argue it is invalid or incomplete, but that is a correctness concern rather than a circularity. The genuinely circular passage is in Section 6, where the hypothesized algorithm H is built from B−, B+, and the post-hoc αM of Observation 4, and is then said to "predict" exactly the non-linear saturation outside [B−,B+]; that prediction is true by construction. The Appendix G Proposition 1 is likewise an unsupported assertion of H's superiority, not an independent derivation. The self-citation [3] (Asher et al.) appears in a footnote and is not load-bearing for the experimental finding. Because the central empirical claim retains independent content and the circularity is confined to the interpretive hypothesis, the appropriate score is 4.
Assumptions & free parameters
free parameters (2)
- alpha (alpha_M) =
not reported per model
- boundary values B-, B+ =
e.g., approximately ±30 for U(-5,5); varies per model
assumptions (3)
- domain assumption The autoregressive squared-error objective with the specified data sampling defines the appropriate notion of ICL performance.
- ad hoc to paper The model's inability to extrapolate beyond training-range values implies it does not implement linear regression.
- domain assumption The distribution of training values determines the boundary values (Observation 4).
invented entities (1)
-
Projection pi (memory-based projection)
Cite this review
Pith. "Pith review of Re-examining learning linear functions in context." pith.science (2026). https://pith.science/paper/YZXYXTUN
@misc{pith2026241111465,
author = {Pith},
title = {Pith review of: Re-examining learning linear functions in context},
year = {2026},
howpublished = {\url{https://pith.science/paper/YZXYXTUN}},
note = {Machine review of arXiv:2411.11465}
}
read the original abstract
In-context learning (ICL) has emerged as a powerful paradigm for easily adapting Large Language Models (LLMs) to various tasks. However, our understanding of how ICL works remains limited. We explore a simple model of ICL in a controlled setup with synthetic training data to investigate ICL of univariate linear functions. We experiment with a range of GPT-2-like transformer models trained from scratch. Our findings challenge the prevailing narrative that transformers adopt algorithmic approaches like linear regression to learn a linear function in-context. These models fail to generalize beyond their training distribution, highlighting fundamental limitations in their capacity to infer abstract task structures. Our experiments lead us to propose a mathematically precise hypothesis of what the model might be learning.
Figures
Figures from the paper (7 more)
Reference graph
Works this paper leans on
-
[1]
Advances in Neural Information Processing Systems 36, 45614–45650 (2023)
Ahn, K., Cheng, X., Daneshmand, H., Sra, S.: Transformers learn to implement preconditioned gradient descent for in-context learning. Advances in Neural Information Processing Systems 36, 45614–45650 (2023)
work page 2023
-
[2]
arXiv preprint arXiv:2211.15661 (2022) Re-examining learning linear functions in context 13
Akyürek, E., Schuurmans, D., Andreas, J., Ma, T., Zhou, D.: What learning algorithm is in-context learning? investigations with linear models. arXiv preprint arXiv:2211.15661 (2022) Re-examining learning linear functions in context 13
arXiv 2022
-
[3]
In: 12th Joint Conference on Lexical and Computational Semantics (*Sem)
Asher, N., Bhar, S., Chaturvedi, A., Hunter, J., Paul, S.: Limits for learning with large language models. In: 12th Joint Conference on Lexical and Computational Semantics (*Sem). Association for Computational Linguistics (2023)
work page 2023
-
[4]
Advances in neural information processing systems 36 (2024)
Bai, Y ., Chen, F., Wang, H., Xiong, C., Mei, S.: Transformers as statisticians: Provable in-context learning with in-context algorithm selection. Advances in neural information processing systems 36 (2024)
work page 2024
-
[5]
arXiv preprint arXiv:2310.03016 (2023)
Bhattamishra, S., Patel, A., Blunsom, P., Kanade, V .: Understanding in-context learning in transformers and llms by learning to learn discrete functions. arXiv preprint arXiv:2310.03016 (2023)
arXiv 2023
-
[6]
Advances in neural information processing systems 33, 1877–1901 (2020)
Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J.D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al.: Language models are few-shot learners. Advances in neural information processing systems 33, 1877–1901 (2020)
2020
-
[7]
arXiv preprint arXiv:2301.00234 (2022)
Dong, Q., Li, L., Dai, D., Zheng, C., Ma, J., Li, R., Xia, H., Xu, J., Wu, Z., Liu, T., et al.: A survey on in-context learning. arXiv preprint arXiv:2301.00234 (2022)
arXiv 2022
-
[8]
arXiv preprint arXiv:2310.17086 (2023)
Fu, D., Chen, T.Q., Jia, R., Sharan, V .: Transformers learn higher-order optimization methods for in-context learning: A study with linear models. arXiv preprint arXiv:2310.17086 (2023)
arXiv 2023
Show all 29 references
-
[9]
Advances in Neural Information Processing Systems 35, 30583–30598 (2022)
Garg, S., Tsipras, D., Liang, P.S., Valiant, G.: What can transformers learn in-context? a case study of simple function classes. Advances in Neural Information Processing Systems 35, 30583–30598 (2022)
2022
-
[10]
Giannou, A., Yang, L., Wang, T., Papailiopoulos, D., Lee, J.D.: How well can transformers emulate in-context newton’s method? arXiv preprint arXiv:2403.03183 (2024)
2024 arXiv
-
[11]
arXiv preprint arXiv:1412.6980 (2014)
Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014)
2014 arXiv
-
[12]
Liu, J.W., Grogan, J., Dugan, O.M., Arora, S., Rudra, A., Re, C.: Can transformers solve least squares to high precision? In: ICML 2024 Workshop on In-Context Learning (2024)
2024
-
[13]
arXiv preprint arXiv:2307.03576 (2023)
Mahankali, A., Hashimoto, T.B., Ma, T.: One step of gradient descent is provably the optimal in-context learner with one layer of linear self-attention. arXiv preprint arXiv:2307.03576 (2023)
2023 arXiv
-
[14]
arXiv preprint arXiv:2410.05229 (2024)
Mirzadeh, I., Alizadeh, K., Shahrokhi, H., Tuzel, O., Bengio, S., Farajtabar, M.: Gsm-symbolic: Understanding the limitations of mathematical reasoning in large language models. arXiv preprint arXiv:2410.05229 (2024)
2024 arXiv
-
[15]
In: ECAI 2024, pp
Naim, O., Asher, N.: On explaining with attention matrices. In: ECAI 2024, pp. 1035–1042. IOS Press (2024)
2024
-
[16]
arXiv preprint arXiv:2301.05217 (2023)
Nanda, N., Chan, L., Lieberum, T., Smith, J., Steinhardt, J.: Progress measures for grokking via mechanistic interpretability. arXiv preprint arXiv:2301.05217 (2023)
2023 arXiv
-
[17]
In: The 2023 Conference on Empirical Methods in Natural Language Processing (2023)
Olausson, T.X., Gu, A., Lipkin, B., Zhang, C.E., Solar-Lezama, A., Tenenbaum, J.B., Levy, R.P.: Linc: A neurosymbolic approach for logical reasoning by combining language models with first-order logic provers. In: The 2023 Conference on Empirical Methods in Natural Language Pr...
2023
-
[18]
arXiv preprint arXiv:2209.11895 (2022)
Olsson, C., Elhage, N., Nanda, N., Joseph, N., DasSarma, N., Henighan, T., Mann, B., Askell, A., Bai, Y ., Chen, A., et al.: In-context learning and induction heads. arXiv preprint arXiv:2209.11895 (2022)
2022 arXiv
-
[19]
arXiv preprint arXiv:2306.04891 (2023)
Panwar, M., Ahuja, K., Goyal, N.: In-context learning through the bayesian prism. arXiv preprint arXiv:2306.04891 (2023)
2023 arXiv
-
[20]
Journal of Machine Learning Research 22(75), 1–35 (2021)
Pérez, J., Barceló, P., Marinkovic, J.: Attention is turing-complete. Journal of Machine Learning Research 22(75), 1–35 (2021)
2021
-
[21]
OpenAI blog 1(8), 9 (2019)
Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I., et al.: Language models are unsupervised multitask learners. OpenAI blog 1(8), 9 (2019)
2019
-
[22]
Advances in Neural Information Processing Systems 36 (2024) 14 Omar Naim, Guilhem Fouilhé, and Nicholas Asher
Raventós, A., Paul, M., Chen, F., Ganguli, S.: Pretraining task diversity and the emergence of non-bayesian in-context learning for regression. Advances in Neural Information Processing Systems 36 (2024) 14 Omar Naim, Guilhem Fouilhé, and Nicholas Asher
2024
-
[23]
In: International Conference on Machine Learning
V on Oswald, J., Niklasson, E., Randazzo, E., Sacramento, J., Mordvintsev, A., Zhmoginov, A., Vladymyrov, M.: Transformers learn in-context by gradient descent. In: International Conference on Machine Learning. pp. 35151–35174. PMLR (2023)
2023
-
[24]
arXiv preprint arXiv:2211.00593 (2022)
Wang, K., Variengien, A., Conmy, A., Shlegeris, B., Steinhardt, J.: Interpretability in the wild: a circuit for indirect object identification in gpt-2 small. arXiv preprint arXiv:2211.00593 (2022)
2022 arXiv
-
[25]
Wu, J., Zou, D., Chen, Z., Braverman, V ., Gu, Q., Bartlett, P.L.: How many pretraining tasks are needed for in-context learning of linear regression? arXiv preprint arXiv:2310.08391 (2023)
2023 arXiv
-
[26]
arXiv preprint arXiv:2111.02080 (2021)
Xie, S.M., Raghunathan, A., Liang, P., Ma, T.: An explanation of in-context learning as implicit bayesian inference. arXiv preprint arXiv:2111.02080 (2021)
2021 arXiv
-
[27]
Journal of Machine Learning Research 25(49), 1–55 (2024)
Zhang, R., Frei, S., Bartlett, P.L.: Trained transformers learn linear models in-context. Journal of Machine Learning Research 25(49), 1–55 (2024)
2024
-
[28]
arXiv preprint arXiv:2305.19420 (2023) A Training details Additional training information: We use the Adam optimizer [11] , and a learning rate of 10−4 for all models
Zhang, Y ., Zhang, F., Yang, Z., Wang, Z.: What and how does in-context learning learn? bayesian model averaging, parameterization, and generalization. arXiv preprint arXiv:2305.19420 (2023) A Training details Additional training information: We use the Adam optimizer [11] , a...
2023 arXiv
-
[29]
If we do this, the value predicted will be 0.15 for the first input, which is far from 0.4 and 0.3 instead of 0.5 for the second example
suggests that models average over three closest neighbors. If we do this, the value predicted will be 0.15 for the first input, which is far from 0.4 and 0.3 instead of 0.5 for the second example. The model’s method is clearly superior. Here is another example showing the limi...
Reviewed August 12, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.