mlsanityData to 7 Oct 2026

In-Context Convergence of Transformers

arXiv 2310.05249 ↗First posted 8 Oct 2023cs.LG cs.AI math.OCcited by 112

Not on the map. Why?

Abstract (arXiv)

Transformers have recently revolutionized many domains in modern machine learning and one salient discovery is their remarkable in-context learning capability, where models can solve an unseen task by utilizing task-specific prompts without further parameters fine-tuning. This also inspired recent theoretical studies aiming to understand the in-context learning mechanism of transformers, which however focused only on linear transformers. In this work, we take the first step toward studying the learning dynamics of a one-layer transformer with softmax attention trained via gradient descent in order to in-context learn linear function classes. We consider a structured data model, where each token is randomly sampled from a set of feature vectors in either balanced or imbalanced fashion. For data with balanced features, we establish the finite-time convergence guarantee with near-zero prediction error by navigating our analysis over two phases of the training dynamics of the attention map. More notably, for data with imbalanced features, we show that the learning dynamics take a stage-wise convergence process, where the transformer first converges to a near-zero prediction error for the query tokens of dominant features, and then converges later to a near-zero prediction error for the query tokens of under-represented features, respectively via one and four training phases. Our proof features new techniques for analyzing the competing strengths of two types of attention weights, the change of which determines different training phases.

Key facts. Cited by 112 papers in the map (data through 7 Oct 2026). Builds on 34 of its 37 references that are in the map. First posted on arXiv 8 Oct 2023.

Builds on

34 of 37 references.

References · 34

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  4. 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,339
  5. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
  6. 2020Reformer: The Efficient Transformercited by 1,658
  7. 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,528
  8. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
  9. 2019Class-Balanced Loss Based on Effective Number of Samplescited by 1,239
  10. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
  11. 2022Transformers learn in-context by gradient descentcited by 714
  12. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
22 more
  1. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
  2. 2021Offline Reinforcement Learning as One Big Sequence Modeling Problemcited by 636
  3. 2023Larger language models do in-context learning differentlycited by 386
  4. 2023Trained Transformers Learn Linear Models In-Contextcited by 331
  5. 2020Towards Understanding Ensemble, Knowledge Distillation and Self-Distillation in Deep Learningcited by 292
  6. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
  7. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
  8. 2023Looped Transformers as Programmable Computerscited by 224
  9. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
  10. 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
  11. 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
  12. 2023Large Language Models Are Latent Variable Models: Explaining and Finding Good Demonstrations for In-Context Learningcited by 149
  13. 2020Remix: Rebalanced Mixupcited by 144
  14. 2023The Learnability of In-Context Learningcited by 126
  15. 2022Modality Competition: What Makes Joint Training of Multi-modal Network Fail in Deep Learning? (Provably)cited by 115
  16. 2023What and How does In-Context Learning Learn? Bayesian Model Averaging, Parameterization, and Generalizationcited by 112
  17. 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
  18. 2022Vision Transformers provably learn spatial structurecited by 92
  19. 2023In-Context Learning through the Bayesian Prismcited by 78
  20. 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
  21. 2023Transformers as Support Vector Machinescited by 67
  22. 2023A Latent Space Theory for Emergent Abilities in Large Language Modelscited by 42

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 2; 2024: 50; 2025: 40; 2026: 20.

112 papers.

Sort:

By area:

  1. 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
  2. 2024Can large language models explore in-context?cited by 75
  3. 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
  4. 2024From Words to Numbers: Your Large Language Model Is Secretly A Capable Regressor When Given In-Context Examplescited by 55
  5. 2024Active-Dormant Attention Heads: Mechanistically Demystifying Extreme-Token Phenomena in LLMscited by 54
  6. 2024Theory on Mixture-of-Experts in Continual Learningcited by 50
  7. 2024Transformers Provably Solve Parity Efficiently with Chain of Thoughtcited by 49
  8. 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
  9. 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
  10. 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 43
  11. 2024A Theoretical Understanding of Self-Correction through In-context Alignmentcited by 43
  12. 2024An Information-Theoretic Analysis of In-Context Learningcited by 39
38 more
  1. 2025When is Task Vector Provably Effective for Model Editing? A Generalization Analysis of Nonlinear Transformerscited by 38
  2. 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 36
  3. 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 36
  4. 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
  5. 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
  6. 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thoughtcited by 32
  7. 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 29
  8. 2024Linear Transformers are Versatile In-Context Learnerscited by 28
  9. 2026Preconditioning Benefits of Spectral Orthogonalization in Muoncited by 28
  10. 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamicscited by 27
  11. 2024Unveiling the Statistical Foundations of Chain-of-Thought Prompting Methodscited by 27
  12. 2024How Well Can Transformers Emulate In-context Newton's Method?cited by 23
  13. 2024Can In-context Learning Really Generalize to Out-of-distribution Tasks?cited by 23
  14. 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
  15. 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 21
  16. 2024Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descentcited by 21
  17. 2024A Survey on Statistical Theory of Deep Learning: Approximation, Training Dynamics, and Generative Modelscited by 20
  18. 2025How Do LLMs Perform Two-Hop Reasoning in Context?cited by 20
  19. 2024Superiority of Multi-Head Attention in In-Context Linear Regressioncited by 17
  20. 2024Implicit Regularization of Gradient Flow on One-Layer Softmax Attentioncited by 16
  21. 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixturescited by 15
  22. 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
  23. 2024One-Layer Transformer Provably Learns One-Nearest Neighbor In Contextcited by 14
  24. 2024How Transformers Utilize Multi-Head Attention in In-Context Learning? A Case Study on Sparse Linear Regressioncited by 13
  25. 2024Non-asymptotic Convergence of Training Transformers for Next-token Predictioncited by 13
  26. 2024A Theoretical Understanding of Chain-of-Thought: Coherent Reasoning and Error-Aware Demonstrationcited by 13
  27. 2025Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidencecited by 13
  28. 2024AlgoFormer: An Efficient Transformer Framework with Algorithmic Structurescited by 11
  29. 2024Unraveling the Gradient Descent Dynamics of Transformerscited by 11
  30. 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 11
  31. 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Biascited by 10
  32. 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformerscited by 10
  33. 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selectioncited by 9
  34. 2023Transformers are Provably Optimal In-context Estimators for Wireless Communicationscited by 8
  35. 2024Learning on Transformers is Provable Low-Rank and Sparse: A One-layer Analysiscited by 8
  36. 2024Transformers Handle Endogeneity in In-Context Linear Regressioncited by 8
  37. 2024Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysiscited by 8
  38. 2024How Transformers Get Rich: Approximation and Dynamics Analysiscited by 7

50 most cited of 112 All 112 (JSON)