Training Dynamics of Multi-Head Softmax Attention for In-Context Learning: Emergence, Convergence, and Optimality
Not on the map. Why?
Abstract (arXiv)
We study the dynamics of gradient flow for training a multi-head softmax attention model for in-context learning of multi-task linear regression. We establish the global convergence of gradient flow under suitable choices of initialization. In addition, we prove that an interesting "task allocation" phenomenon emerges during the gradient flow dynamics, where each attention head focuses on solving a single task of the multi-task model. Specifically, we prove that the gradient flow dynamics can be split into three phases -- a warm-up phase where the loss decreases rather slowly and the attention heads gradually build up their inclination towards individual tasks, an emergence phase where each head selects a single task and the loss rapidly decreases, and a convergence phase where the attention parameters converge to a limit. Furthermore, we prove the optimality of gradient flow in the sense that the limiting model learned by gradient flow is on par with the best possible multi-head softmax attention model up to a constant factor. Our analysis also delineates a strict separation in terms of the prediction accuracy of ICL between single-head and multi-head attention models. The key technique for our convergence analysis is to map the gradient flow dynamics in the parameter space to a set of ordinary differential equations in the spectral domain, where the relative magnitudes of the semi-singular values of the attention weights determines task allocation. To our best knowledge, our work provides the first convergence result for the multi-head softmax attention model.
Key facts. Cited by 74 papers in the map (data through 14 Oct 2026). First posted on arXiv 29 Feb 2024.
Builds on
0 of 0 references.
No references here yet.
Built on by
Citing papers per year: 2024: 32; 2025: 27; 2026: 15.
74 papers.
Sort:
By area:
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 46
- 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 38
- 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 37
- 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 31
- 2024From Sparse Dependence to Sparse Attention: Unveiling How Chain-of-Thought Enhances Transformer Sample Efficiencycited by 29
- 2024How Well Can Transformers Emulate In-context Newton's Method?cited by 25
- 2025The emergence of sparse attention: impact of data distribution and benefits of repetitioncited by 25
- 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 22
- 2024Implicit Regularization of Gradient Flow on One-Layer Softmax Attentioncited by 19
- 2024One-Layer Transformer Provably Learns One-Nearest Neighbor In Contextcited by 16
38 more
- 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Timecited by 16
- 2024Exploring the Frontiers of Softmax: Provable Optimization, Applications in Diffusion Model, and Beyondcited by 15
- 2024Understanding the Language Model to Solve the Symbolic Multi-Step Reasoning Problem from the Perspective of Buffer Mechanismcited by 15
- 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixturescited by 15
- 2024How Transformers Utilize Multi-Head Attention in In-Context Learning? A Case Study on Sparse Linear Regressioncited by 14
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
- 2024Learning sum of diverse features: computational hardness and efficient gradient-based training for ridge combinationscited 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
- 2024Adversarial Training Can Provably Improve Robustness: Theoretical Analysis of Feature Learning Process Under Structured Datacited by 12
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 12
- 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Biascited by 11
- 2025From Condensation to Rank Collapse: A Two-Stage Analysis of Transformer Training Dynamicscited by 10
- 2024Amuro and Char: Analyzing the Relationship between Pre-Training and Fine-Tuning of Large Language Modelscited by 9
- 2024Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysiscited by 9
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selectioncited by 9
- 2024How Transformers Get Rich: Approximation and Dynamics Analysiscited by 8
- 2025Federated In-Context Learning: Iterative Refinement for Improved Answer Qualitycited by 8
- 2025Train Once, Reuse Everywhere: Generalizable Implicit In-Context Learning by Routing Attentioncited by 8
- 2025On the Role of Transformer Feed-Forward Layers in Nonlinear In-Context Learningcited by 7
- 2025What Happens During the Loss Plateau? Understanding Abrupt Learning in Transformerscited by 7
- 2024In-Context Learning of Linear Systems: Generalization Theory and Applications to Operator Learningcited by 6
- 2024Context-Scaling versus Task-Scaling in In-Context Learningcited by 6
- 2024On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recoverycited by 6
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theorycited by 6
- 2025On the Convergence of Gradient Descent on Learning Transformers with Residual Connectionscited by 6
- 2025Decoupling Positional and Symbolic Attention Behavior in Transformerscited by 6
- 2024DETAIL: Task DEmonsTration Attribution for Interpretable In-context Learningcited by 5
- 2024On Mesa-Optimization in Autoregressively Trained Transformers: Emergence and Capabilitycited by 5
- 2024On the Benefits of Rank in Attention Layerscited by 5
- 2024Task Diversity Shortens the ICL Plateaucited by 5
- 2025Transformers versus the EM Algorithm in Multi-class Clusteringcited by 5
- 2025In-Context Occam's Razor: How Transformers Prefer Simpler Hypotheses on the Flycited by 5
- 2026Training Dynamics of Softmax Self-Attention: Fast Global Convergence via Preconditioningcited by 5
- 2025On the Robustness of Transformers against Context Hijacking for Linear Classificationcited by 4
- 2025Provable In-Context Learning of Nonlinear Regression with Transformerscited by 4
- 2025Softmax ≥ Linear: Transformers may learn to classify in-context by kernel gradient descentcited by 4
- 2024From Unstructured Data to In-Context Learning: Exploring What Tasks Can Be Learned and Whencited by 3
50 most cited of 74 All 74 (JSON)
- 2026Adaptive Mean Estimation by In-Context Learning: A Gradient-Flow Analysis6 Oct 2026
- 2026Generalization of Transformer-Based Neural Quantum States via In-Context Learning2 Oct 2026
- 2026Theory on Attention Dynamics for Out-of-Distribution In-Context Learning29 Sep 2026
- 2026A Comparative Analysis of Attention versus State-Space Models for In-Context Learning26 Sep 2026
- 2026Training with (Swap) Regret Loss in a Single-Layer Self-Attention Model: A Case Study on the Probability Simplex25 Jul 2026
- 2026Transformers Can Implement Preconditioned Richardson Iteration for In-Context Gaussian Kernel Regression8 May 2026
- 2026Transformers Provably Implement In-Context Reinforcement Learning with Policy Improvement7 May 2026
- 2026Learning to Adapt: In-Context Learning Beyond Stationarity13 Apr 2026
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge21 Mar 2026
- 2026Attention-Based Sampler for Diffusion Language Models18 Mar 2026
- 2026Specialization of softmax attention heads: insights from the high-dimensional single-location model4 Mar 2026
- 2026Training Dynamics of Softmax Self-Attention: Fast Global Convergence via Preconditioning2 Mar 2026
38 more
- 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
- 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformers15 Jan 2026
- 2025Understanding the Staged Dynamics of Transformers in Learning Latent Structure24 Nov 2025
- 2025Transformers with RL or SFT Provably Learn Sparse Boolean Functions, But Differently22 Nov 2025
- 2025A Framework for Quantifying How Pre-Training and Context Benefit In-Context Learning26 Oct 2025
- 2025Softmax ≥ Linear: Transformers may learn to classify in-context by kernel gradient descent12 Oct 2025
- 2025From Condensation to Rank Collapse: A Two-Stage Analysis of Transformer Training Dynamics8 Oct 2025
- 2025Decoupling Positional and Symbolic Attention Behavior in Transformers3 Oct 2025
- 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time1 Oct 2025
- 2025How Can Mamba Learn In Context with Outliers and Generalize Provably?1 Oct 2025
- 2025Limit Analysis for Symbolic Multi-step Reasoning Tasks with Information Propagation Rules Based on Transformers27 Sep 2025
- 2025Train Once, Reuse Everywhere: Generalizable Implicit In-Context Learning by Routing Attention26 Sep 2025
- 2025Towards Theoretical Understanding of Transformer Test-Time Computing: Investigation on In-Context Linear Regression11 Aug 2025
- 2025Provable In-Context Learning of Nonlinear Regression with Transformers28 Jul 2025
- 2025In-Context Occam's Razor: How Transformers Prefer Simpler Hypotheses on the Fly24 Jun 2025
- 2025What Happens During the Loss Plateau? Understanding Abrupt Learning in Transformers16 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
- 2025The emergence of sparse attention: impact of data distribution and benefits of repetition23 May 2025
- 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Bias2 May 2025
- 2025Exact Learning Dynamics of In-Context Learning in Linear Transformers and Its Application to Non-Linear Transformers17 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
- 2025On the Robustness of Transformers against Context Hijacking for Linear Classification21 Feb 2025
- 2025Transformers versus the EM Algorithm in Multi-class Clustering9 Feb 2025
- 2025On the Role of Transformer Feed-Forward Layers in Nonlinear In-Context Learning30 Jan 2025
- 2025Training Dynamics of In-Context Learning in Linear Attention27 Jan 2025
- 2024One-Layer Transformer Provably Learns One-Nearest Neighbor In Context16 Nov 2024
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-context4 Nov 2024
- 2024A Theoretical Understanding of Chain-of-Thought: Coherent Reasoning and Error-Aware Demonstration21 Oct 2024
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selection18 Oct 2024
- 2024In-context Learning for Mixture of Linear Regressions: Existence, Generalization and Training Dynamics18 Oct 2024
- 2024On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recovery17 Oct 2024
- 2024Context-Scaling versus Task-Scaling in In-Context Learning16 Oct 2024
- 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixtures15 Oct 2024
50 newest of 74 All 74 (JSON)
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thoughtcited by 32
- 2024From Sparse Dependence to Sparse Attention: Unveiling How Chain-of-Thought Enhances Transformer Sample Efficiencycited by 29
- 2024Understanding the Language Model to Solve the Symbolic Multi-Step Reasoning Problem from the Perspective of Buffer Mechanismcited by 15
- 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
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledgecited by 3
- 2025Transformers with RL or SFT Provably Learn Sparse Boolean Functions, But Differentlycited by 2
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge21 Mar 2026
- 2025Transformers with RL or SFT Provably Learn Sparse Boolean Functions, But Differently22 Nov 2025
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thought28 Feb 2025
- 2024A Theoretical Understanding of Chain-of-Thought: Coherent Reasoning and Error-Aware Demonstration21 Oct 2024
- 2024From Sparse Dependence to Sparse Attention: Unveiling How Chain-of-Thought Enhances Transformer Sample Efficiency7 Oct 2024
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis3 Oct 2024
- 2024Understanding the Language Model to Solve the Symbolic Multi-Step Reasoning Problem from the Perspective of Buffer Mechanism24 May 2024
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 46
- 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 38
- 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 37
- 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 31
- 2024How Well Can Transformers Emulate In-context Newton's Method?cited by 25
- 2025The emergence of sparse attention: impact of data distribution and benefits of repetitioncited by 25
- 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 22
- 2024Implicit Regularization of Gradient Flow on One-Layer Softmax Attentioncited by 19
- 2024One-Layer Transformer Provably Learns One-Nearest Neighbor In Contextcited by 16
- 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Timecited by 16
- 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixturescited by 15
12 most cited of 63 All 63 (JSON)
- 2026Adaptive Mean Estimation by In-Context Learning: A Gradient-Flow Analysis6 Oct 2026
- 2026Generalization of Transformer-Based Neural Quantum States via In-Context Learning2 Oct 2026
- 2026Theory on Attention Dynamics for Out-of-Distribution In-Context Learning29 Sep 2026
- 2026A Comparative Analysis of Attention versus State-Space Models for In-Context Learning26 Sep 2026
- 2026Training with (Swap) Regret Loss in a Single-Layer Self-Attention Model: A Case Study on the Probability Simplex25 Jul 2026
- 2026Transformers Can Implement Preconditioned Richardson Iteration for In-Context Gaussian Kernel Regression8 May 2026
- 2026Learning to Adapt: In-Context Learning Beyond Stationarity13 Apr 2026
- 2026Specialization of softmax attention heads: insights from the high-dimensional single-location model4 Mar 2026
- 2026Training Dynamics of Softmax Self-Attention: Fast Global Convergence via Preconditioning2 Mar 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
- 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformers15 Jan 2026
12 newest of 63 All 63 (JSON)