How Transformers Learn Causal Structure with Gradient Descent
Not on the map. Why?
Cited by 24 in LLM reasoning, but placed by its own abstract, which didn’t fit.
Abstract (arXiv)
The incredible success of transformers on sequence modeling tasks can be largely attributed to the self-attention mechanism, which allows information to be transferred between different parts of a sequence. Self-attention allows transformers to encode causal structure which makes them particularly suitable for sequence modeling. However, the process by which transformers learn such causal structure via gradient-based training algorithms remains poorly understood. To better understand this process, we introduce an in-context learning task that requires learning latent causal structure. We prove that gradient descent on a simplified two-layer transformer learns to solve this task by encoding the latent causal graph in the first attention layer. The key insight of our proof is that the gradient of the attention matrix encodes the mutual information between tokens. As a consequence of the data processing inequality, the largest entries of this gradient correspond to edges in the latent causal graph. As a special case, when the sequences are generated from in-context Markov chains, we prove that transformers learn an induction head (Olsson et al., 2022). We confirm our theoretical findings by showing that transformers trained on our in-context learning task are able to recover a wide variety of causal structures.
Key facts. Cited by 114 papers in the map (data through 7 Oct 2026). Builds on 24 of its 29 references that are in the map. First posted on arXiv 22 Feb 2024.
Builds on
24 of 29 references.
References · 24
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,528
- 2022In-context Learning and Induction Headscited by 930
- 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
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
12 more
- 2023Looped Transformers as Programmable Computerscited by 224
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
- 2023Birth of a Transformer: A Memory Viewpointcited by 154
- 2023In-Context Convergence of Transformerscited by 112
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
- 2022Vision Transformers provably learn spatial structurecited by 92
- 2023Transformers as Support Vector Machinescited by 67
- 2023Max-Margin Token Selection in Attention Mechanismcited by 57
- 2023Transformers learn through gradual rank increasecited by 52
- 2023JoMA: Demystifying Multilayer Transformers via JOint Dynamics of MLP and Attentioncited by 52
- 2023Transformers Learn to Achieve Second-Order Convergence Rates for In-Context Linear Regressioncited by 47
- 2023Learning Transformer Programscited by 40
Built on by
Citing papers per year: 2024: 38; 2025: 46; 2026: 30.
114 papers.
Sort:
By area:
- 2024Mechanistic Interpretability for AI Safety -- A Reviewcited by 415
- 2024Active-Dormant Attention Heads: Mechanistically Demystifying Extreme-Token Phenomena in LLMscited by 54
- 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
- 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 36
- 2024Conv-Basis: A New Paradigm for Efficient Attention Inference and Gradient Computation in Transformerscited by 32
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thoughtcited by 32
- 2024Iteration Head: A Mechanistic Study of Chain-of-Thoughtcited by 31
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 29
- 2024Out-of-distribution generalization via composition: a lens through induction heads in Transformerscited by 28
- 2024From Sparse Dependence to Sparse Attention: Unveiling How Chain-of-Thought Enhances Transformer Sample Efficiencycited by 28
- 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamicscited by 27
38 more
- 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
- 2025The emergence of sparse attention: impact of data distribution and benefits of repetitioncited by 25
- 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 21
- 2026There Will Be a Scientific Theory of Deep Learningcited by 21
- 2025How Do LLMs Perform Two-Hop Reasoning in Context?cited by 20
- 2024Toward Understanding In-context vs. In-weight Learningcited by 19
- 2024Compact Proofs of Model Performance via Mechanistic Interpretabilitycited by 17
- 2024Implicit Regularization of Gradient Flow on One-Layer Softmax Attentioncited by 16
- 2025Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous Thoughtcited by 16
- 2024Understanding the Language Model to Solve the Symbolic Multi-Step Reasoning Problem from the Perspective of Buffer Mechanismcited by 15
- 2024Attention layers provably solve single-location regressioncited by 15
- 2024On the Training Convergence of Transformers for In-Context Classification of Gaussian Mixturescited by 15
- 2025Learning In-context n-grams with Transformers: Sub-n-grams Are Near-stationary Pointscited by 15
- 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
- 2025Why and How LLMs Hallucinate: Connecting the Dots with Subsequence Associationscited by 14
- 2024How Transformers Utilize Multi-Head Attention in In-Context Learning? A Case Study on Sparse Linear Regressioncited by 13
- 2024Non-asymptotic Convergence of Training Transformers for Next-token Predictioncited by 13
- 2025Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalizationcited by 12
- 2025How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Biascited by 10
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformerscited by 10
- 2024Dissecting the Interplay of Attention Paths in a Statistical Mechanics Theory of Transformerscited by 9
- 2025From Markov to Laplace: How Mamba In-Context Learns Markov Chainscited by 9
- 2025From Condensation to Rank Collapse: A Two-Stage Analysis of Transformer Training Dynamicscited by 9
- 2024Transformers Handle Endogeneity in In-Context Linear Regressioncited by 8
- 2024Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysiscited by 8
- 2025Understanding In-context Learning of Addition via Activation Subspacescited by 8
- 2025Quantitative Bounds for Length Generalization in Transformerscited by 8
- 2024How Transformers Get Rich: Approximation and Dynamics Analysiscited by 7
- 2025On the Role of Transformer Feed-Forward Layers in Nonlinear In-Context Learningcited by 7
- 2025Selective Induction Heads: How Transformers Select Causal Structures In Contextcited by 7
- 2024On the Learn-to-Optimize Capabilities of Transformers in In-Context Sparse Recoverycited by 6
- 2025From Shortcut to Induction Head: How Data Diversity Shapes Algorithm Selection in Transformerscited by 6
- 2024On Mesa-Optimization in Autoregressively Trained Transformers: Emergence and Capabilitycited by 5
- 2024Explain the Black Box for the Sake of Science: the Scientific Method in the Era of Generative Artificial Intelligencecited by 5
- 2024On the Power of Convolution Augmented Transformercited by 5
- 2024In-Context Learning of Linear Systems: Generalization Theory and Applications to Operator Learningcited by 5
50 most cited of 114 All 114 (JSON)
- 2026Why Do Conventional World Models Fail to Learn Cellular Automata?30 Sep 2026
- 2026Theory on Attention Dynamics for Out-of-Distribution In-Context Learning29 Sep 2026
- 2026Small transformers track Bayesian evidence for latent common causes via a context-invariant mechanism28 Sep 2026
- 2026Invariant Learning Dynamics of Transformers in Inductive Reasoning Tasks13 Jul 2026
- 2026Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatch4 Jul 2026
- 2026Induction Heads Interpolate N-Grams2 Jul 2026
- 2026Provable Benefits of RLVR over SFT for Reasoning Models: Learning to Backtrack Efficiently22 Jun 2026
- 2026Assign and Add: A Mechanistic Study of Compositional Arithmetic29 May 2026
- 2026Transformers Provably Learn to Internalize Chain-of-Thought27 May 2026
- 2026Fine-Tuning Dynamics of In-Context Factual Recall in Transformers26 May 2026
- 2026Emergence of Frontier Superposition: M"obius attractor and Cascade Supervision12 May 2026
- 2026Transformers Provably Implement In-Context Reinforcement Learning with Policy Improvement7 May 2026
38 more
- 2026The Scaling Properties of Implicit Deductive Reasoning in Transformers5 May 2026
- 2026There Will Be a Scientific Theory of Deep Learning23 Apr 2026
- 2026CausalDetox: Causal Head Selection and Intervention for Language Model Detoxification16 Apr 2026
- 2026How Transformers Learn to Plan via Multi-Token Prediction13 Apr 2026
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
- 2026Visual prompting reimagined: The power of the Activation Prompts7 Apr 2026
- 2026Sampling at intermediate temperatures is optimal for training large language models in protein structure prediction31 Mar 2026
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge21 Mar 2026
- 2026Reconciling In-Context and In-Weight Learning via Dual Representation Space Encoding13 Mar 2026
- 2026Feature Resemblance: Towards a Theoretical Understanding of Analogical Reasoning in Transformers5 Mar 2026
- 2026Incremental Learning of Sparse Attention Patterns in Transformers22 Feb 2026
- 2026Gaussian Match-and-Copy: A Minimalist Benchmark for Studying Transformer Induction7 Feb 2026
- 2026Breaking the Reversal Curse in Autoregressive Language Models via Identity Bridge2 Feb 2026
- 2026Tuning the Implicit Regularizer of Masked Diffusion Language Models: Enhancing Generalization via Insights from k-Parity30 Jan 2026
- 2026How Do Transformers Learn to Associate Tokens: Gradient Leading Terms Bring Mechanistic Interpretability27 Jan 2026
- 2026Finite-Time Analysis of Gradient Descent for Shallow Transformers23 Jan 2026
- 2026Outcome-Based RL Provably Leads Transformers to Reason, but Only With the Right Data21 Jan 2026
- 2026Unlabeled Data Can Provably Enhance In-Context Learning of Transformers15 Jan 2026
- 2025Adapting, Fast and Slow: On Few-Shot Transportability of Compositions28 Dec 2025
- 2025From Shortcut to Induction Head: How Data Diversity Shapes Algorithm Selection in Transformers21 Dec 2025
- 2025Secret mixtures of experts inside your LLM20 Dec 2025
- 2025Can We Go Beyond Visual Features? Neural Tissue Relation Modeling for Relational Graph Analysis in Non-Melanoma Skin Histology7 Dec 2025
- 2025Towards Understanding Transformers in Learning Random Walks28 Nov 2025
- 2025Understanding the Staged Dynamics of Transformers in Learning Latent Structure24 Nov 2025
- 2025Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization10 Nov 2025
- 2025Provable Benefit of Curriculum in Transformer Tree-Reasoning Post-Training10 Nov 2025
- 2025Distributional Biases in Post-Training: A Markovian Analysis of Reasoning Trajectories10 Nov 2025
- 2025On the Emergence of Induction Heads for In-Context Learning2 Nov 2025
- 2025Quantitative Bounds for Length Generalization in Transformers30 Oct 2025
- 2025Mixture-of-Transformers Learn Faster: A Theoretical Study on Classification Problems30 Oct 2025
- 2025Transformers Provably Learn Directed Acyclic Graphs via Kernel-Guided Mutual Information29 Oct 2025
- 2025Optimality and NP-Hardness of Transformers in Learning Markovian Dynamical Functions21 Oct 2025
- 2025From Condensation to Rank Collapse: A Two-Stage Analysis of Transformer Training Dynamics8 Oct 2025
- 2025Test time training enhances in-context learning of nonlinear functions30 Sep 2025
- 2025The Impossibility of Inverse Permutation Learning in Transformer Models28 Sep 2025
- 2025Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous Thought27 Sep 2025
- 2025One-Shot Multi-Label Causal Discovery in High-Dimensional Event Sequences27 Sep 2025
- 2025Limit Analysis for Symbolic Multi-step Reasoning Tasks with Information Propagation Rules Based on Transformers27 Sep 2025
50 newest of 114 All 114 (JSON)
- 2025Transformers Learn to Implement Multi-step Gradient Descent with Chain of Thoughtcited by 32
- 2024Iteration Head: A Mechanistic Study of Chain-of-Thoughtcited by 31
- 2024From Sparse Dependence to Sparse Attention: Unveiling How Chain-of-Thought Enhances Transformer Sample Efficiencycited by 28
- 2024Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamicscited by 27
- 2025Metastable Dynamics of Chain-of-Thought Reasoning: Provable Benefits of Search, RL and Distillationcited by 25
- 2025How Do LLMs Perform Two-Hop Reasoning in Context?cited by 20
- 2025Emergence of Superposition: Unveiling the Training Dynamics of Chain of Continuous Thoughtcited by 16
- 2024Understanding the Language Model to Solve the Symbolic Multi-Step Reasoning Problem from the Perspective of Buffer Mechanismcited by 15
- 2024Training Nonlinear Transformers for Chain-of-Thought Inference: A Theoretical Generalization Analysiscited by 14
- 2025Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalizationcited by 12
- 2025Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformerscited by 10
- 2026Outcome-Based RL Provably Leads Transformers to Reason, but Only With the Right Datacited by 5
12 most cited of 24 All 24 (JSON)
- 2026Invariant Learning Dynamics of Transformers in Inductive Reasoning Tasks13 Jul 2026
- 2026Provable Benefits of RLVR over SFT for Reasoning Models: Learning to Backtrack Efficiently22 Jun 2026
- 2026Transformers Provably Learn to Internalize Chain-of-Thought27 May 2026
- 2026Emergence of Frontier Superposition: M"obius attractor and Cascade Supervision12 May 2026
- 2026The Scaling Properties of Implicit Deductive Reasoning in Transformers5 May 2026
- 2026Understanding Contextual Recall in Transformers: How Finetuning Enables In-Context Reasoning over Pretraining Knowledge21 Mar 2026
- 2026Feature Resemblance: Towards a Theoretical Understanding of Analogical Reasoning in Transformers5 Mar 2026
- 2026Breaking the Reversal Curse in Autoregressive Language Models via Identity Bridge2 Feb 2026
- 2026Outcome-Based RL Provably Leads Transformers to Reason, but Only With the Right Data21 Jan 2026
- 2025Transformers Provably Learn Chain-of-Thought Reasoning with Length Generalization10 Nov 2025
- 2025Provable Benefit of Curriculum in Transformer Tree-Reasoning Post-Training10 Nov 2025
- 2025Distributional Biases in Post-Training: A Markovian Analysis of Reasoning Trajectories10 Nov 2025
12 newest of 24 All 24 (JSON)
- 2024Mechanistic Interpretability for AI Safety -- A Reviewcited by 415
- 2024Active-Dormant Attention Heads: Mechanistically Demystifying Extreme-Token Phenomena in LLMscited by 54
- 2025Training Dynamics of In-Context Learning in Linear Attentioncited by 44
- 2024In-Context Learning with Representations: Contextual Generalization of Trained Transformerscited by 36
- 2024Conv-Basis: A New Paradigm for Efficient Attention Inference and Gradient Computation in Transformerscited by 32
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 29
- 2024Out-of-distribution generalization via composition: a lens through induction heads in Transformerscited by 28
- 2024Transformers on Markov Data: Constant Depth Sufficescited by 26
- 2025The emergence of sparse attention: impact of data distribution and benefits of repetitioncited by 25
- 2024Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannotcited by 21
- 2026There Will Be a Scientific Theory of Deep Learningcited by 21
- 2024Toward Understanding In-context vs. In-weight Learningcited by 19
12 most cited of 84 All 84 (JSON)
- 2026Theory on Attention Dynamics for Out-of-Distribution In-Context Learning29 Sep 2026
- 2026Small transformers track Bayesian evidence for latent common causes via a context-invariant mechanism28 Sep 2026
- 2026Sequential Correlations Change In-Context Learning: Effective Context Length and Architectural Mismatch4 Jul 2026
- 2026Induction Heads Interpolate N-Grams2 Jul 2026
- 2026Assign and Add: A Mechanistic Study of Compositional Arithmetic29 May 2026
- 2026Fine-Tuning Dynamics of In-Context Factual Recall in Transformers26 May 2026
- 2026Transformers Provably Implement In-Context Reinforcement Learning with Policy Improvement7 May 2026
- 2026There Will Be a Scientific Theory of Deep Learning23 Apr 2026
- 2026CausalDetox: Causal Head Selection and Intervention for Language Model Detoxification16 Apr 2026
- 2026How Transformers Learn to Plan via Multi-Token Prediction13 Apr 2026
- 2026Transformers Learn Latent Mixture Models In-Context via Mirror Descent12 Apr 2026
- 2026Visual prompting reimagined: The power of the Activation Prompts7 Apr 2026
12 newest of 84 All 84 (JSON)