Transformers learn to implement preconditioned gradient descent for in-context learning
Not on the map. Why?
Abstract (arXiv)
Several recent works demonstrate that transformers can implement algorithms like gradient descent. By a careful construction of weights, these works show that multiple layers of transformers are expressive enough to simulate iterations of gradient descent. Going beyond the question of expressivity, we ask: Can transformers learn to implement such algorithms by training over random problem instances? To our knowledge, we make the first theoretical progress on this question via an analysis of the loss landscape for linear transformers trained over random instances of linear regression. For a single attention layer, we prove the global minimum of the training objective implements a single iteration of preconditioned gradient descent. Notably, the preconditioning matrix not only adapts to the input distribution but also to the variance induced by data inadequacy. For a transformer with L attention layers, we prove certain critical points of the training objective implement L iterations of preconditioned gradient descent. Our results call for future theoretical studies on learning algorithms by training transformers.
Key facts. Cited by 279 papers in the map (data through 14 Oct 2026). Builds on 19 of its 34 references that are in the map. First posted on arXiv 1 Jun 2023.
Builds on
19 of 34 references.
References · 19
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2021Scaling Language Models: Methods, Analysis & Insights from Training Gophercited by 1,202
- 2022In-context Learning and Induction Headscited by 964
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
- 2022Transformers learn in-context by gradient descentcited by 732
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
- 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 713
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2014Neural Turing Machinescited by 644
- 2021Linear Transformers Are Secretly Fast Weight Programmerscited by 502
7 more
- 2021MetaICL: Learning to Learn In Contextcited by 454
- 2023Looped Transformers as Programmable Computerscited by 237
- 2016Learning to Optimizecited by 195
- 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
- 2021Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformerscited by 102
- 2017Residual Connections Encourage Iterative Inferencecited by 77
- 2023Do Transformers Parse while Predicting the Masked Word?cited by 48
Built on by
Citing papers per year: 2023: 27; 2024: 88; 2025: 93; 2026: 71.
279 papers.
Sort:
By area:
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
- 2023In-Context Unlearning: Language Models as Few Shot Unlearnerscited by 224
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
- 2023Looped Transformers are Better at Learning Learning Algorithmscited by 149
- 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 118
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 118
- 2023In-Context Convergence of Transformerscited by 115
- 2024Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Taskscited by 105
- 2023The Expressive Power of Low-Rank Adaptationcited by 102
- 2023Uncovering mesa-optimization algorithms in Transformerscited by 100
- 2023Linear attention is (maybe) all you need (to understand transformer optimization)cited by 98
- 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 96
38 more
- 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretrainingcited by 83
- 2024Can large language models explore in-context?cited by 76
- 2023How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with Representationscited by 75
- 2023Transformers as Support Vector Machinescited by 74
- 2025Test-time regression: a unifying framework for designing sequence models with associative memorycited by 74
- 2024Can Looped Transformers Learn to Implement Multi-step Gradient Descent for In-context Learning?cited by 65
- 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 57
- 2024Active-Dormant Attention Heads: Mechanistically Demystifying Extreme-Token Phenomena in LLMscited by 56
- 2024Asymptotic theory of in-context learning by linear attentioncited by 55
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 49
- 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 46
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 46
- 2024Is Mamba Capable of In-Context Learning?cited by 45
- 2024Why Larger Language Models Do In-context Learning Differently?cited by 45
- 2024A Theoretical Understanding of Self-Correction through In-context Alignmentcited by 44
- 2024Dual Operating Modes of In-Context Learningcited by 43
- 2024Transformers are Universal In-context Learnerscited by 43
- 2025Learning without training: The implicit dynamics of in-context learningcited by 43
- 2024An Information-Theoretic Analysis of In-Context Learningcited by 40
- 2024Transformers are Minimax Optimal Nonparametric In-Context Learnerscited by 37
- 2024How Do Nonlinear Transformers Learn and Generalize in In-Context Learning?cited by 35
- 2024In-Context Fine-Tuning for Time-Series Foundation Modelscited by 35
- 2024In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initializationcited by 33
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 31
- 2025Taming Knowledge Conflicts in Language Modelscited by 30
- 2026Preconditioning Benefits of Spectral Orthogonalization in Muoncited by 30
- 2024Unveiling the Statistical Foundations of Chain-of-Thought Prompting Methodscited by 29
- 2024Linear Transformers are Versatile In-Context Learnerscited by 28
- 20244Real-Video: Learning Generalizable Photo-Realistic 4D Video Diffusioncited by 27
- 2024How Well Can Transformers Emulate In-context Newton's Method?cited by 25
- 2023When can transformers reason with abstract symbols?cited by 24
- 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 24
- 2024Can In-context Learning Really Generalize to Out-of-distribution Tasks?cited by 23
- 2023Compositional Capabilities of Autoregressive Transformers: A Study on Synthetic, Interpretable Taskscited by 22
- 2024Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descentcited by 22
- 2024Setting the Record Straight on Transformer Oversmoothingcited by 21
- 2024Differential learning kinetics govern the transition from memorization to generalization during in-context learningcited by 21
50 most cited of 279 All 279 (JSON)
- 2026Test-Time Forecasting: Recurrent Depth Enables In-Context Dynamics Prediction14 Oct 2026
- 2026Learning to Extrapolate in Depth with Looped Transformers10 Oct 2026
- 2026Retrieval-Based In-Context Learning: A Domain Adaptation Framework5 Oct 2026
- 2026Generalization of Transformer-Based Neural Quantum States via In-Context Learning2 Oct 2026
- 2026Are In-Context Images Worth 10 Dimensions?29 Sep 2026
- 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
- 2026A Comparative Analysis of Attention versus State-Space Models for In-Context Learning26 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-Free Universal Approximation by Prompting Random Transformers10 Aug 2026
- 2026Training with (Swap) Regret Loss in a Single-Layer Self-Attention Model: A Case Study on the Probability Simplex25 Jul 2026
38 more
- 2026Loop the Loopies!17 Jul 2026
- 2026Data-Efficient Adaptation of LLMs via Attention Head Reweighting15 Jul 2026
- 2026A Unified Framework for In-Context Learning with Causal and Masked Language Models5 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
- 2026Induction Heads Interpolate N-Grams2 Jul 2026
- 2026Dendritic In-Context Learning in a Single-Layer Spiking Neural Network2 Jul 2026
- 2026When Does Depth Matter For In-Context Learning? Adaptive Inference in Deep Transformers15 Jun 2026
- 2026The Effect of Training Task Diversity on In-Context Learning through the Lens of Low-Dimensional Subspaces5 Jun 2026
- 2026Finite Certificates for In-Context Determinacy and a Threshold Theory of Emergence in Language Models30 May 2026
- 2026Mitigating Hallucinations in Large Language Models Via Decoder Layer Skipping30 May 2026
- 2026Algorithmic Recourse of In-Context Learning for Tabular Data29 May 2026
- 2026In-Context Reward Adaptation for Robust Preference Modeling28 May 2026
- 2026Parallax: Parameterized Local Linear Attention for Language Modeling27 May 2026
- 2026Understanding Generalization and Forgetting in In-Context Continual Learning27 May 2026
- 2026Transformers Can Learn Posterior Predictive Distributions In-Context26 May 2026
- 2026In-Context Optimization for Retrieval-Augmented Generation: A Gradient-Descent Perspective25 May 2026
- 2026When Correct Demonstrations Hurt: Rethinking the Role of Exemplars in In-Context Learning25 May 2026
- 2026Training-Free Looped Transformers22 May 2026
- 2026Unbiased Gradients, Moving Stability Boundaries: Exact Mini-Batch Geometry in Linear Self-Attention20 May 2026
- 2026Distributional Alignment as a Criterion for Designing Task Vectors in In-Context Learning20 May 2026
- 2026Attention-based PCA18 May 2026
- 2026Training Infinitely Deep and Wide Transformers17 May 2026
- 2026Large language models reorganize representational geometry during in-context learning16 May 2026
- 2026In-Context Learning Operates as Concept Subspace Learning12 May 2026
- 2026One for All: A Non-Linear Transformer can Enable Cross-Domain Generalization for In-Context Reinforcement Learning10 May 2026
- 2026Spectral Transformer Neural Processes10 May 2026
- 2026Transformers Can Implement Preconditioned Richardson Iteration for In-Context Gaussian Kernel Regression8 May 2026
- 2026Hypothesis generation and updating in large language models7 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
- 2026FAAST: Forward-Only Associative Learning via Closed-Form Fast Weights for Test-Time Supervised Adaptation6 May 2026
- 2026Ordinary Least Squares is a Special Case of Transformer15 Apr 2026
- 2026Understanding and Improving Continuous Adversarial Training for LLMs via In-context Learning Theory14 Apr 2026
- 2026Distinct mechanisms underlying in-context learning in transformers14 Apr 2026
- 2026Symmetry Reveals Layerwise Dynamics: How Transformers Perform In-Context Classification13 Apr 2026
- 2026Learning to Adapt: In-Context Learning Beyond Stationarity13 Apr 2026
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
50 newest of 279 All 279 (JSON)
- 2024A Theoretical Understanding of Self-Correction through In-context Alignmentcited by 44
- 2024Unveiling the Statistical Foundations of Chain-of-Thought Prompting Methodscited by 29
- 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
- 2025Rethinking Invariance in In-context Learningcited by 8
- 2025CoT-ICL Lab: A Synthetic Framework for Studying Chain-of-Thought Learning from In-Context Demonstrationscited by 4
- 2025Understanding the Role of Training Data in Test-Time Scalingcited by 4
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledgecited by 3
- 2025From Harm to Help: Turning Reasoning In-Context Demos into Assets for Reasoning LMscited by 1
- 2025Reasoning without Regretcited by 0
- 2026The Alchemy of Thought: Understanding In-Context Learning Through Supervised Classificationcited by 0
12 most cited of 13 All 13 (JSON)
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge21 Mar 2026
- 2026Feature Resemblance: Towards a Theoretical Understanding of Analogical Reasoning in Transformers5 Mar 2026
- 2026The Alchemy of Thought: Understanding In-Context Learning Through Supervised Classification3 Jan 2026
- 2025Understanding the Role of Training Data in Test-Time Scaling4 Oct 2025
- 2025From Harm to Help: Turning Reasoning In-Context Demos into Assets for Reasoning LMs27 Sep 2025
- 2025Rethinking Invariance in In-context Learning8 May 2025
- 2025Reasoning without Regret14 Apr 2025
- 2025CoT-ICL Lab: A Synthetic Framework for Studying Chain-of-Thought Learning from In-Context Demonstrations21 Feb 2025
- 2025How Do LLMs Perform Two-Hop Reasoning in Context?19 Feb 2025
- 2024A Theoretical Understanding of Chain-of-Thought: Coherent Reasoning and Error-Aware Demonstration21 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
12 newest of 13 All 13 (JSON)
- 2026Training-Free Looped Transformerscited by 15
- 2026Loop the Loopies!cited by 8
- 2023Bidirectional Attention as a Mixture of Continuous Word Expertscited by 1
- 2024Toward generalizable learning of all (linear) first-order methods via memory augmented Transformerscited by 0
- 2026Loop the Loopies!17 Jul 2026
- 2026Training-Free Looped Transformers22 May 2026
- 2024Toward generalizable learning of all (linear) first-order methods via memory augmented Transformers8 Oct 2024
- 2023Bidirectional Attention as a Mixture of Continuous Word Experts8 Jul 2023
- 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretrainingcited by 83
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 49
- 2025From Compression to Expression: A Layerwise Analysis of In-Context Learningcited by 6
- 2025In-Context Compositional Q-Learning for Offline Reinforcement Learningcited by 1
- 2025In-Context Compositional Q-Learning for Offline Reinforcement Learning28 Sep 2025
- 2025From Compression to Expression: A Layerwise Analysis of In-Context Learning22 May 2025
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regression26 Oct 2023
- 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretraining12 Oct 2023
- 2023In-Context Unlearning: Language Models as Few Shot Unlearnerscited by 224
- 2024Bayesian scaling laws for in-context learningcited by 19
- 2025Short-length Adversarial Training Helps LLMs Defend Long-length Jailbreak Attacks: Theoretical and Empirical Evidencecited by 14
- 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
- 2024Bayesian scaling laws for in-context learning21 Oct 2024
- 2023In-Context Unlearning: Language Models as Few Shot Unlearners11 Oct 2023
- 2024Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Taskscited by 105
- 2024Is Mamba Capable of In-Context Learning?cited by 45
- 2025How Can Mamba Learn In Context with Outliers and Generalize Provably?cited by 2
- 2025Mamba Can Learn Low-Dimensional Targets In-Context via Test-Time Feature Learningcited by 1
- 2025Mamba Can Learn Low-Dimensional Targets In-Context via Test-Time Feature Learning14 Oct 2025
- 2025How Can Mamba Learn In Context with Outliers and Generalize Provably?1 Oct 2025
- 2024Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Tasks6 Feb 2024
- 2024Is Mamba Capable of In-Context Learning?5 Feb 2024
- 2025Towards Provable Emergence of In-Context Reinforcement Learningcited by 3
- 2026Transformers Provably Implement In-Context Reinforcement Learning with Policy Improvementcited by 3
- 2026One for All: A Non-Linear Transformer can Enable Cross-Domain Generalization for In-Context Reinforcement Learningcited by 0
- 2026One for All: A Non-Linear Transformer can Enable Cross-Domain Generalization for In-Context Reinforcement Learning10 May 2026
- 2026Transformers Provably Implement In-Context Reinforcement Learning with Policy Improvement7 May 2026
- 2025Towards Provable Emergence of In-Context Reinforcement Learning22 Sep 2025
- 2023The Expressive Power of Low-Rank Adaptationcited by 102
- 20244Real-Video: Learning Generalizable Photo-Realistic 4D Video Diffusioncited by 27
- 20244Real-Video: Learning Generalizable Photo-Realistic 4D Video Diffusion5 Dec 2024
- 2023The Expressive Power of Low-Rank Adaptation26 Oct 2023
- 2024Can MLLMs Perform Text-to-Image In-Context Learning?cited by 13
- 2024Can MLLMs Perform Text-to-Image In-Context Learning?2 Feb 2024
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
- 2023Looped Transformers are Better at Learning Learning Algorithmscited by 149
- 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 118
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 118
- 2023In-Context Convergence of Transformerscited by 115
- 2023Uncovering mesa-optimization algorithms in Transformerscited by 100
- 2023Linear attention is (maybe) all you need (to understand transformer optimization)cited by 98
- 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 96
- 2024Can large language models explore in-context?cited by 76
- 2023How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with Representationscited by 75
- 2023Transformers as Support Vector Machinescited by 74
12 most cited of 233 All 233 (JSON)
- 2026Test-Time Forecasting: Recurrent Depth Enables In-Context Dynamics Prediction14 Oct 2026
- 2026Learning to Extrapolate in Depth with Looped Transformers10 Oct 2026
- 2026Retrieval-Based In-Context Learning: A Domain Adaptation Framework5 Oct 2026
- 2026Generalization of Transformer-Based Neural Quantum States via In-Context Learning2 Oct 2026
- 2026Are In-Context Images Worth 10 Dimensions?29 Sep 2026
- 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
- 2026A Comparative Analysis of Attention versus State-Space Models for In-Context Learning26 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-Free Universal Approximation by Prompting Random Transformers10 Aug 2026
- 2026Training with (Swap) Regret Loss in a Single-Layer Self-Attention Model: A Case Study on the Probability Simplex25 Jul 2026
12 newest of 233 All 233 (JSON)