One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attention
Not on the map. Why?
Abstract (arXiv)
Recent works have empirically analyzed in-context learning and shown that transformers trained on synthetic linear regression tasks can learn to implement ridge regression, which is the Bayes-optimal predictor, given sufficient capacity [Aky"urek et al., 2023], while one-layer transformers with linear self-attention and no MLP layer will learn to implement one step of gradient descent (GD) on a least-squares linear regression objective [von Oswald et al., 2022]. However, the theory behind these observations remains poorly understood. We theoretically study transformers with a single layer of linear self-attention, trained on synthetic noisy linear regression data. First, we mathematically show that when the covariates are drawn from a standard Gaussian distribution, the one-layer transformer which minimizes the pre-training loss will implement a single step of GD on the least-squares linear regression objective. Then, we find that changing the distribution of the covariates and weight vector to a non-isotropic Gaussian distribution has a strong impact on the learned algorithm: the global minimizer of the pre-training loss now implements a single step of textitpre-conditioned GD. However, if only the distribution of the responses is changed, then this does not have a large effect on the learned algorithm: even when the response comes from a more general family of textitnonlinear functions, the global minimizer of the pre-training loss still implements a single step of GD on a least-squares linear regression objective.
Key facts. Cited by 168 papers in the map (data through 7 Oct 2026). Builds on 11 of its 16 references that are in the map. First posted on arXiv 7 Jul 2023.
Builds on
11 of 16 references.
References · 11
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 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
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2023Larger language models do in-context learning differentlycited by 386
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
- 2022Transformers Learn Shortcuts to Automatacited by 260
- 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
Built on by
Citing papers per year: 2023: 13; 2024: 59; 2025: 59; 2026: 37.
168 papers.
Sort:
By area:
- 2023In-Context Unlearning: Language Models as Few Shot Unlearnerscited by 214
- 2023Looped Transformers are Better at Learning Learning Algorithmscited by 135
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
- 2023In-Context Convergence of Transformerscited by 112
- 2024Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Taskscited by 104
- 2023Linear attention is (maybe) all you need (to understand transformer optimization)cited by 97
- 2023Uncovering mesa-optimization algorithms in Transformerscited by 94
- 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 93
- 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
- 2024Transformers Provably Solve Parity Efficiently with Chain of Thoughtcited by 49
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 47
38 more
- 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
- 2024Dual Operating Modes of In-Context Learningcited by 42
- 2024Transformers are Universal In-context Learnerscited by 42
- 2024An Information-Theoretic Analysis of In-Context Learningcited by 39
- 2024Do Large Language Models Have Compositional Ability? An Investigation into Limitations and Scalabilitycited by 39
- 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 36
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thoughtcited by 32
- 2024In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initializationcited by 30
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 29
- 2024Linear Transformers are Versatile In-Context Learnerscited by 28
- 2024Out-of-distribution generalization via composition: a lens through induction heads in Transformerscited 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
- 2025Taming Knowledge Conflicts in Language Modelscited by 27
- 2024Parallel Structures in Pre-training Data Yield In-Context Learningcited by 26
- 2024Understanding the Expressive Power and Mechanisms of Transformer for Sequence Modelingcited by 25
- 2024How Well Can Transformers Emulate In-context Newton's Method?cited by 23
- 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
- 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited 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
- 2024Position: Understanding LLMs Requires More Than Statistical Generalizationcited by 20
- 2024Setting the Record Straight on Transformer Oversmoothingcited by 19
- 2024Looped ReLU MLPs May Be All You Need as Practical Programmable Computerscited by 19
- 2024Superiority of Multi-Head Attention in In-Context Linear Regressioncited by 17
- 2025In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learningcited by 17
- 2024How do Transformers perform In-Context Autoregressive Learning?cited by 16
- 2025Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous Thoughtcited by 16
- 2023Towards Understanding How Transformers Learn In-context Through a Representation Learning Lenscited by 15
- 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixturescited by 15
- 2025Test-Time Training Provably Improves Transformers as In-context Learnerscited by 15
- 2025Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Timecited by 15
- 2024Trained Transformer Classifiers Generalize and Exhibit Benign Overfitting In-Contextcited by 14
- 2025Why and How LLMs Hallucinate: Connecting the Dots with Subsequence Associationscited 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
50 most cited of 168 All 168 (JSON)
- 2026When Can Prefixes Compile LoRA? Exact Resource-Capped Tests for Frozen Attention29 Sep 2026
- 2026Theory on Attention Dynamics for Out-of-Distribution In-Context Learning29 Sep 2026
- 2026Retrieval-Guided Fine-Tuning as Noisy Estimation: Risk bounds and Architectural Analysis13 Sep 2026
- 2026Transformers as In-Context Samplers: From Closed-Form Diffusion to Estimation-Free Sampling8 Sep 2026
- 2026Training with (Swap) Regret Loss in a Single-Layer Self-Attention Model: A Case Study on the Probability Simplex25 Jul 2026
- 2026In-context learning of closed form solution to simple linear regression task using transformer with linear self-attention17 Jul 2026
- 2026Data-Efficient Adaptation of LLMs via Attention Head Reweighting15 Jul 2026
- 2026Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatch4 Jul 2026
- 2026Best-of-Better-N: Generating Pre-Aligned Responses with In-Context Learning3 Jul 2026
- 2026The Effect of Training Task Diversity on In-Context Learning through the Lens of Low-Dimensional Subspaces5 Jun 2026
- 2026Parallax: Parameterized Local Linear Attention for Language Modeling27 May 2026
- 2026Transformers Provably Learn to Internalize Chain-of-Thought27 May 2026
38 more
- 2026Transformers Can Learn Posterior Predictive Distributions In-Context26 May 2026
- 2026The Stability of Singular Distribution: A Spectral Perspective on the Two-Phase Dynamics of Language Model Pre-training26 May 2026
- 2026In-Context Optimization for Retrieval-Augmented Generation: A Gradient-Descent Perspective25 May 2026
- 2026Training-Free Looped Transformers22 May 2026
- 2026Training Infinitely Deep and Wide Transformers17 May 2026
- 2026One for All: A Non-Linear Transformer can Enable Cross-Domain Generalization for In-Context Reinforcement Learning10 May 2026
- 2026Transformers Can Implement Preconditioned Richardson Iteration for In-Context Gaussian Kernel Regression8 May 2026
- 2026Echo: KV-Cache-Free Associative Recall with Spectral Koopman Operators7 May 2026
- 2026Transformers Provably Implement In-Context Reinforcement Learning with Policy Improvement7 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 Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
- 2026Demonstrations, CoT, and Prompting: A Theoretical Analysis of ICL20 Mar 2026
- 2026Feature Resemblance: Towards a Theoretical Understanding of Analogical Reasoning in Transformers5 Mar 2026
- 2026Fine-Tuning Without Forgetting In-Context Learning: A Theoretical Analysis of Linear Attention Models26 Feb 2026
- 2026Nonparametric Teaching of Attention Learners24 Feb 2026
- 2026Covariance-Aware Transformers for Quadratic Programming and Decision Making16 Feb 2026
- 2026When Does Context Help? Error Dynamics of Contextual Information in Large Language Models9 Feb 2026
- 2026Emergent Structured Representations Support Flexible In-Context Inference in Large Language Models8 Feb 2026
- 2026Breaking the Reversal Curse in Autoregressive Language Models via Identity Bridge2 Feb 2026
- 2026Rethinking Zero-Shot Time Series Classification: From Task-specific Classifiers to In-Context Inference31 Jan 2026
- 2026Data Distribution as a Lever for Guiding Optimizers Toward Superior Generalization in LLMs31 Jan 2026
- 2026A Theory of Diversity for Random Matrices with Applications to In-Context Learning of Schr"odinger Equations18 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
- 2025The Initialization Determines Whether In-Context Learning Is Gradient Descent3 Dec 2025
- 2025The brain-AI convergence: Predictive and generative world models for general-purpose computation2 Dec 2025
- 2025Towards Understanding Transformers in Learning Random Walks28 Nov 2025
- 2025Genomic Next-Token Predictors are In-Context Learners16 Nov 2025
- 2025Provable Benefit of Curriculum in Transformer Tree-Reasoning Post-Training10 Nov 2025
- 2025Optimal Attention Temperature Improves the Robustness of In-Context Learning under Distribution Shift in High Dimensions3 Nov 2025
- 2025How Data Mixing Shapes In-Context Learning: Asymptotic Equivalence for Transformers with MLPs29 Oct 2025
- 2025Can Language Models Compose Skills In-Context?27 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
- 2025Improving Model Representation and Reducing KV Cache via Skip Connections with First Value Heads19 Oct 2025
50 newest of 168 All 168 (JSON)
- 2024Transformers Provably Solve Parity Efficiently with Chain of Thoughtcited by 49
- 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
- 2025Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous Thoughtcited by 16
- 2025Revisiting Chain-of-Thought Prompting: Zero-shot Can Be Stronger than Few-shotcited by 12
- 2024Explicitly Encoding Structural Symmetry is Key to Length Generalization in Arithmetic Taskscited by 10
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformerscited by 10
- 2025Understanding the Role of Training Data in Test-Time Scalingcited by 4
- 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
- 2026Echo: KV-Cache-Free Associative Recall with Spectral Koopman Operatorscited by 1
12 most cited of 15 All 15 (JSON)
- 2026Transformers Provably Learn to Internalize Chain-of-Thought27 May 2026
- 2026Echo: KV-Cache-Free Associative Recall with Spectral Koopman Operators7 May 2026
- 2026Feature Resemblance: Towards a Theoretical Understanding of Analogical Reasoning in Transformers5 Mar 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
- 2025Understanding the Role of Training Data in Test-Time Scaling4 Oct 2025
- 2025Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous Thought27 Sep 2025
- 2025Revisiting Chain-of-Thought Prompting: Zero-shot Can Be Stronger than Few-shot17 Jun 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
- 2024Rethinking Associative Memory Mechanism in Induction Head16 Dec 2024
- 2024Transformers Provably Solve Parity Efficiently with Chain of Thought11 Oct 2024
12 newest of 15 All 15 (JSON)
- 2023In-Context Unlearning: Language Models as Few Shot Unlearnerscited by 214
- 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
- 2025Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidence6 Feb 2025
- 2023In-Context Unlearning: Language Models as Few Shot Unlearners11 Oct 2023
- 2023Looped Transformers are Better at Learning Learning Algorithmscited by 135
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
- 2023In-Context Convergence of Transformerscited by 112
- 2023Linear attention is (maybe) all you need (to understand transformer optimization)cited by 97
- 2023Uncovering mesa-optimization algorithms in Transformerscited by 94
- 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 93
- 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
- 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
- 2024Dual Operating Modes of In-Context Learningcited by 42
12 most cited of 141 All 141 (JSON)
- 2026When Can Prefixes Compile LoRA? Exact Resource-Capped Tests for Frozen Attention29 Sep 2026
- 2026Theory on Attention Dynamics for Out-of-Distribution In-Context Learning29 Sep 2026
- 2026Retrieval-Guided Fine-Tuning as Noisy Estimation: Risk bounds and Architectural Analysis13 Sep 2026
- 2026Transformers as In-Context Samplers: From Closed-Form Diffusion to Estimation-Free Sampling8 Sep 2026
- 2026Training with (Swap) Regret Loss in a Single-Layer Self-Attention Model: A Case Study on the Probability Simplex25 Jul 2026
- 2026In-context learning of closed form solution to simple linear regression task using transformer with linear self-attention17 Jul 2026
- 2026Data-Efficient Adaptation of LLMs via Attention Head Reweighting15 Jul 2026
- 2026Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatch4 Jul 2026
- 2026The Effect of Training Task Diversity on In-Context Learning through the Lens of Low-Dimensional Subspaces5 Jun 2026
- 2026Parallax: Parameterized Local Linear Attention for Language Modeling27 May 2026
- 2026Transformers Can Learn Posterior Predictive Distributions In-Context26 May 2026
- 2026The Stability of Singular Distribution: A Spectral Perspective on the Two-Phase Dynamics of Language Model Pre-training26 May 2026
12 newest of 141 All 141 (JSON)