A circuit for predicting hierarchical structure in-context in Large Language Models
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) excel at in-context learning, the ability to use information provided as context to improve prediction of future tokens. Induction heads have been argued to play a crucial role for in-context learning in Transformer Language Models. These attention heads make a token attend to successors of past occurrences of the same token in the input. This basic mechanism supports LLMs' ability to copy and predict repeating patterns. However, it is unclear if this same mechanism can support in-context learning of more complex repetitive patterns with hierarchical structure. Natural language is teeming with such cases: The article "the" in English usually prefaces multiple nouns in a text. When predicting which token succeeds a particular instance of "the", we need to integrate further contextual cues from the text to predict the correct noun. If induction heads naively attend to all past instances of successor tokens of "the" in a context-independent manner, they cannot support this level of contextual information integration. In this study, we design a synthetic in-context learning task, where tokens are repeated with hierarchical dependencies. Here, attending uniformly to all successor tokens is not sufficient to accurately predict future tokens. Evaluating a range of LLMs on these token sequences and natural language analogues, we find adaptive induction heads that support prediction by learning what to attend to in-context. Next, we investigate how induction heads themselves learn in-context. We find evidence that learning is supported by attention heads that uncover a set of latent contexts, determining the different token transition relationships. Overall, we not only show that LLMs have induction heads that learn, but offer a complete mechanistic account of how LLMs learn to predict higher-order repetitive patterns in-context.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 24 of its 47 references that are in the map. First posted on arXiv 25 Sep 2025.
Builds on
24 of 47 references.
References · 24
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2025Qwen3 Technical Reportcited by 8,820
- 2024Qwen2.5 Technical Reportcited by 4,942
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,998
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
- 2022Transformers learn in-context by gradient descentcited by 732
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2023In-Context Learning Creates Task Vectorscited by 312
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 309
- 2023Function Vectors in Large Language Modelscited by 308
12 more
- 2023Language Modeling Is Compressioncited by 225
- 2024Transformers represent belief state geometry in their residual streamcited by 77
- 2023The Transient Nature of Emergent In-Context Learning in Transformerscited by 76
- 2025Which Attention Heads Matter for In-Context Learning?cited by 61
- 2024Competition Dynamics Shape Algorithmic Phases of In-Context Learningcited by 54
- 2024ICLR: In-Context Learning of Representationscited by 50
- 2024Identifying Semantic Induction Heads to Understand In-Context Learningcited by 47
- 2025Emergent Symbolic Mechanisms Support Abstract Reasoning in Large Language Modelscited by 31
- 2025The Dual-Route Model of Inductioncited by 24
- 2024Sparse Autoencoders Reveal Temporal Difference Learning in Large Language Modelscited by 15
- 2023Reinforcement Learning with Simple Sequence Priorscited by 11
- 2024Simplifying Latent Dynamics with Softly State-Invariant World Modelscited by 10
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026Do Sparse Autoencoders Capture Concept Manifolds?cited by 31
- 2026Do Sparse Autoencoders Capture Concept Manifolds?30 Apr 2026