Attention with Markov: A Framework for Principled Analysis of Transformers via Markov Chains
Not on the map. Why?
Abstract (arXiv)
Attention-based transformers have achieved tremendous success across a variety of disciplines including natural languages. To deepen our understanding of their sequential modeling capabilities, there is a growing interest in using Markov input processes to study them. A key finding is that when trained on first-order Markov chains, transformers with two or more layers consistently develop an induction head mechanism to estimate the in-context bigram conditional distribution. In contrast, single-layer transformers, unable to form an induction head, directly learn the Markov kernel but often face a surprising challenge: they become trapped in local minima representing the unigram distribution, whereas deeper models reliably converge to the ground-truth bigram. While single-layer transformers can theoretically model first-order Markov chains, their empirical failure to learn this simple kernel in practice remains a curious phenomenon. To explain this contrasting behavior of single-layer models, in this paper we introduce a new framework for a principled analysis of transformers via Markov chains. Leveraging our framework, we theoretically characterize the loss landscape of single-layer transformers and show the existence of global minima (bigram) and bad local minima (unigram) contingent on data properties and model architecture. We precisely delineate the regimes under which these local optima occur. Backed by experiments, we demonstrate that our theoretical findings are in congruence with the empirical results. Finally, we outline several open problems in this arena. Code is available at https://github.com/Bond1995/Markov .
Key facts. Cited by 39 papers in the map (data through 7 Oct 2026). Builds on 35 of its 66 references that are in the map. First posted on arXiv 6 Feb 2024.
Builds on
35 of 66 references.
References · 35
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,130
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2023Progress measures for grokking via mechanistic interpretabilitycited by 822
- 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
- 2023Dissecting Recall of Factual Associations in Auto-Regressive Language Modelscited by 512
- 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 404
- 2019Implicit Regularization in Deep Matrix Factorizationcited by 402
23 more
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2016Using the Output Embedding to Improve Language Modelscited by 266
- 2016Benefits of depth in neural networkscited by 248
- 2019Analyzing the Structure of Attention in a Transformer Language Modelcited by 241
- 2023Looped Transformers as Programmable Computerscited by 224
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
- 2021Thinking Like Transformerscited by 182
- 2023Birth of a Transformer: A Memory Viewpointcited by 154
- 2020Rethinking embedding coupling in pre-trained language modelscited by 103
- 2021Statistically Meaningful Approximation: a Case Study on Approximating Turing Machines with Transformerscited by 101
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
- 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 85
- 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
- 2023Transformers as Support Vector Machinescited by 67
- 2023Auto-Regressive Next-Token Predictors are Universal Learnerscited by 65
- 2023Max-Margin Token Selection in Attention Mechanismcited by 57
- 2023On the Role of Attention in Prompt-tuningcited by 49
- 2023The Shaped Transformer: Attention Models in the Infinite Depth-and-Width Limitcited by 47
- 2023What can a Single Attention Layer Learn? A Study Through the Random Features Lenscited by 39
- 2021Approximating How Single Head Attention Learnscited by 38
- 2022What is my math transformer doing? -- Three results on interpretability and generalizationcited by 19
- 2018On Learning Markov Chainscited by 13
- 2018Statistical Estimation of Ergodic Markov Chain Kernel over Discrete State Spacecited by 10
Built on by
Citing papers per year: 2024: 17; 2025: 16; 2026: 6.
39 papers.
Sort:
By area:
- 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 115
- 2024From Self-Attention to Markov Models: Unveiling the Dynamics of Generative Transformerscited by 34
- 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
- 2024Large Language Models as Markov Chainscited by 33
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thoughtcited by 32
- 2024Implicit Bias and Fast Convergence Rates for Self-attentioncited by 31
- 2024Transformers on Markov Data: Constant Depth Sufficescited by 26
- 2025Metastable Dynamics of Chain-of-Thought Reasoning: Provable Benefits of Search, RL and Distillationcited by 25
- 2024Understanding and Mitigating Tokenization Bias in Language Modelscited by 18
- 2024Training LLMs over Neurally Compressed Textcited by 16
- 2024From Pixels to Tokens: Byte-Pair Encoding on Quantized Visual Modalitiescited by 16
- 2025Learning In-context n-grams with Transformers: Sub-n-grams Are Near-stationary Pointscited by 15
27 more
- 2024Implicit Optimization Bias of Next-Token Prediction in Linear Modelscited by 14
- 2024Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformerscited by 14
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
- 2024Next-token prediction capacity: general upper bounds and a lower bound for transformerscited by 11
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 11
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selectioncited by 9
- 2025Unified Multimodal Understanding via Byte-Pair Visual Encodingcited by 9
- 2025All You Need is One: Capsule Prompt Tuning with a Single Vectorcited by 8
- 2025Selective Induction Heads: How Transformers Select Causal Structures In Contextcited by 7
- 2024On the Power of Convolution Augmented Transformercited by 5
- 2025Universality of Layer-Level Entropy-Weighted Quantization Beyond Model Architecture and Sizecited by 4
- 2025Pre-trained Large Language Models Learn Hidden Markov Models In-contextcited by 4
- 2025Provable In-Context Learning of Nonlinear Regression with Transformerscited by 4
- 2025Are Transformers Able to Reason by Connecting Separated Knowledge in Training Data?cited by 3
- 2025Facts in Stats: Impacts of Pretraining Diversity on Language Model Generalizationcited by 3
- 2025Distributional Biases in Post-Training: A Markovian Analysis of Reasoning Trajectoriescited by 3
- 2024An Information-Theoretic Approach to Understanding Transformers' In-Context Learning of Variable-Order Markov Chainscited by 2
- 2025Multiple Choice Learning of Low-Rank Adapters for Language Modelingcited by 2
- 2026Syllabic Agglutinative Tokenizations for Indonesian LLM: A Study from Gasing Literacy Learning Systemcited by 2
- 2026When does Chain-of-Thought Help: A Markovian Perspectivecited by 2
- 2025Cognitive Activation and Chaotic Dynamics in Large Language Models: A Quasi-Lyapunov Analysis of Reasoning Mechanismscited by 1
- 2026Incremental Learning of Sparse Attention Patterns in Transformerscited by 1
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descentcited by 1
- 2024Analysis of Unstructured High-Density Crowded Scenes for Crowd Monitoringcited by 0
- 2025Optimality and NP-Hardness of Transformers in Learning Markovian Dynamical Functionscited by 0
- 2026Induction Heads Interpolate N-Gramscited by 0
- 2026Relevant and Irrelevant: A Renormalization Group Analysis of Transformer Attentioncited by 0
- 2026Relevant and Irrelevant: A Renormalization Group Analysis of Transformer Attention16 Jul 2026
- 2026Induction Heads Interpolate N-Grams2 Jul 2026
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
- 2026When does Chain-of-Thought Help: A Markovian Perspective27 Feb 2026
- 2026Incremental Learning of Sparse Attention Patterns in Transformers22 Feb 2026
- 2026Syllabic Agglutinative Tokenizations for Indonesian LLM: A Study from Gasing Literacy Learning System14 Jan 2026
- 2025Distributional Biases in Post-Training: A Markovian Analysis of Reasoning Trajectories10 Nov 2025
- 2025Optimality and NP-Hardness of Transformers in Learning Markovian Dynamical Functions21 Oct 2025
- 2025All You Need is One: Capsule Prompt Tuning with a Single Vector19 Oct 2025
- 2025Facts in Stats: Impacts of Pretraining Diversity on Language Model Generalization17 Oct 2025
- 2025Selective Induction Heads: How Transformers Select Causal Structures In Context9 Sep 2025
- 2025Learning In-context n-grams with Transformers: Sub-n-grams Are Near-stationary Points18 Aug 2025
27 more
- 2025Provable In-Context Learning of Nonlinear Regression with Transformers28 Jul 2025
- 2025Multiple Choice Learning of Low-Rank Adapters for Language Modeling14 Jul 2025
- 2025Unified Multimodal Understanding via Byte-Pair Visual Encoding30 Jun 2025
- 2025Pre-trained Large Language Models Learn Hidden Markov Models In-context8 Jun 2025
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learning6 Apr 2025
- 2025Cognitive Activation and Chaotic Dynamics in Large Language Models: A Quasi-Lyapunov Analysis of Reasoning Mechanisms15 Mar 2025
- 2025Universality of Layer-Level Entropy-Weighted Quantization Beyond Model Architecture and Size6 Mar 2025
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thought28 Feb 2025
- 2025Metastable Dynamics of Chain-of-Thought Reasoning: Provable Benefits of Search, RL and Distillation2 Feb 2025
- 2025Are Transformers Able to Reason by Connecting Separated Knowledge in Training Data?27 Jan 2025
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selection18 Oct 2024
- 2024An Information-Theoretic Approach to Understanding Transformers' In-Context Learning of Variable-Order Markov Chains7 Oct 2024
- 2024Large Language Models as Markov Chains3 Oct 2024
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis3 Oct 2024
- 2024From Pixels to Tokens: Byte-Pair Encoding on Quantized Visual Modalities3 Oct 2024
- 2024Analysis of Unstructured High-Density Crowded Scenes for Crowd Monitoring6 Aug 2024
- 2024Transformers on Markov Data: Constant Depth Suffices25 Jul 2024
- 2024On the Power of Convolution Augmented Transformer8 Jul 2024
- 2024Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformers26 Jun 2024
- 2024Understanding and Mitigating Tokenization Bias in Language Models24 Jun 2024
- 2024Next-token prediction capacity: general upper bounds and a lower bound for transformers22 May 2024
- 2024Training LLMs over Neurally Compressed Text4 Apr 2024
- 2024Mechanics of Next Token Prediction with Self-Attention12 Mar 2024
- 2024Implicit Optimization Bias of Next-Token Prediction in Linear Models28 Feb 2024
- 2024From Self-Attention to Markov Models: Unveiling the Dynamics of Generative Transformers21 Feb 2024
- 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chains16 Feb 2024
- 2024Implicit Bias and Fast Convergence Rates for Self-attention8 Feb 2024
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thoughtcited by 32
- 2025Metastable Dynamics of Chain-of-Thought Reasoning: Provable Benefits of Search, RL and Distillationcited by 25
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
- 2025Distributional Biases in Post-Training: A Markovian Analysis of Reasoning Trajectoriescited by 3
- 2026When does Chain-of-Thought Help: A Markovian Perspectivecited by 2
- 2025Cognitive Activation and Chaotic Dynamics in Large Language Models: A Quasi-Lyapunov Analysis of Reasoning Mechanismscited by 1
- 2026When does Chain-of-Thought Help: A Markovian Perspective27 Feb 2026
- 2025Distributional Biases in Post-Training: A Markovian Analysis of Reasoning Trajectories10 Nov 2025
- 2025Cognitive Activation and Chaotic Dynamics in Large Language Models: A Quasi-Lyapunov Analysis of Reasoning Mechanisms15 Mar 2025
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thought28 Feb 2025
- 2025Metastable Dynamics of Chain-of-Thought Reasoning: Provable Benefits of Search, RL and Distillation2 Feb 2025
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis3 Oct 2024
- 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 115
- 2024From Self-Attention to Markov Models: Unveiling the Dynamics of Generative Transformerscited by 34
- 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
- 2024Large Language Models as Markov Chainscited by 33
- 2024Implicit Bias and Fast Convergence Rates for Self-attentioncited by 31
- 2024Transformers on Markov Data: Constant Depth Sufficescited by 26
- 2024Understanding and Mitigating Tokenization Bias in Language Modelscited by 18
- 2024Training LLMs over Neurally Compressed Textcited by 16
- 2025Learning In-context n-grams with Transformers: Sub-n-grams Are Near-stationary Pointscited by 15
- 2024Implicit Optimization Bias of Next-Token Prediction in Linear Modelscited by 14
- 2024Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformerscited by 14
- 2024Next-token prediction capacity: general upper bounds and a lower bound for transformerscited by 11
12 most cited of 31 All 31 (JSON)
- 2026Relevant and Irrelevant: A Renormalization Group Analysis of Transformer Attention16 Jul 2026
- 2026Induction Heads Interpolate N-Grams2 Jul 2026
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
- 2026Incremental Learning of Sparse Attention Patterns in Transformers22 Feb 2026
- 2026Syllabic Agglutinative Tokenizations for Indonesian LLM: A Study from Gasing Literacy Learning System14 Jan 2026
- 2025Optimality and NP-Hardness of Transformers in Learning Markovian Dynamical Functions21 Oct 2025
- 2025All You Need is One: Capsule Prompt Tuning with a Single Vector19 Oct 2025
- 2025Facts in Stats: Impacts of Pretraining Diversity on Language Model Generalization17 Oct 2025
- 2025Selective Induction Heads: How Transformers Select Causal Structures In Context9 Sep 2025
- 2025Learning In-context n-grams with Transformers: Sub-n-grams Are Near-stationary Points18 Aug 2025
- 2025Provable In-Context Learning of Nonlinear Regression with Transformers28 Jul 2025
- 2025Multiple Choice Learning of Low-Rank Adapters for Language Modeling14 Jul 2025
12 newest of 31 All 31 (JSON)