Mechanism and Emergence of Stacked Attention Heads in Multi-Layer Transformers
Not on the map. Why?
Abstract (arXiv)
In this paper, I introduce the retrieval problem, a simple yet common reasoning task that can be solved only by transformers with a minimum number of layers, which grows logarithmically with the input size. I empirically show that large language models can solve the task under different prompting formulations without any fine-tuning. To understand how transformers solve the retrieval problem, I train several transformers on a minimal formulation. Successful learning occurs only under the presence of an implicit curriculum. I uncover the learned mechanisms by studying the attention maps in the trained transformers. I also study the training process, uncovering that attention heads always emerge in a specific sequence guided by the implicit curriculum.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Builds on 20 of its 29 references that are in the map. First posted on arXiv 18 Nov 2024.
Builds on
20 of 29 references.
References · 20
- 2017Attention Is All You Needcited by 60,361
- 2014Adam: A Method for Stochastic Optimizationcited by 37,240
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023GPT-4 Technical Reportcited by 18,396
- 2016Layer Normalizationcited by 5,669
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2022Emergent Abilities of Large Language Modelscited by 2,512
- 2017Towards A Rigorous Science of Interpretable Machine Learningcited by 1,416
- 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,165
- 2023Progress measures for grokking via mechanistic interpretabilitycited by 839
- 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 724
- 2023Are Emergent Abilities of Large Language Models a Mirage?cited by 523
8 more
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 309
- 2023How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language modelcited by 202
- 2023Localizing Model Behavior with Path Patchingcited by 195
- 2023The Clock and the Pizza: Two Stories in Mechanistic Explanation of Neural Networkscited by 156
- 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 118
- 2023Understanding Addition in Transformerscited by 34
- 2024Survival of the Fittest Representation: A Case Study with Modular Additioncited by 7
- 2024Clustering and Alignment: Understanding the Training Dynamics in Modular Additioncited by 5
Built on by
Citing papers per year: 2025: 4; 2026: 3.
7 papers.
- 2025Delta Attention: Fast and Accurate Sparse Attention Inference by Delta Correctioncited by 7
- 2025On the Emergence of Induction Heads for In-Context Learningcited by 5
- 2026Invariant Learning Dynamics of Transformers in Inductive Reasoning Taskscited by 2
- 2025Understanding the Staged Dynamics of Transformers in Learning Latent Structurecited by 1
- 2026Stability Implies Redundancy: Delta Attention Selective Halting for Efficient Long-Context Prefillingcited by 1
- 2025Making Language Model a Hierarchical Classifiercited by 0
- 2026Memory Retrieval in Transformers: Insights from The Encoding Specificity Principlecited by 0
- 2026Invariant Learning Dynamics of Transformers in Inductive Reasoning Tasks13 Jul 2026
- 2026Stability Implies Redundancy: Delta Attention Selective Halting for Efficient Long-Context Prefilling20 Apr 2026
- 2026Memory Retrieval in Transformers: Insights from The Encoding Specificity Principle28 Jan 2026
- 2025Understanding the Staged Dynamics of Transformers in Learning Latent Structure24 Nov 2025
- 2025On the Emergence of Induction Heads for In-Context Learning2 Nov 2025
- 2025Making Language Model a Hierarchical Classifier17 Jul 2025
- 2025Delta Attention: Fast and Accurate Sparse Attention Inference by Delta Correction16 May 2025