Localizing Task Recognition and Task Learning in In-Context Learning via Attention Head Analysis
Not on the map. Why?
Abstract (arXiv)
We investigate the mechanistic underpinnings of in-context learning (ICL) in large language models by reconciling two dominant perspectives: the component-level analysis of attention heads and the holistic decomposition of ICL into Task Recognition (TR) and Task Learning (TL). We propose a novel framework based on Task Subspace Logit Attribution (TSLA) to identify attention heads specialized in TR and TL, and demonstrate their distinct yet complementary roles. Through correlation analysis, ablation studies, and input perturbations, we show that the identified TR and TL heads independently and effectively capture the TR and TL components of ICL. Using steering experiments with geometric analysis of hidden states, we reveal that TR heads promote task recognition by aligning hidden states with the task subspace, while TL heads rotate hidden states within the subspace toward the correct label to facilitate prediction. We further show how previous findings on ICL mechanisms, including induction heads and task vectors, can be reconciled with our attention-head-level analysis of the TR-TL decomposition. Our framework thus provides a unified and interpretable account of how large language models execute ICL across diverse tasks and settings.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 29 of its 42 references that are in the map. First posted on arXiv 29 Sep 2025.
Builds on
29 of 42 references.
References · 29
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
- 2024Yi: Open Foundation Models by 01.AIcited by 719
- 2023The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasetscited by 712
- 2023Larger language models do in-context learning differentlycited by 394
- 2023In-Context Learning Creates Task Vectorscited by 312
- 2022Black-Box Tuning for Language-Model-as-a-Servicecited by 256
- 2023What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learningcited by 152
- 2023Does Circuit Analysis Interpretability Scale? Evidence from Multiple Choice Capabilities in Chinchillacited by 149
- 2023Language Models Implement Simple Word2Vec-style Vector Arithmeticcited by 98
- 2024Cutting Off the Head Ends the Conflict: A Mechanism for Interpreting and Mitigating Knowledge Conflicts in Language Modelscited by 91
- 2024What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formationcited by 89
17 more
- 2023Overthinking the Truth: Understanding how Language Models Process False Demonstrationscited by 81
- 2024Attention Heads of Large Language Models: A Surveycited by 67
- 2025Which Attention Heads Matter for In-Context Learning?cited by 61
- 2024Identifying Semantic Induction Heads to Understand In-Context Learningcited by 47
- 2024Induction Heads as an Essential Mechanism for Pattern Matching in In-context Learningcited by 46
- 2024Summing Up the Facts: Additive Mechanisms Behind Factual Recall in LLMscited by 42
- 2024Iteration Head: A Mechanistic Study of Chain-of-Thoughtcited by 31
- 2024Out-of-distribution generalization via composition: a lens through induction heads in Transformerscited by 28
- 2024Beyond Single Concept Vector: Modeling Concept Subspace in LLMs with Gaussian Distributioncited by 27
- 2024How do Large Language Models Learn In-Context? Query and Key Matrices of In-Context Heads are Two Towers for Metric Learningcited by 18
- 2025The Geometry of Prompting: Unveiling Distinct Mechanisms of Task Adaptation in Language Modelscited by 18
- 2024Revisiting In-context Learning Inference Circuit in Large Language Modelscited by 17
- 2025Large Language Models Encode Semantics and Alignment in Linearly Separable Representationscited by 17
- 2025The Atlas of In-Context Learning: How Attention Heads Shape In-Context Retrieval Augmentationcited by 11
- 2025Unifying Attention Heads and Task Vectors via Hidden State Geometry in In-Context Learningcited by 10
- 2024Token-based Decision Criteria Are Suboptimal in In-context Learningcited by 9
- 2025From Compression to Expression: A Layerwise Analysis of In-Context Learningcited by 6
Built on by
Citing papers per year: 2026: 2.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2022Rethinking the Role of Scale for In-Context Learning: An Interpretability-based Case Study at 66 Billion Scale
- 2023Is attention required for ICL? Exploring the Relationship Between Model Architecture and In-Context Learning Ability
- 2026Where Computation Lives Inside TabPFN: Causal Localisation of Attention Head Function
- 2026Single-Position Intervention Fails: Distributed Output Templates Drive In-Context Learning
- 2025Task Schema and Binding: A Double Dissociation Study of In-Context Learning
- 2024Does In-Context Learning Really Learn? Rethinking How Large Language Models Respond and Solve Tasks via In-Context Learning
- 2025Soft Head Selection for Injecting ICL-Derived Task Embeddings
- 2026Distributional Alignment as a Criterion for Designing Task Vectors in In-Context Learning