Transformers Learn Latent Mixture Models In-Context via Mirror Descent
Not on the map. Why?
Abstract (arXiv)
Sequence modelling requires determining which past tokens are causally relevant from the context and their importance: a process inherent to the attention layers in transformers, yet whose underlying learned mechanisms remain poorly understood. In this work, we formalize the task of estimating token importance as an in-context learning problem by introducing a framework based on Mixture of Transition Distributions, where a latent variable determines the influence of past tokens on the next. The distribution over this latent variable is parameterized by unobserved mixture weights that transformers must learn in-context. We demonstrate that transformers can implement Mirror Descent to learn these weights from the context. Specifically, we give an explicit construction of a three-layer transformer that exactly implements one step of Mirror Descent and prove that the resulting estimator is a first-order approximation of the Bayes-optimal predictor. Corroborating our construction and its learnability via gradient descent, we empirically show that transformers trained from scratch learn solutions consistent with our theory: their predictive distributions, attention patterns, and learned transition matrix closely match the construction, while deeper models achieve performance comparable to multi-step Mirror Descent.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 42 of its 51 references that are in the map. First posted on arXiv 12 Apr 2026.
Builds on
42 of 51 references.
References · 42
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,592
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
- 2018Self-Attention with Relative Position Representationscited by 1,120
- 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
- 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 724
- 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
- 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 406
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
30 more
- 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
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 170
- 2023Birth of a Transformer: A Memory Viewpointcited by 161
- 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 146
- 2023What and How does In-Context Learning Learn? Bayesian Model Averaging, Parameterization, and Generalizationcited by 118
- 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 118
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 118
- 2023Uncovering mesa-optimization algorithms in Transformerscited by 100
- 2024What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formationcited by 89
- 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 86
- 2024Transformers, parallel computation, and logarithmic depthcited by 79
- 2024Transformers represent belief state geometry in their residual streamcited by 77
- 2024Asymptotic theory of in-context learning by linear attentioncited by 55
- 2024Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformerscited by 50
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 49
- 2023Pretraining Data Mixtures Enable Narrow Model Selection Capabilities in Transformer Modelscited by 45
- 2023Learning Transformer Programscited by 41
- 2024Attention with Markov: A Framework for Principled Analysis of Transformers via Markov Chainscited by 40
- 2024From Self-Attention to Markov Models: Unveiling the Dynamics of Generative Transformerscited by 34
- 2024Transformers Can Represent n-gram Language Modelscited by 32
- 2024Transformers on Markov Data: Constant Depth Sufficescited by 27
- 2024Understanding Transformers via N-gram Statisticscited by 26
- 2025The emergence of sparse attention: impact of data distribution and benefits of repetitioncited by 25
- 2024How do Transformers perform In-Context Autoregressive Learning?cited by 17
- 2025Learning In-context n-grams with Transformers: Sub-n-grams Are Near-stationary Pointscited by 16
- 2023Transformers can optimally learn regression mixture modelscited by 15
- 2024On Limitation of Transformer for Learning HMMscited by 10
- 2025Selective Induction Heads: How Transformers Select Causal Structures In Contextcited by 8
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026Induction Heads Interpolate N-Gramscited by 1
- 2026Induction Heads Interpolate N-Grams2 Jul 2026