From Self-Attention to Markov Models: Unveiling the Dynamics of Generative Transformers
Not on the map. Why?
Abstract (arXiv)
Modern language models rely on the transformer architecture and attention mechanism to perform language understanding and text generation. In this work, we study learning a 1-layer self-attention model from a set of prompts and associated output data sampled from the model. We first establish a precise mapping between the self-attention mechanism and Markov models: Inputting a prompt to the model samples the output token according to a context-conditioned Markov chain (CCMC) which weights the transition matrix of a base Markov chain. Additionally, incorporating positional encoding results in position-dependent scaling of the transition probabilities. Building on this formalism, we develop identifiability/coverage conditions for the prompt distribution that guarantee consistent estimation and establish sample complexity guarantees under IID samples. Finally, we study the problem of learning from a single output trajectory generated from an initial prompt. We characterize an intriguing winner-takes-all phenomenon where the generative process implemented by self-attention collapses into sampling a limited subset of tokens due to its non-mixing nature. This provides a mathematical explanation to the tendency of modern LLMs to generate repetitive text. In summary, the equivalence to CCMC provides a simple but powerful framework to study self-attention and its properties.
Key facts. Cited by 34 papers in the map (data through 7 Oct 2026). Builds on 50 of its 70 references that are in the map. First posted on arXiv 21 Feb 2024.
Builds on
50 of 70 references.
References · 50
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2017Get To The Point: Summarization with Pointer-Generator Networkscited by 1,281
- 2018Hierarchical Neural Story Generationcited by 1,182
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 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
- 2019Neural Text Generation with Unlikelihood Trainingcited by 489
38 more
- 2019Are Transformers universal approximators of sequence-to-sequence functions?cited by 404
- 2019Information-Theoretic Considerations in Batch Reinforcement Learningcited by 285
- 2016Using the Output Embedding to Improve Language Modelscited by 266
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
- 2018Learning Without Mixing: Towards A Sharp Analysis of Linear System Identificationcited by 158
- 2017On the Sample Complexity of the Linear Quadratic Regulatorcited by 151
- 2021Inductive Biases and Variable Creation in Self-Attention Mechanismscited by 144
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
- 2022Vision Transformers provably learn spatial structurecited by 92
- 2022Learning to Break the Loop: Analyzing and Mitigating Repetitions for Neural Text Generationcited by 90
- 2018Near optimal finite time identification of arbitrary linear dynamical systemscited by 89
- 2020A Theoretical Analysis of the Repetition Problem in Text Generationcited by 83
- 2020Active Learning for Nonlinear System Identification with Guaranteescited by 78
- 2018Non-asymptotic Identification of LTI Systems from a Single Trajectorycited by 77
- 2023A Theoretical Understanding of Shallow Vision Transformers: Learning, Generalization, and Sample Complexitycited by 77
- 2023Transformers as Support Vector Machinescited by 67
- 2023Max-Margin Token Selection in Attention Mechanismcited by 57
- 2020Consistency of a Recurrent Language Model With Respect to Incomplete Decodingcited by 54
- 2022Statistical Learning Theory for Control: A Finite Sample Perspectivecited by 52
- 2023On the Role of Attention in Prompt-tuningcited by 49
- 2020Learning nonlinear dynamical systems from a single trajectorycited by 46
- 2020Non-asymptotic and Accurate Learning of Nonlinear Dynamical Systemscited by 39
- 2023What can a Single Attention Layer Learn? A Study Through the Random Features Lenscited by 39
- 2024Attention with Markov: A Framework for Principled Analysis of Transformers via Markov Chainscited by 39
- 2022Learning with little mixingcited by 33
- 2022Single Trajectory Nonparametric Learning of Nonlinear Dynamicscited by 26
- 2020Sample Efficient Reinforcement Learning via Low-Rank Matrix Estimationcited by 25
- 2019A Tutorial on Concentration Bounds for System Identificationcited by 19
- 2021Straight to the Gradient: Learning to Use Novel Tokens for Neural Text Generationcited by 19
- 2018Spectral State Compression of Markov Processescited by 18
- 2018Stochastic Gradient Descent Learns State Equations with Nonlinear Activationscited by 16
- 2018On Learning Markov Chainscited by 13
- 2019Learning Markov models via low-rank optimizationcited by 12
- 2018Statistical Estimation of Ergodic Markov Chain Kernel over Discrete State Spacecited by 10
- 2024Sharp Rates in Dependent Learning Theory: Avoiding Sample Size Deflation for the Square Losscited by 10
- 2023Smoothed Online Learning for Prediction in Piecewise Affine Systemscited by 9
- 2023Spectral Entry-wise Matrix Estimation for Low-Rank Reinforcement Learningcited by 9
- 2018Estimation of Markov Chain via Rank-Constrained Likelihoodcited by 3
Built on by
Citing papers per year: 2024: 10; 2025: 16; 2026: 8.
34 papers.
Sort:
By area:
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
- 2025When is Task Vector Provably Effective for Model Editing? A Generalization Analysis of Nonlinear Transformerscited by 38
- 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
- 2024Large Language Models as Markov Chainscited by 33
- 2024Selective Attention: Enhancing Transformer through Principled Context Controlcited by 16
- 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
- 2025Attention (as Discrete-Time Markov) Chainscited by 11
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformerscited by 10
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selectioncited by 9
22 more
- 2025From Condensation to Rank Collapse: A Two-Stage Analysis of Transformer Training Dynamicscited by 9
- 2025Selective Induction Heads: How Transformers Select Causal Structures In Contextcited by 7
- 2024On the Power of Convolution Augmented Transformercited by 5
- 2025On the Convergence of Gradient Descent on Learning Transformers with Residual Connectionscited by 5
- 2025What Happens During the Loss Plateau? Understanding Abrupt Learning in Transformerscited by 5
- 2025Prompting Large Language Models with Partial Knowledge for Answering Questions with Unseen Entitiescited by 4
- 2025Too Easily Fooled? Prompt Injection Breaks LLMs on Frustratingly Simple Multiple-Choice Questionscited by 4
- 2024Achieving the Tightest Relaxation of Sigmoids for Formal Verificationcited by 2
- 2024State space models, emergence, and ergodicity: How many parameters are needed for stable predictions?cited by 2
- 2025Key and Value Weights Are Probably All You Need: On the Necessity of the Query, Key, Value weight Triplet in Self-Attention Transformerscited by 2
- 2026Breaking the Reversal Curse in Autoregressive Language Models via Identity Bridgecited by 2
- 2026When does Chain-of-Thought Help: A Markovian Perspectivecited by 2
- 2026Resource Consumption Threats in Large Language Modelscited by 2
- 2025Towards Understanding Transformers in Learning Random Walkscited by 1
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descentcited by 1
- 2026Transformers Provably Learn to Internalize Chain-of-Thoughtcited by 1
- 2025Dual Filter: A Transformer-like Inference Architecture for Hidden Markov Modelscited by 0
- 2025Attention with Trained Embeddings Provably Selects Important Tokenscited by 0
- 2025Context-Aware Regularization with Markovian Integration for Attention-Based Nucleotide Analysiscited by 0
- 2026Sentence Curve Language Modelscited by 0
- 2026Memory as a Markov Matrix: Sample Efficient Knowledge Expansion via Token-to-Dictionary Mappingcited by 0
- 2026Modeling Memory-Dependent Reliability of LLMs: A Hidden Markov Modelcited by 0
- 2026Modeling Memory-Dependent Reliability of LLMs: A Hidden Markov Model24 Jul 2026
- 2026Transformers Provably Learn to Internalize Chain-of-Thought27 May 2026
- 2026Memory as a Markov Matrix: Sample Efficient Knowledge Expansion via Token-to-Dictionary Mapping5 May 2026
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
- 2026Resource Consumption Threats in Large Language Models17 Mar 2026
- 2026When does Chain-of-Thought Help: A Markovian Perspective27 Feb 2026
- 2026Breaking the Reversal Curse in Autoregressive Language Models via Identity Bridge2 Feb 2026
- 2026Sentence Curve Language Models2 Feb 2026
- 2025Towards Understanding Transformers in Learning Random Walks28 Nov 2025
- 2025Key and Value Weights Are Probably All You Need: On the Necessity of the Query, Key, Value weight Triplet in Self-Attention Transformers27 Oct 2025
- 2025From Condensation to Rank Collapse: A Two-Stage Analysis of Transformer Training Dynamics8 Oct 2025
- 2025Selective Induction Heads: How Transformers Select Causal Structures In Context9 Sep 2025
22 more
- 2025Too Easily Fooled? Prompt Injection Breaks LLMs on Frustratingly Simple Multiple-Choice Questions16 Aug 2025
- 2025Prompting Large Language Models with Partial Knowledge for Answering Questions with Unseen Entities2 Aug 2025
- 2025Attention (as Discrete-Time Markov) Chains23 Jul 2025
- 2025Context-Aware Regularization with Markovian Integration for Attention-Based Nucleotide Analysis12 Jul 2025
- 2025What Happens During the Loss Plateau? Understanding Abrupt Learning in Transformers16 Jun 2025
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformers12 Jun 2025
- 2025On the Convergence of Gradient Descent on Learning Transformers with Residual Connections5 Jun 2025
- 2025Attention with Trained Embeddings Provably Selects Important Tokens22 May 2025
- 2025Dual Filter: A Transformer-like Inference Architecture for Hidden Markov Models1 May 2025
- 2025When is Task Vector Provably Effective for Model Editing? A Generalization Analysis of Nonlinear Transformers15 Apr 2025
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learning6 Apr 2025
- 2025Training Dynamics of In-Context Learning in Linear Attention27 Jan 2025
- 2024Selective Attention: Enhancing Transformer through Principled Context Control19 Nov 2024
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selection18 Oct 2024
- 2024Large Language Models as Markov Chains3 Oct 2024
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis3 Oct 2024
- 2024State space models, emergence, and ergodicity: How many parameters are needed for stable predictions?20 Sep 2024
- 2024Achieving the Tightest Relaxation of Sigmoids for Formal Verification20 Aug 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
- 2024Next-token prediction capacity: general upper bounds and a lower bound for transformers22 May 2024
- 2024Mechanics of Next Token Prediction with Self-Attention12 Mar 2024
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformerscited by 10
- 2026Breaking the Reversal Curse in Autoregressive Language Models via Identity Bridgecited by 2
- 2026When does Chain-of-Thought Help: A Markovian Perspectivecited by 2
- 2026Transformers Provably Learn to Internalize Chain-of-Thoughtcited by 1
- 2026Transformers Provably Learn to Internalize Chain-of-Thought27 May 2026
- 2026When does Chain-of-Thought Help: A Markovian Perspective27 Feb 2026
- 2026Breaking the Reversal Curse in Autoregressive Language Models via Identity Bridge2 Feb 2026
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformers12 Jun 2025
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysis3 Oct 2024
- 2026Sentence Curve Language Modelscited by 0
- 2026Sentence Curve Language Models2 Feb 2026
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
- 2024Mechanics of Next Token Prediction with Self-Attentioncited by 34
- 2024Large Language Models as Markov Chainscited by 33
- 2024Selective Attention: Enhancing Transformer through Principled Context Controlcited by 16
- 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
- 2025Gating is Weighting: Understanding Gated Linear Attention through In-context Learningcited by 11
- 2025Attention (as Discrete-Time Markov) Chainscited by 11
- 2024Optimizing Attention with Mirror Descent: Generalized Max-Margin Token Selectioncited by 9
- 2025From Condensation to Rank Collapse: A Two-Stage Analysis of Transformer Training Dynamicscited by 9
- 2025Selective Induction Heads: How Transformers Select Causal Structures In Contextcited by 7
- 2024On the Power of Convolution Augmented Transformercited by 5
12 most cited of 25 All 25 (JSON)
- 2026Modeling Memory-Dependent Reliability of LLMs: A Hidden Markov Model24 Jul 2026
- 2026Memory as a Markov Matrix: Sample Efficient Knowledge Expansion via Token-to-Dictionary Mapping5 May 2026
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
- 2026Resource Consumption Threats in Large Language Models17 Mar 2026
- 2025Towards Understanding Transformers in Learning Random Walks28 Nov 2025
- 2025Key and Value Weights Are Probably All You Need: On the Necessity of the Query, Key, Value weight Triplet in Self-Attention Transformers27 Oct 2025
- 2025From Condensation to Rank Collapse: A Two-Stage Analysis of Transformer Training Dynamics8 Oct 2025
- 2025Selective Induction Heads: How Transformers Select Causal Structures In Context9 Sep 2025
- 2025Attention (as Discrete-Time Markov) Chains23 Jul 2025
- 2025Context-Aware Regularization with Markovian Integration for Attention-Based Nucleotide Analysis12 Jul 2025
- 2025What Happens During the Loss Plateau? Understanding Abrupt Learning in Transformers16 Jun 2025
- 2025On the Convergence of Gradient Descent on Learning Transformers with Residual Connections5 Jun 2025
12 newest of 25 All 25 (JSON)