In-Context Convergence of Transformers
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
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2021Masked Autoencoders Are Scalable Vision Learnerscited by 7,339
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2020Reformer: The Efficient Transformercited by 1,658
- 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,528
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 2019Class-Balanced Loss Based on Effective Number of Samplescited by 1,239
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
22 more
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2021Offline Reinforcement Learning as One Big Sequence Modeling Problemcited by 636
- 2023Larger language models do in-context learning differentlycited by 386
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2020Towards Understanding Ensemble, Knowledge Distillation and Self-Distillation in Deep Learningcited by 292
- 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
- 2023Looped Transformers as Programmable Computerscited by 224
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
- 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
- 2023Large Language Models Are Latent Variable Models: Explaining and Finding Good Demonstrations for In-Context Learningcited by 149
- 2020Remix: Rebalanced Mixupcited by 144
- 2023The Learnability of In-Context Learningcited by 126
- 2022Modality Competition: What Makes Joint Training of Multi-modal Network Fail in Deep Learning? (Provably)cited by 115
- 2023What and How does In-Context Learning Learn? Bayesian Model Averaging, Parameterization, and Generalizationcited by 112
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
- 2022Vision Transformers provably learn spatial structurecited by 92
- 2023In-Context Learning through the Bayesian Prismcited by 78
- 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
- 2023Transformers as Support Vector Machinescited by 67
- 2023A Latent Space Theory for Emergent Abilities in Large Language Modelscited by 42
Built on by
Citing papers per year: 2023: 2; 2024: 50; 2025: 40; 2026: 20.
112 papers.
Sort:
By area:
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
- 2024Can large language models explore in-context?cited by 75
- 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
- 2024From Words to Numbers: Your Large Language Model Is Secretly A Capable Regressor When Given In-Context Examplescited by 55
- 2024Active-Dormant Attention Heads: Mechanistically Demystifying Extreme-Token Phenomena in LLMscited by 54
- 2024Theory on Mixture-of-Experts in Continual Learningcited by 50
- 2024Transformers Provably Solve Parity Efficiently with Chain of Thoughtcited by 49
- 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
- 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 43
- 2024A Theoretical Understanding of Self-Correction through In-context Alignmentcited by 43
- 2024An Information-Theoretic Analysis of In-Context Learningcited by 39
38 more
- 2025When is Task Vector Provably Effective for Model Editing? A Generalization Analysis of Nonlinear Transformerscited by 38
- 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 36
- 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 36
- 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
- 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thoughtcited by 32
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 29
- 2024Linear Transformers are Versatile In-Context Learnerscited by 28
- 2026Preconditioning Benefits of Spectral Orthogonalization in Muoncited by 28
- 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamicscited by 27
- 2024Unveiling the Statistical Foundations of Chain-of-Thought Prompting Methodscited by 27
- 2024How Well Can Transformers Emulate In-context Newton's Method?cited by 23
- 2024Can In-context Learning Really Generalize to Out-of-distribution Tasks?cited by 23
- 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
- 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 21
- 2024Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descentcited by 21
- 2024A Survey on Statistical Theory of Deep Learning: Approximation, Training Dynamics, and Generative Modelscited by 20
- 2025How Do LLMs Perform Two-Hop Reasoning in Context?cited by 20
- 2024Superiority of Multi-Head Attention in In-Context Linear Regressioncited by 17
- 2024Implicit Regularization of Gradient Flow on One-Layer Softmax Attentioncited by 16
- 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixturescited by 15
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
- 2024One-Layer Transformer Provably Learns One-Nearest Neighbor In Contextcited by 14
- 2024How Transformers Utilize Multi-Head Attention in In-Context Learning? A Case Study on Sparse Linear Regressioncited by 13
- 2024Non-asymptotic Convergence of Training Transformers for Next-token Predictioncited by 13
- 2024A Theoretical Understanding of Chain-of-Thought: Coherent Reasoning and Error-Aware Demonstrationcited by 13
- 2025Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidencecited by 13
- 2024AlgoFormer: An Efficient Transformer Framework with Algorithmic Structurescited by 11
- 2024Unraveling the Gradient Descent Dynamics of Transformerscited by 11
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 11
- 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Biascited by 10
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformerscited by 10
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selectioncited by 9
- 2023Transformers are Provably Optimal In-context Estimators for Wireless Communicationscited by 8
- 2024Learning on Transformers is Provable Low-Rank and Sparse: A One-layer Analysiscited by 8
- 2024Transformers Handle Endogeneity in In-Context Linear Regressioncited by 8
- 2024Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysiscited by 8
- 2024How Transformers Get Rich: Approximation and Dynamics Analysiscited by 7
50 most cited of 112 All 112 (JSON)
- 2026Leaner Transformers Can Easily Learn to Cluster7 Oct 2026
- 2026Theory on Attention Dynamics for Out-of-Distribution In-Context Learning29 Sep 2026
- 2026Training-Free Universal Approximation by Prompting Random Transformers10 Aug 2026
- 2026In-Context Reward Adaptation for Robust Preference Modeling28 May 2026
- 2026Transformers Provably Learn to Internalize Chain-of-Thought27 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
- 2026Learning to Adapt: In-Context Learning Beyond Stationarity13 Apr 2026
- 2026Transformers Learn the Optimal DDPM Denoiser for Multi-Token GMMs11 Apr 2026
- 2026Visual prompting reimagined: The power of the Activation Prompts7 Apr 2026
- 2026Attention-Based Sampler for Diffusion Language Models18 Mar 2026
38 more
- 2026Fine-Tuning Without Forgetting In-Context Learning: A Theoretical Analysis of Linear Attention Models26 Feb 2026
- 2026Incremental Learning of Sparse Attention Patterns in Transformers22 Feb 2026
- 2026Multi-layer Cross-attention is Provably Optimal for Multi-modal In-context Learning4 Feb 2026
- 2026Breaking the Reversal Curse in Autoregressive Language Models via Identity Bridge2 Feb 2026
- 2026Provably Learning Attention with Queries23 Jan 2026
- 2026Finite-Time Analysis of Gradient Descent for Shallow Transformers23 Jan 2026
- 2026Preconditioning Benefits of Spectral Orthogonalization in Muon20 Jan 2026
- 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformers15 Jan 2026
- 2025Softmax as Linear Attention in the Large-Prompt Regime: a Measure-based Perspective12 Dec 2025
- 2025Token Sample Complexity of Attention11 Dec 2025
- 2025Towards Understanding Transformers in Learning Random Walks28 Nov 2025
- 2025Bilevel Data Curation for LLM Fine-tuning: Offline Selection and Online Self-Refining Generation26 Nov 2025
- 2025Provable Benefit of Curriculum in Transformer Tree-Reasoning Post-Training10 Nov 2025
- 2025Mixture-of-Transformers Learn Faster: A Theoretical Study on Classification Problems30 Oct 2025
- 2025Transformers Provably Learn Directed Acyclic Graphs via Kernel-Guided Mutual Information29 Oct 2025
- 2025A Framework for Quantifying How Pre-Training and Context Benefit In-Context Learning26 Oct 2025
- 2025Transformers are almost optimal metalearners for linear classification22 Oct 2025
- 2025Optimality and NP-Hardness of Transformers in Learning Markovian Dynamical Functions21 Oct 2025
- 2025Mamba Can Learn Low-Dimensional Targets In-Context via Test-Time Feature Learning14 Oct 2025
- 2025Softmax ≥ Linear: Transformers may learn to classify in-context by kernel gradient descent12 Oct 2025
- 2025How Can Mamba Learn In Context with Outliers and Generalize Provably?1 Oct 2025
- 2025Test time training enhances in-context learning of nonlinear functions30 Sep 2025
- 2025Trained Mamba Emulates Online Gradient Descent in In-Context Linear Regression28 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
- 2025Transformer Circuits Can Realize Clustering Algorithms23 Jun 2025
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformers12 Jun 2025
- 2025Federated In-Context Learning: Iterative Refinement for Improved Answer Quality9 Jun 2025
- 2025On the Convergence of Gradient Descent on Learning Transformers with Residual Connections5 Jun 2025
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theory5 Jun 2025
- 2025Minimalist Softmax Attention Provably Learns Constrained Boolean Functions26 May 2025
- 2025How Transformers Learn In-Context Recall Tasks? Optimality, Training Dynamics and Generalization21 May 2025
- 2025Out-of-Distribution Generalization of In-Context Learning: A Low-Dimensional Subspace Perspective20 May 2025
- 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Bias2 May 2025
- 2025When is Task Vector Provably Effective for Model Editing? A Generalization Analysis of Nonlinear Transformers15 Apr 2025
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learning6 Apr 2025
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thought28 Feb 2025
- 2025Disentangling Feature Structure: A Mathematically Provable Two-Stage Training Dynamics in Transformers28 Feb 2025
50 newest of 112 All 112 (JSON)
- 2024Transformers Provably Solve Parity Efficiently with Chain of Thoughtcited by 49
- 2024A Theoretical Understanding of Self-Correction through In-context Alignmentcited by 43
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thoughtcited by 32
- 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamicscited by 27
- 2024Unveiling the Statistical Foundations of Chain-of-Thought Prompting Methodscited by 27
- 2025How Do LLMs Perform Two-Hop Reasoning in Context?cited by 20
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
- 2024A Theoretical Understanding of Chain-of-Thought: Coherent Reasoning and Error-Aware Demonstrationcited by 13
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformerscited by 10
- 2025Provable Benefit of Curriculum in Transformer Tree-Reasoning Post-Trainingcited by 4
- 2026Breaking the Reversal Curse in Autoregressive Language Models via Identity Bridgecited by 2
- 2026Transformers Provably Learn to Internalize Chain-of-Thoughtcited by 1
12 most cited of 13 All 13 (JSON)
- 2026Transformers Provably Learn to Internalize Chain-of-Thought27 May 2026
- 2026Breaking the Reversal Curse in Autoregressive Language Models via Identity Bridge2 Feb 2026
- 2025Provable Benefit of Curriculum in Transformer Tree-Reasoning Post-Training10 Nov 2025
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformers12 Jun 2025
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thought28 Feb 2025
- 2025How Do LLMs Perform Two-Hop Reasoning in Context?19 Feb 2025
- 2024Rethinking Associative Memory Mechanism in Induction Head16 Dec 2024
- 2024A Theoretical Understanding of Chain-of-Thought: Coherent Reasoning and Error-Aware Demonstration21 Oct 2024
- 2024Transformers Provably Solve Parity Efficiently with Chain of Thought11 Oct 2024
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis3 Oct 2024
- 2024Unveiling the Statistical Foundations of Chain-of-Thought Prompting Methods25 Aug 2024
- 2024A Theoretical Understanding of Self-Correction through In-context Alignment28 May 2024
12 newest of 13 All 13 (JSON)
- 2025When is Task Vector Provably Effective for Model Editing? A Generalization Analysis of Nonlinear Transformerscited by 38
- 2025Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidencecited by 13
- 2026Understanding and Improving Continuous Adversarial Training for LLMs via In-context Learning Theorycited by 1
- 2026Understanding and Improving Continuous Adversarial Training for LLMs via In-context Learning Theory14 Apr 2026
- 2025When is Task Vector Provably Effective for Model Editing? A Generalization Analysis of Nonlinear Transformers15 Apr 2025
- 2025Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidence6 Feb 2025
- 2026Transformers Learn the Optimal DDPM Denoiser for Multi-Token GMMs11 Apr 2026
- 2026Attention-Based Sampler for Diffusion Language Models18 Mar 2026
- 2026In-Context Reward Adaptation for Robust Preference Modeling28 May 2026
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
- 2024Can large language models explore in-context?cited by 75
- 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
- 2024From Words to Numbers: Your Large Language Model Is Secretly A Capable Regressor When Given In-Context Examplescited by 55
- 2024Active-Dormant Attention Heads: Mechanistically Demystifying Extreme-Token Phenomena in LLMscited by 54
- 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
- 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 43
- 2024An Information-Theoretic Analysis of In-Context Learningcited by 39
- 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 36
- 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 36
- 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
12 most cited of 88 All 88 (JSON)
- 2026Leaner Transformers Can Easily Learn to Cluster7 Oct 2026
- 2026Theory on Attention Dynamics for Out-of-Distribution In-Context Learning29 Sep 2026
- 2026Training-Free Universal Approximation by Prompting Random Transformers10 Aug 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
- 2026Learning to Adapt: In-Context Learning Beyond Stationarity13 Apr 2026
- 2026Visual prompting reimagined: The power of the Activation Prompts7 Apr 2026
- 2026Fine-Tuning Without Forgetting In-Context Learning: A Theoretical Analysis of Linear Attention Models26 Feb 2026
- 2026Incremental Learning of Sparse Attention Patterns in Transformers22 Feb 2026
- 2026Multi-layer Cross-attention is Provably Optimal for Multi-modal In-context Learning4 Feb 2026
- 2026Provably Learning Attention with Queries23 Jan 2026
- 2026Finite-Time Analysis of Gradient Descent for Shallow Transformers23 Jan 2026
12 newest of 88 All 88 (JSON)