mlsanityData to 7 Oct 2026

Asymptotic theory of in-context learning by linear attention

arXiv 2405.11751 ↗First posted 20 May 2024stat.ML cond-mat.dis-nn cs.LGcited by 54

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  5. 2023GPT-4 Technical Reportcited by 18,132
  6. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  7. 2022Emergent Abilities of Large Language Modelscited by 2,483
  8. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  9. 2022Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language modelscited by 1,970
  10. 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
  11. 2022In-context Learning and Induction Headscited by 930
  12. 2018Reconciling modern machine learning practice and the bias-variance trade-offcited by 919
29 more
  1. 2022Transformers learn in-context by gradient descentcited by 714
  2. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  3. 2023Are Emergent Abilities of Large Language Models a Mirage?cited by 515
  4. 2019Surprises in High-Dimensional Ridgeless Least Squares Interpolationcited by 508
  5. 2019The generalization error of random features regression: Precise asymptotics and double descent curvecited by 410
  6. 2023Scaling Data-Constrained Language Modelscited by 391
  7. 2018Efficient Attention: Attention with Linear Complexitiescited by 366
  8. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  9. 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
  10. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
  11. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
  12. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
  13. 2022Predictability and Surprise in Large Generative Modelscited by 209
  14. 2022Hidden Progress in Deep Learning: SGD Learns Parities Near the Computational Limitcited by 184
  15. 2023Birth of a Transformer: A Memory Viewpointcited by 154
  16. 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 138
  17. 2020Generalisation error in learning with random features and the hidden manifold modelcited by 126
  18. 2021Learning curves of generic features maps for realistic datasets with a teacher-student modelcited by 126
  19. 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
  20. 2018Does data interpolation contradict statistical optimality?cited by 95
  21. 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 93
  22. 2022Universality of empirical risk minimizationcited by 73
  23. 2023The Transient Nature of Emergent In-Context Learning in Transformerscited by 72
  24. 2024Scaling and renormalization in high-dimensional regressioncited by 45
  25. 2024A phase transition between positional and semantic learning in a solvable model of dot-product attentioncited by 30
  26. 2024In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initializationcited by 30
  27. 2024Asymptotics of Random Feature Regression Beyond the Linear Scaling Regimecited by 22
  28. 2023Universality for the global spectrum of random inner-product kernel matrices in the polynomial regimecited by 8
  29. 2021Householder Dice: A Matrix-Free Algorithm for Simulating Dynamics on Gaussian and Random Orthogonal Ensemblescited by 4

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 10; 2025: 26; 2026: 18.

54 papers.

Sort:

By area:

  1. 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
  2. 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 29
  3. 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 22
  4. 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Timecited by 15
  5. 2025Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidencecited by 13
  6. 2025When can in-context learning generalize out of task distribution?cited by 13
  7. 2024MLPs Learn In-Context on Regression and Classification Taskscited by 12
  8. 2024High-dimensional learning of narrow neural networkscited by 12
  9. 2024Risk and cross validation in ridge regression with correlated samplescited by 8
  10. 2025Transformer learns the cross-task prior and regularization for in-context learningcited by 7
  11. 2025Preventing Model Collapse Under Overparametrization: Optimal Mixing Ratios for Interpolation Learning and Ridge Regressioncited by 7
  12. 2026Efficient and Minimax Optimal In-context Nonparametric Regression with Transformerscited by 7
38 more
  1. 2026To Use or not to Use Muon: How Simplicity Bias in Optimizers Matterscited by 7
  2. 2024Context-Scaling versus Task-Scaling in In-Context Learningcited by 6
  3. 2025Statistical Advantage of Softmax Attention: Insights from Single-Location Regressioncited by 6
  4. 2025Pretrain-Test Task Alignment Governs Generalization in In-Context Learningcited by 6
  5. 2025From Shortcut to Induction Head: How Data Diversity Shapes Algorithm Selection in Transformerscited by 6
  6. 2024In-Context Learning of Linear Systems: Generalization Theory and Applications to Operator Learningcited by 5
  7. 2025Learning Causal Graphs at Scale: A Foundation Model Approachcited by 4
  8. 2025In-Context Occam's Razor: How Transformers Prefer Simpler Hypotheses on the Flycited by 4
  9. 2025Provable In-Context Learning of Nonlinear Regression with Transformerscited by 4
  10. 2024Bilinear Sequence Regression: A Model for Learning from Long Sequences of High-dimensional Tokenscited by 3
  11. 2024Associative memory inspires improvements for in-context learning using a novel attention residual stream architecturecited by 3
  12. 2025Exact Learning Dynamics of In-Context Learning in Linear Transformers and Its Application to Non-Linear Transformerscited by 3
  13. 2025Bayes optimal learning of attention-indexed modelscited by 3
  14. 2025Provable Low-Frequency Bias of In-Context Learning of Representationscited by 3
  15. 2025Asymptotic Study of In-context Learning with Random Transformers through Equivalent Modelscited by 3
  16. 2025On the Emergence of Induction Heads for In-Context Learningcited by 3
  17. 2025Softmax as Linear Attention in the Large-Prompt Regime: a Measure-based Perspectivecited by 3
  18. 2025On the geometry and topology of representations: the manifolds of modular additioncited by 3
  19. 2026Distinct mechanisms underlying in-context learning in transformerscited by 3
  20. 2024Spin glass model of in-context learningcited by 2
  21. 2025Softmax ≥ Linear: Transformers may learn to classify in-context by kernel gradient descentcited by 2
  22. 2026Multi-layer Cross-attention is Provably Optimal for Multi-modal In-context Learningcited by 2
  23. 2026Understanding In-Context Learning for Nonlinear Regression with Transformers: Attention as Featurizercited by 2
  24. 2025Transformers Provably Learn Sparse XOR with Polylogarithmic Parameterscited by 1
  25. 2025In-Context Learning of Linear Dynamical Systems with Transformers: Approximation Bounds and Depth-Separationcited by 1
  26. 2025Neural Interpretable PDEs: Harmonizing Fourier Insights with Attention for Scalable and Interpretable Physics Discoverycited by 1
  27. 2025Learning Linear Regression with Low-Rank Tasks in-Contextcited by 1
  28. 2025How Data Mixing Shapes In-Context Learning: Asymptotic Equivalence for Transformers with MLPscited by 1
  29. 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descentcited by 1
  30. 2026Understanding and Improving Continuous Adversarial Training for LLMs via In-context Learning Theorycited by 1
  31. 2025Minimax Rates for Learning Pairwise Interactions in Attention-Style Modelscited by 0
  32. 2026A Theory of Diversity for Random Matrices with Applications to In-Context Learning of Schr"odinger Equationscited by 0
  33. 2026Data Distribution as a Lever for Guiding Optimizers Toward Superior Generalization in LLMscited by 0
  34. 2026When Does Context Help? Error Dynamics of Contextual Information in Large Language Modelscited by 0
  35. 2026Transformers Can Implement Preconditioned Richardson Iteration for In-Context Gaussian Kernel Regressioncited by 0
  36. 2026Understanding Generalization and Forgetting in In-Context Continual Learningcited by 0
  37. 2026An Asymptotic Theory of Chain-of-Thought in In-Context Learningcited by 0
  38. 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)