Uncovering mesa-optimization algorithms in Transformers
Not on the map. Why?
Abstract (arXiv)
Some autoregressive models exhibit in-context learning capabilities: being able to learn as an input sequence is processed, without undergoing any parameter changes, and without being explicitly trained to do so. The origins of this phenomenon are still poorly understood. Here we analyze a series of Transformer models trained to perform synthetic sequence prediction tasks, and discover that standard next-token prediction error minimization gives rise to a subsidiary learning algorithm that adjusts the model as new inputs are revealed. We show that this process corresponds to gradient-based optimization of a principled objective function, which leads to strong generalization performance on unseen sequences. Our findings explain in-context learning as a product of autoregressive loss minimization and inform the design of new optimization-based Transformer layers.
Key facts. Cited by 100 papers in the map (data through 14 Oct 2026). Builds on 67 of its 123 references that are in the map. First posted on arXiv 11 Sep 2023.
Builds on
67 of 123 references.
References · 67
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2014Adam: A Method for Stochastic Optimizationcited by 37,240
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2015Distilling the Knowledge in a Neural Networkcited by 10,324
- 2020Scaling Laws for Neural Language Modelscited by 6,586
- 2016Layer Normalizationcited by 5,669
- 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,897
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,915
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
38 more
- 2016Gaussian Error Linear Units (GELUs)cited by 3,502
- 2017Prototypical Networks for Few-shot Learningcited by 3,015
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
- 2020Rethinking Attention with Performerscited by 1,601
- 2018World Modelscited by 1,513
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
- 2016Understanding intermediate layers using linear classifier probescited by 1,353
- 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
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2017OptNet: Differentiable Optimization as a Layer in Neural Networkscited by 599
- 2016RL2: Fast Reinforcement Learning via Slow Reinforcement Learningcited by 503
- 2021Linear Transformers Are Secretly Fast Weight Programmerscited by 502
- 2022Hungry Hungry Hippos: Towards Language Modeling with State Space Modelscited by 499
- 2020Hopfield Networks is All You Needcited by 475
- 2023Hyena Hierarchy: Towards Larger Convolutional Language Modelscited by 393
- 2016Learning to reinforcement learncited by 377
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
- 2023Emergent Linear Representations in World Models of Self-Supervised Sequence Modelscited by 319
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 309
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
- 2022Transformers Learn Shortcuts to Automatacited by 268
- 2022The Forward-Forward Algorithm: Some Preliminary Investigationscited by 266
- 2019Risks from Learned Optimization in Advanced Machine Learning Systemscited by 258
- 2017High-dimensional dynamics of generalization error in neural networkscited by 241
- 2023Looped Transformers as Programmable Computerscited by 237
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 222
- 2016Using Fast Weights to Attend to the Recent Pastcited by 170
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
- 2014Difference Target Propagationcited by 148
- 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 146
- 2019Training Neural Networks with Local Error Signalscited by 136
- 2018Greedy Layerwise Learning Can Scale to ImageNetcited by 115
50 most cited of 67 All 67 (JSON)
Built on by
Citing papers per year: 2023: 9; 2024: 38; 2025: 25; 2026: 28.
100 papers.
Sort:
By area:
- 2024Gated Delta Networks: Improving Mamba2 with Delta Rulecited by 532
- 2024Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Trainingcited by 529
- 2024Mechanistic Interpretability for AI Safety -- A Reviewcited by 422
- 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Lengthcited by 396
- 2024Can Mamba Learn How to Learn? A Comparative Study on In-Context Learning Taskscited by 105
- 2024In-Context Language Learning: Architectures and Algorithmscited by 89
- 2025Test-time regression: a unifying framework for designing sequence models with associative memorycited by 74
- 2025Nested Learning: The Illusion of Deep Learning Architecturescited by 72
- 2025ATLAS: Learning to Optimally Memorize the Context at Test Timecited by 66
- 2024Can Looped Transformers Learn to Implement Multi-step Gradient Descent for In-context Learning?cited by 65
- 2025It's All Connected: A Journey Through Test-Time Memorization, Attentional Bias, Retention, and Online Optimizationcited by 64
- 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
38 more
- 2024Longhorn: State Space Models are Amortized Online Learnerscited by 59
- 2024From Words to Numbers: Your Large Language Model Is Secretly A Capable Regressor When Given In-Context Examplescited by 57
- 2024ICLR: In-Context Learning of Representationscited by 50
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 49
- 2025CausalPFN: Amortized Causal Effect Estimation via In-Context Learningcited by 49
- 2025MesaNet: Sequence Modeling by Locally Optimal Test-Time Trainingcited by 47
- 2024Transformers are Universal In-context Learnerscited by 43
- 2025Log-Linear Attentioncited by 40
- 2023The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysiscited by 34
- 2024Encoder vs Decoder: Comparative Analysis of Encoder and Decoder Language Models on Multilingual NLU Taskscited by 34
- 2024Linear Transformers are Versatile In-Context Learnerscited by 28
- 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 25
- 2024Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyondcited by 24
- 2024In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitznesscited by 22
- 2023In-context Learning and Gradient Descent Revisitedcited by 20
- 2024Superiority of Multi-Head Attention in In-Context Linear Regressioncited by 17
- 2023Structured World Representations in Maze-Solving Transformerscited by 16
- 2023Towards Understanding How Transformers Learn In-context Through a Representation Learning Lenscited by 15
- 2026Memory Caching: RNNs with Growing Memorycited by 15
- 2024A Survey to Recent Progress Towards Understanding In-Context Learningcited by 14
- 2024Attention as a Hypernetworkcited by 13
- 2025Neural ODE Transformers: Analyzing Internal Dynamics and Adaptive Fine-tuningcited by 13
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 12
- 2023In-Context Learning for MIMO Equalization Using Transformer-Based Sequence Modelscited by 11
- 2024On the Role of Depth and Looping for In-Context Learning with Task Diversitycited by 11
- 2025Beyond Induction Heads: In-Context Meta Learning Induces Multi-Phase Circuit Emergencecited by 10
- 2024Towards Understanding the Universality of Transformers for Next-Token Predictioncited by 9
- 2024In-context learning and Occam's razorcited by 8
- 2025In-context Learning of Evolving Data Streams with Tabular Foundational Modelscited by 8
- 2025Rethinking Invariance in In-context Learningcited by 8
- 2025Fast weight programming and linear transformers: from machine learning to neurobiologycited by 8
- 2025Selective Induction Heads: How Transformers Select Causal Structures In Contextcited by 8
- 2023Metalearning Continual Learning Algorithmscited by 7
- 2024From Frege to chatGPT: Compositionality in language, cognition, and deep neural networkscited by 7
- 2024When can transformers compositionally generalize in-context?cited by 7
- 2024On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recoverycited by 6
- 2025The Role of Diversity in In-Context Learning for Large Language Modelscited by 6
50 most cited of 100 All 100 (JSON)
- 2026Depth Memory13 Oct 2026
- 2026Error Correction in Trained TTT Layers12 Oct 2026
- 2026DeltaNet-PC: Test-Time Memory Without Backpropagation Through Time10 Oct 2026
- 2026Retrieval-Centric Deep Learning in Growing Nonparametric Neural Networks2 Oct 2026
- 2026Switching Linear Attention30 Sep 2026
- 2026Proteus: Incremental Memory Activation for Long-Context Sequence Modeling17 Aug 2026
- 2026Language models suffer from a curse of ambiguity15 Aug 2026
- 2026Grounding latent algorithm routing in transformer reasoning27 Jul 2026
- 2026What a Deletion Certificate Covers, and Where It Expires: Auditable Removal from a Support-Vector Memory13 Jul 2026
- 2026The Orthogonalized Read Is a Removable Training Scaffold for Recurrent Memory2 Jul 2026
- 2026Induction Heads Interpolate N-Grams2 Jul 2026
- 2026Understanding Large Language Models1 Jul 2026
38 more
- 2026Phase Transitions in Attention: A Bayesian Theory of Copy Head Emergence10 Jun 2026
- 2026Blurry Window Attention31 May 2026
- 2026Large language models reorganize representational geometry during in-context learning16 May 2026
- 2026OSDN: Improving Delta Rule with Provable Online Preconditioning in Linear Attention13 May 2026
- 2026Hypothesis generation and updating in large language models7 May 2026
- 2026MDN: Parallelizing Stepwise Momentum for Delta Linear Attention7 May 2026
- 2026Distinct mechanisms underlying in-context learning in transformers14 Apr 2026
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
- 2026Beyond Test-Time Memory: State-Space Optimal Control for LLM Reasoning10 Mar 2026
- 2026Memory Caching: RNNs with Growing Memory27 Feb 2026
- 2026Training Agents to Self-Report Misbehavior25 Feb 2026
- 2026Beyond the Prompt in Large Language Models: Comprehension, In-Context Learning, and Chain-of-Thought16 Feb 2026
- 2026Learning to Remember, Learn, and Forget in Attention-Based Models9 Feb 2026
- 2026A Constrained Optimization Perspective of Unrolled Transformers24 Jan 2026
- 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformers15 Jan 2026
- 2026The Alchemy of Thought: Understanding In-Context Learning Through Supervised Classification3 Jan 2026
- 2025Nested Learning: The Illusion of Deep Learning Architectures31 Dec 2025
- 2025Misaligned by Design: Incentive Failures in Machine Learning10 Nov 2025
- 2025Improving Model Representation and Reducing KV Cache via Skip Connections with First Value Heads19 Oct 2025
- 2025Local Linear Attention: An Optimal Interpolation of Linear and Softmax Attention For Test-Time Regression1 Oct 2025
- 2025Transformers through the lens of support-preserving maps between measures30 Sep 2025
- 2025Enhancing Linear Attention with Residual Learning24 Sep 2025
- 2025Selective Induction Heads: How Transformers Select Causal Structures In Context9 Sep 2025
- 2025Fast weight programming and linear transformers: from machine learning to neurobiology11 Aug 2025
- 2025Brewing Knowledge in Context: Distillation Perspectives on In-Context Learning13 Jun 2025
- 2025Path Channels and Plan Extension Kernels: a Mechanistic Description of Planning in a Sokoban RNN11 Jun 2025
- 2025CausalPFN: Amortized Causal Effect Estimation via In-Context Learning9 Jun 2025
- 2025MesaNet: Sequence Modeling by Locally Optimal Test-Time Training5 Jun 2025
- 2025Transformers Meet In-Context Learning: A Universal Approximation Theory5 Jun 2025
- 2025Log-Linear Attention5 Jun 2025
- 2025ATLAS: Learning to Optimally Memorize the Context at Test Time29 May 2025
- 2025The Role of Diversity in In-Context Learning for Large Language Models26 May 2025
- 2025Beyond Induction Heads: In-Context Meta Learning Induces Multi-Phase Circuit Emergence22 May 2025
- 2025Adversarially Pretrained Transformers May Be Universally Robust In-Context Learners20 May 2025
- 2025Rethinking Invariance in In-context Learning8 May 2025
- 2025It's All Connected: A Journey Through Test-Time Memorization, Attentional Bias, Retention, and Online Optimization17 Apr 2025
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learning6 Apr 2025
- 2025Neural ODE Transformers: Analyzing Internal Dynamics and Adaptive Fine-tuning3 Mar 2025
50 newest of 100 All 100 (JSON)
- 2025Rethinking Invariance in In-context Learningcited by 8
- 2026Beyond Test-Time Memory: State-Space Optimal Control for LLM Reasoningcited by 1
- 2026Beyond the Prompt in Large Language Models: Comprehension, In-Context Learning, and Chain-of-Thoughtcited by 1
- 2026The Alchemy of Thought: Understanding In-Context Learning Through Supervised Classificationcited by 0
- 2026Grounding latent algorithm routing in transformer reasoningcited by 0
- 2026Grounding latent algorithm routing in transformer reasoning27 Jul 2026
- 2026Beyond Test-Time Memory: State-Space Optimal Control for LLM Reasoning10 Mar 2026
- 2026Beyond the Prompt in Large Language Models: Comprehension, In-Context Learning, and Chain-of-Thought16 Feb 2026
- 2026The Alchemy of Thought: Understanding In-Context Learning Through Supervised Classification3 Jan 2026
- 2025Rethinking Invariance in In-context Learning8 May 2025
- 2024Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Trainingcited by 529
- 2026Training Agents to Self-Report Misbehaviorcited by 6
- 2026Training Agents to Self-Report Misbehavior25 Feb 2026
- 2024Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training10 Jan 2024
- 2026Blurry Window Attention31 May 2026
- 2025Improving Model Representation and Reducing KV Cache via Skip Connections with First Value Heads19 Oct 2025
- 2024Mechanistic Interpretability for AI Safety -- A Reviewcited by 422
- 2024Mechanistic Interpretability for AI Safety -- A Review22 Apr 2024
- 2024Gated Delta Networks: Improving Mamba2 with Delta Rulecited by 532
- 2024Parallelizing Linear Transformers with the Delta Rule over Sequence Lengthcited by 396
- 2024In-Context Language Learning: Architectures and Algorithmscited by 89
- 2025Test-time regression: a unifying framework for designing sequence models with associative memorycited by 74
- 2025Nested Learning: The Illusion of Deep Learning Architecturescited by 72
- 2025ATLAS: Learning to Optimally Memorize the Context at Test Timecited by 66
- 2024Can Looped Transformers Learn to Implement Multi-step Gradient Descent for In-context Learning?cited by 65
- 2025It's All Connected: A Journey Through Test-Time Memorization, Attentional Bias, Retention, and Online Optimizationcited by 64
- 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
- 2024ICLR: In-Context Learning of Representationscited by 50
- 2025CausalPFN: Amortized Causal Effect Estimation via In-Context Learningcited by 49
12 most cited of 86 All 86 (JSON)
- 2026Depth Memory13 Oct 2026
- 2026Error Correction in Trained TTT Layers12 Oct 2026
- 2026DeltaNet-PC: Test-Time Memory Without Backpropagation Through Time10 Oct 2026
- 2026Retrieval-Centric Deep Learning in Growing Nonparametric Neural Networks2 Oct 2026
- 2026Switching Linear Attention30 Sep 2026
- 2026Proteus: Incremental Memory Activation for Long-Context Sequence Modeling17 Aug 2026
- 2026Language models suffer from a curse of ambiguity15 Aug 2026
- 2026What a Deletion Certificate Covers, and Where It Expires: Auditable Removal from a Support-Vector Memory13 Jul 2026
- 2026The Orthogonalized Read Is a Removable Training Scaffold for Recurrent Memory2 Jul 2026
- 2026Induction Heads Interpolate N-Grams2 Jul 2026
- 2026Understanding Large Language Models1 Jul 2026
- 2026Phase Transitions in Attention: A Bayesian Theory of Copy Head Emergence10 Jun 2026
12 newest of 86 All 86 (JSON)