mlsanityData to 14 Oct 2026

Mechanism and Emergence of Stacked Attention Heads in Multi-Layer Transformers

arXiv 2411.12118 ↗First posted 18 Nov 2024cs.LG cs.CLcited by 7

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2014Adam: A Method for Stochastic Optimizationcited by 37,240
  3. 2020Language Models are Few-Shot Learnerscited by 32,419
  4. 2023GPT-4 Technical Reportcited by 18,396
  5. 2016Layer Normalizationcited by 5,669
  6. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  7. 2022Emergent Abilities of Large Language Modelscited by 2,512
  8. 2017Towards A Rigorous Science of Interpretable Machine Learningcited by 1,416
  9. 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,165
  10. 2023Progress measures for grokking via mechanistic interpretabilitycited by 839
  11. 2023Towards Automated Circuit Discovery for Mechanistic Interpretabilitycited by 724
  12. 2023Are Emergent Abilities of Large Language Models a Mirage?cited by 523
8 more
  1. 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 309
  2. 2023How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language modelcited by 202
  3. 2023Localizing Model Behavior with Path Patchingcited by 195
  4. 2023The Clock and the Pizza: Two Stories in Mechanistic Explanation of Neural Networkscited by 156
  5. 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 118
  6. 2023Understanding Addition in Transformerscited by 34
  7. 2024Survival of the Fittest Representation: A Case Study with Modular Additioncited by 7
  8. 2024Clustering and Alignment: Understanding the Training Dynamics in Modular Additioncited by 5

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 4; 2026: 3.

7 papers.