Learning In-context n-grams with Transformers: Sub-n-grams Are Near-stationary Points
Not on the map. Why?
Abstract (arXiv)
Motivated by empirical observations of prolonged plateaus and stage-wise progression during training, we investigate the loss landscape of transformer models trained on in-context next-token prediction tasks. In particular, we focus on learning in-context n-gram language models under cross-entropy loss, and establish a sufficient condition for parameter configurations to be stationary points. We then construct a set of parameter configurations for a simplified transformer model that represent k-gram estimators (for k ≤ n), and show that the gradient of the population loss at these solutions vanishes in the limit of infinite sequence length and parameter norm. This reveals a key property of the loss landscape: sub-n-grams are near-stationary points of the population cross-entropy loss, offering theoretical insight into widely observed phenomena such as stage-wise learning dynamics and emergent phase transitions. These insights are further supported by numerical experiments that illustrate the learning dynamics of n-grams, characterized by discrete transitions between near-stationary solutions.
Key facts. Cited by 16 papers in the map (data through 14 Oct 2026). Builds on 35 of its 48 references that are in the map. First posted on arXiv 18 Aug 2025.
Builds on
35 of 48 references.
References · 35
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Emergent Abilities of Large Language Modelscited by 2,512
- 2022In-context Learning and Induction Headscited by 964
- 2022Transformers learn in-context by gradient descentcited by 732
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
- 2022Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasetscited by 629
- 2019Implicit Regularization in Deep Matrix Factorizationcited by 405
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
- 2018A mathematical theory of semantic development in deep neural networkscited by 186
- 2023Birth of a Transformer: A Memory Viewpointcited by 161
- 2020Towards Resolving the Implicit Bias of Gradient Descent for Matrix Factorization: Greedy Low-Rank Learningcited by 150
23 more
- 2023SGD learning on neural networks: leap complexity and saddle-to-saddle dynamicscited by 143
- 2019Implicit Regularization of Discrete Gradient Dynamics in Linear Neural Networkscited by 124
- 2023Sudden Drops in the Loss: Syntax Acquisition, Phase Transitions, and Simplicity Bias in MLMscited by 124
- 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 118
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 118
- 2021Saddle-to-Saddle Dynamics in Deep Linear Networks: Small Initialization Training, Symmetry, and Sparsitycited by 85
- 2022Gradient flow dynamics of shallow ReLU networks for square loss and orthogonal inputscited by 76
- 2019The Implicit Bias of Depth: How Incremental Learning Drives Generalizationcited by 64
- 2023Understanding In-Context Learning in Transformers and LLMs by Learning to Learn Discrete Functionscited by 63
- 2023Saddle-to-Saddle Dynamics in Diagonal Linear Networkscited by 57
- 2023Transformers learn through gradual rank increasecited by 52
- 2024Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformerscited by 50
- 2021Implicit Regularization in Tensor Factorizationcited by 44
- 2023Understanding Incremental Learning of Gradient Descent: A Fine-grained Analysis of Matrix Sensingcited by 42
- 2024Attention with Markov: A Framework for Principled Analysis of Transformers via Markov Chainscited by 40
- 2024Large Language Models as Markov Chainscited by 35
- 2022Algorithmic Regularization in Model-free Overparametrized Asymmetric Matrix Factorizationcited by 34
- 2024Transformers Can Represent n-gram Language Modelscited by 32
- 2022Incremental Learning in Diagonal Linear Networkscited by 28
- 2024Transformers on Markov Data: Constant Depth Sufficescited by 27
- 2024Understanding Transformers via N-gram Statisticscited by 26
- 2024Task Diversity Shortens the ICL Plateaucited by 5
- 2024A Mechanistic Study of Transformers Training Dynamicscited by 1
Built on by
Citing papers per year: 2025: 2; 2026: 14.
16 papers.
Sort:
By area:
- 2025Saddle-to-Saddle Dynamics Explains A Simplicity Bias Across Neural Network Architecturescited by 15
- 2026To Use or not to Use Muon: How Simplicity Bias in Optimizers Matterscited by 10
- 2026Length Generalization Bounds for Transformerscited by 4
- 2025Softmax as Linear Attention in the Large-Prompt Regime: a Measure-based Perspectivecited by 3
- 2026Incremental Learning of Sparse Attention Patterns in Transformerscited by 2
- 2026Gradient Flow Polarizes Softmax Outputs towards Low-Entropy Solutionscited by 2
- 2026Incremental Learning in Mirror Flowscited by 2
- 2026Invariant Learning Dynamics of Transformers in Inductive Reasoning Taskscited by 2
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descentcited by 1
- 2026Smooth Scaling Laws Hide Stepwise Token Learningcited by 1
- 2026Induction Heads Interpolate N-Gramscited by 1
- 2026Gaussian Match-and-Copy: A Minimalist Benchmark for Studying Transformer Inductioncited by 0
4 more
- 2026Length Generalization for Transformers via Compression8 Sep 2026
- 2026Invariant Learning Dynamics of Transformers in Inductive Reasoning Tasks13 Jul 2026
- 2026Induction Heads Interpolate N-Grams2 Jul 2026
- 2026Smooth Scaling Laws Hide Stepwise Token Learning29 Jun 2026
- 2026Extracting Algorithms in Pre-trained LLMs: A Case on Hidden Markov Models24 Jun 2026
- 2026Incremental Learning in Mirror Flows22 Jun 2026
- 2026A Theory of Saddle Escape in Deep Nonlinear Networks2 May 2026
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
- 2026Gradient Flow Polarizes Softmax Outputs towards Low-Entropy Solutions6 Mar 2026
- 2026To Use or not to Use Muon: How Simplicity Bias in Optimizers Matters28 Feb 2026
- 2026Task-Centric Acceleration of Small-Language Models27 Feb 2026
- 2026Incremental Learning of Sparse Attention Patterns in Transformers22 Feb 2026
4 more
- 2026Length Generalization Bounds for Transformers13 Feb 2026
- 2026Gaussian Match-and-Copy: A Minimalist Benchmark for Studying Transformer Induction7 Feb 2026
- 2025Saddle-to-Saddle Dynamics Explains A Simplicity Bias Across Neural Network Architectures23 Dec 2025
- 2025Softmax as Linear Attention in the Large-Prompt Regime: a Measure-based Perspective12 Dec 2025
- 2025Saddle-to-Saddle Dynamics Explains A Simplicity Bias Across Neural Network Architecturescited by 15
- 2026To Use or not to Use Muon: How Simplicity Bias in Optimizers Matterscited by 10
- 2026Length Generalization Bounds for Transformerscited by 4
- 2025Softmax as Linear Attention in the Large-Prompt Regime: a Measure-based Perspectivecited by 3
- 2026Incremental Learning of Sparse Attention Patterns in Transformerscited by 2
- 2026Gradient Flow Polarizes Softmax Outputs towards Low-Entropy Solutionscited by 2
- 2026Incremental Learning in Mirror Flowscited by 2
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descentcited by 1
- 2026Smooth Scaling Laws Hide Stepwise Token Learningcited by 1
- 2026Induction Heads Interpolate N-Gramscited by 1
- 2026Gaussian Match-and-Copy: A Minimalist Benchmark for Studying Transformer Inductioncited by 0
- 2026Task-Centric Acceleration of Small-Language Modelscited by 0
12 most cited of 15 All 15 (JSON)
- 2026Length Generalization for Transformers via Compression8 Sep 2026
- 2026Induction Heads Interpolate N-Grams2 Jul 2026
- 2026Smooth Scaling Laws Hide Stepwise Token Learning29 Jun 2026
- 2026Extracting Algorithms in Pre-trained LLMs: A Case on Hidden Markov Models24 Jun 2026
- 2026Incremental Learning in Mirror Flows22 Jun 2026
- 2026A Theory of Saddle Escape in Deep Nonlinear Networks2 May 2026
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
- 2026Gradient Flow Polarizes Softmax Outputs towards Low-Entropy Solutions6 Mar 2026
- 2026To Use or not to Use Muon: How Simplicity Bias in Optimizers Matters28 Feb 2026
- 2026Task-Centric Acceleration of Small-Language Models27 Feb 2026
- 2026Incremental Learning of Sparse Attention Patterns in Transformers22 Feb 2026
- 2026Length Generalization Bounds for Transformers13 Feb 2026
12 newest of 15 All 15 (JSON)