Asymptotic theory of in-context learning by linear attention
Not on the map. Why?
Abstract (arXiv)
Transformers have a remarkable ability to learn and execute tasks based on examples provided within the input itself, without explicit prior training. It has been argued that this capability, known as in-context learning (ICL), is a cornerstone of Transformers' success, yet questions about the necessary sample complexity, pretraining task diversity, and context length for successful ICL remain unresolved. Here, we provide a precise answer to these questions in an exactly solvable model of ICL of a linear regression task by linear attention. We derive sharp asymptotics for the learning curve in a phenomenologically-rich scaling regime where the token dimension is taken to infinity; the context length and pretraining task diversity scale proportionally with the token dimension; and the number of pretraining examples scales quadratically. We demonstrate a double-descent learning curve with increasing pretraining examples, and uncover a phase transition in the model's behavior between low and high task diversity regimes: In the low diversity regime, the model tends toward memorization of training tasks, whereas in the high diversity regime, it achieves genuine in-context learning and generalization beyond the scope of pretrained tasks. These theoretical insights are empirically validated through experiments with both linear attention and full nonlinear Transformer architectures.
Key facts. Cited by 54 papers in the map (data through 7 Oct 2026). Builds on 41 of its 73 references that are in the map. First posted on arXiv 20 May 2024.
Builds on
41 of 73 references.
References · 41
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2023GPT-4 Technical Reportcited by 18,132
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2022Emergent Abilities of Large Language Modelscited by 2,483
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
- 2022Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language modelscited by 1,970
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
- 2022In-context Learning and Induction Headscited by 930
- 2018Reconciling modern machine learning practice and the bias-variance trade-offcited by 919
29 more
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2023Are Emergent Abilities of Large Language Models a Mirage?cited by 515
- 2019Surprises in High-Dimensional Ridgeless Least Squares Interpolationcited by 508
- 2019The generalization error of random features regression: Precise asymptotics and double descent curvecited by 410
- 2023Scaling Data-Constrained Language Modelscited by 391
- 2018Efficient Attention: Attention with Linear Complexitiescited by 366
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
- 2022Predictability and Surprise in Large Generative Modelscited by 209
- 2022Hidden Progress in Deep Learning: SGD Learns Parities Near the Computational Limitcited by 184
- 2023Birth of a Transformer: A Memory Viewpointcited by 154
- 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 138
- 2020Generalisation error in learning with random features and the hidden manifold modelcited by 126
- 2021Learning curves of generic features maps for realistic datasets with a teacher-student modelcited by 126
- 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
- 2018Does data interpolation contradict statistical optimality?cited by 95
- 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 93
- 2022Universality of empirical risk minimizationcited by 73
- 2023The Transient Nature of Emergent In-Context Learning in Transformerscited by 72
- 2024Scaling and renormalization in high-dimensional regressioncited by 45
- 2024A phase transition between positional and semantic learning in a solvable model of dot-product attentioncited by 30
- 2024In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initializationcited by 30
- 2024Asymptotics of Random Feature Regression Beyond the Linear Scaling Regimecited by 22
- 2023Universality for the global spectrum of random inner-product kernel matrices in the polynomial regimecited by 8
- 2021Householder Dice: A Matrix-Free Algorithm for Simulating Dynamics on Gaussian and Random Orthogonal Ensemblescited by 4
Built on by
Citing papers per year: 2024: 10; 2025: 26; 2026: 18.
54 papers.
Sort:
By area:
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 29
- 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 22
- 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Timecited by 15
- 2025Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidencecited by 13
- 2025When can in-context learning generalize out of task distribution?cited by 13
- 2024MLPs Learn In-Context on Regression and Classification Taskscited by 12
- 2024High-dimensional learning of narrow neural networkscited by 12
- 2024Risk and cross validation in ridge regression with correlated samplescited by 8
- 2025Transformer learns the cross-task prior and regularization for in-context learningcited by 7
- 2025Preventing Model Collapse Under Overparametrization: Optimal Mixing Ratios for Interpolation Learning and Ridge Regressioncited by 7
- 2026Efficient and Minimax Optimal In-context Nonparametric Regression with Transformerscited by 7
38 more
- 2026To Use or not to Use Muon: How Simplicity Bias in Optimizers Matterscited by 7
- 2024Context-Scaling versus Task-Scaling in In-Context Learningcited by 6
- 2025Statistical Advantage of Softmax Attention: Insights from Single-Location Regressioncited by 6
- 2025Pretrain-Test Task Alignment Governs Generalization in In-Context Learningcited by 6
- 2025From Shortcut to Induction Head: How Data Diversity Shapes Algorithm Selection in Transformerscited by 6
- 2024In-Context Learning of Linear Systems: Generalization Theory and Applications to Operator Learningcited by 5
- 2025Learning Causal Graphs at Scale: A Foundation Model Approachcited by 4
- 2025In-Context Occam's Razor: How Transformers Prefer Simpler Hypotheses on the Flycited by 4
- 2025Provable In-Context Learning of Nonlinear Regression with Transformerscited by 4
- 2024Bilinear Sequence Regression: A Model for Learning from Long Sequences of High-dimensional Tokenscited by 3
- 2024Associative memory inspires improvements for in-context learning using a novel attention residual stream architecturecited by 3
- 2025Exact Learning Dynamics of In-Context Learning in Linear Transformers and Its Application to Non-Linear Transformerscited by 3
- 2025Bayes optimal learning of attention-indexed modelscited by 3
- 2025Provable Low-Frequency Bias of In-Context Learning of Representationscited by 3
- 2025Asymptotic Study of In-context Learning with Random Transformers through Equivalent Modelscited by 3
- 2025On the Emergence of Induction Heads for In-Context Learningcited by 3
- 2025Softmax as Linear Attention in the Large-Prompt Regime: a Measure-based Perspectivecited by 3
- 2025On the geometry and topology of representations: the manifolds of modular additioncited by 3
- 2026Distinct mechanisms underlying in-context learning in transformerscited by 3
- 2024Spin glass model of in-context learningcited by 2
- 2025Softmax ≥ Linear: Transformers may learn to classify in-context by kernel gradient descentcited by 2
- 2026Multi-layer Cross-attention is Provably Optimal for Multi-modal In-context Learningcited by 2
- 2026Understanding In-Context Learning for Nonlinear Regression with Transformers: Attention as Featurizercited by 2
- 2025Transformers Provably Learn Sparse XOR with Polylogarithmic Parameterscited by 1
- 2025In-Context Learning of Linear Dynamical Systems with Transformers: Approximation Bounds and Depth-Separationcited by 1
- 2025Neural Interpretable PDEs: Harmonizing Fourier Insights with Attention for Scalable and Interpretable Physics Discoverycited by 1
- 2025Learning Linear Regression with Low-Rank Tasks in-Contextcited by 1
- 2025How Data Mixing Shapes In-Context Learning: Asymptotic Equivalence for Transformers with MLPscited by 1
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descentcited by 1
- 2026Understanding and Improving Continuous Adversarial Training for LLMs via In-context Learning Theorycited by 1
- 2025Minimax Rates for Learning Pairwise Interactions in Attention-Style Modelscited by 0
- 2026A Theory of Diversity for Random Matrices with Applications to In-Context Learning of Schr"odinger Equationscited by 0
- 2026Data Distribution as a Lever for Guiding Optimizers Toward Superior Generalization in LLMscited by 0
- 2026When Does Context Help? Error Dynamics of Contextual Information in Large Language Modelscited by 0
- 2026Transformers Can Implement Preconditioned Richardson Iteration for In-Context Gaussian Kernel Regressioncited by 0
- 2026Understanding Generalization and Forgetting in In-Context Continual Learningcited by 0
- 2026An Asymptotic Theory of Chain-of-Thought in In-Context Learningcited by 0
- 2026The Effect of Training Task Diversity on In-Context Learning through the Lens of Low-Dimensional Subspacescited by 0
50 most cited of 54 All 54 (JSON)
- 2026On the Importance of Gating: Memorization vs. In-Context Learning in State Space Models15 Sep 2026
- 2026Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatch4 Jul 2026
- 2026Induction Heads Interpolate N-Grams2 Jul 2026
- 2026When Does Depth Matter For In-Context Learning? Adaptive Inference in Deep Transformers15 Jun 2026
- 2026The Effect of Training Task Diversity on In-Context Learning through the Lens of Low-Dimensional Subspaces5 Jun 2026
- 2026An Asymptotic Theory of Chain-of-Thought in In-Context Learning2 Jun 2026
- 2026Understanding Generalization and Forgetting in In-Context Continual Learning27 May 2026
- 2026Transformers Can Implement Preconditioned Richardson Iteration for In-Context Gaussian Kernel Regression8 May 2026
- 2026Understanding In-Context Learning for Nonlinear Regression with Transformers: Attention as Featurizer6 May 2026
- 2026Understanding and Improving Continuous Adversarial Training for LLMs via In-context Learning Theory14 Apr 2026
- 2026Distinct mechanisms underlying in-context learning in transformers14 Apr 2026
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
38 more
- 2026To Use or not to Use Muon: How Simplicity Bias in Optimizers Matters28 Feb 2026
- 2026When Does Context Help? Error Dynamics of Contextual Information in Large Language Models9 Feb 2026
- 2026Multi-layer Cross-attention is Provably Optimal for Multi-modal In-context Learning4 Feb 2026
- 2026Data Distribution as a Lever for Guiding Optimizers Toward Superior Generalization in LLMs31 Jan 2026
- 2026Efficient and Minimax Optimal In-context Nonparametric Regression with Transformers21 Jan 2026
- 2026A Theory of Diversity for Random Matrices with Applications to In-Context Learning of Schr"odinger Equations18 Jan 2026
- 2025On the geometry and topology of representations: the manifolds of modular addition31 Dec 2025
- 2025From Shortcut to Induction Head: How Data Diversity Shapes Algorithm Selection in Transformers21 Dec 2025
- 2025Softmax as Linear Attention in the Large-Prompt Regime: a Measure-based Perspective12 Dec 2025
- 2025On the Emergence of Induction Heads for In-Context Learning2 Nov 2025
- 2025How Data Mixing Shapes In-Context Learning: Asymptotic Equivalence for Transformers with MLPs29 Oct 2025
- 2025Minimax Rates for Learning Pairwise Interactions in Attention-Style Models13 Oct 2025
- 2025Softmax ≥ Linear: Transformers may learn to classify in-context by kernel gradient descent12 Oct 2025
- 2025Learning Linear Regression with Low-Rank Tasks in-Context6 Oct 2025
- 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time1 Oct 2025
- 2025Pretrain-Test Task Alignment Governs Generalization in In-Context Learning30 Sep 2025
- 2025Preventing Model Collapse Under Overparametrization: Optimal Mixing Ratios for Interpolation Learning and Ridge Regression26 Sep 2025
- 2025Statistical Advantage of Softmax Attention: Insights from Single-Location Regression26 Sep 2025
- 2025Asymptotic Study of In-context Learning with Random Transformers through Equivalent Models18 Sep 2025
- 2025Provable In-Context Learning of Nonlinear Regression with Transformers28 Jul 2025
- 2025Provable Low-Frequency Bias of In-Context Learning of Representations17 Jul 2025
- 2025In-Context Occam's Razor: How Transformers Prefer Simpler Hypotheses on the Fly24 Jun 2025
- 2025Learning Causal Graphs at Scale: A Foundation Model Approach23 Jun 2025
- 2025When can in-context learning generalize out of task distribution?5 Jun 2025
- 2025Bayes optimal learning of attention-indexed models2 Jun 2025
- 2025Neural Interpretable PDEs: Harmonizing Fourier Insights with Attention for Scalable and Interpretable Physics Discovery29 May 2025
- 2025Transformer learns the cross-task prior and regularization for in-context learning17 May 2025
- 2025Exact Learning Dynamics of In-Context Learning in Linear Transformers and Its Application to Non-Linear Transformers17 Apr 2025
- 2025In-Context Learning of Linear Dynamical Systems with Transformers: Approximation Bounds and Depth-Separation12 Feb 2025
- 2025Transformers Provably Learn Sparse XOR with Polylogarithmic Parameters11 Feb 2025
- 2025Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidence6 Feb 2025
- 2025Training Dynamics of In-Context Learning in Linear Attention27 Jan 2025
- 2024Associative memory inspires improvements for in-context learning using a novel attention residual stream architecture19 Dec 2024
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-context4 Nov 2024
- 2024Bilinear Sequence Regression: A Model for Learning from Long Sequences of High-dimensional Tokens24 Oct 2024
- 2024Context-Scaling versus Task-Scaling in In-Context Learning16 Oct 2024
- 2024High-dimensional learning of narrow neural networks20 Sep 2024
- 2024In-Context Learning of Linear Systems: Generalization Theory and Applications to Operator Learning18 Sep 2024
50 newest of 54 All 54 (JSON)
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 29
- 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 22
- 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Timecited by 15
- 2025When can in-context learning generalize out of task distribution?cited by 13
- 2024MLPs Learn In-Context on Regression and Classification Taskscited by 12
- 2024High-dimensional learning of narrow neural networkscited by 12
- 2024Risk and cross validation in ridge regression with correlated samplescited by 8
- 2025Transformer learns the cross-task prior and regularization for in-context learningcited by 7
- 2026Efficient and Minimax Optimal In-context Nonparametric Regression with Transformerscited by 7
- 2026To Use or not to Use Muon: How Simplicity Bias in Optimizers Matterscited by 7
- 2024Context-Scaling versus Task-Scaling in In-Context Learningcited by 6
12 most cited of 50 All 50 (JSON)
- 2026On the Importance of Gating: Memorization vs. In-Context Learning in State Space Models15 Sep 2026
- 2026Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatch4 Jul 2026
- 2026Induction Heads Interpolate N-Grams2 Jul 2026
- 2026When Does Depth Matter For In-Context Learning? Adaptive Inference in Deep Transformers15 Jun 2026
- 2026The Effect of Training Task Diversity on In-Context Learning through the Lens of Low-Dimensional Subspaces5 Jun 2026
- 2026Understanding Generalization and Forgetting in In-Context Continual Learning27 May 2026
- 2026Transformers Can Implement Preconditioned Richardson Iteration for In-Context Gaussian Kernel Regression8 May 2026
- 2026Understanding In-Context Learning for Nonlinear Regression with Transformers: Attention as Featurizer6 May 2026
- 2026Distinct mechanisms underlying in-context learning in transformers14 Apr 2026
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
- 2026To Use or not to Use Muon: How Simplicity Bias in Optimizers Matters28 Feb 2026
- 2026When Does Context Help? Error Dynamics of Contextual Information in Large Language Models9 Feb 2026
12 newest of 50 All 50 (JSON)