mlsanityData to 7 Oct 2026

Unifying Attention Heads and Task Vectors via Hidden State Geometry in In-Context Learning

arXiv 2505.18752 ↗First posted 24 May 2025cs.CLcited by 10

Not on the map. Why?

Abstract (arXiv)

The unusual properties of in-context learning (ICL) have prompted investigations into the internal mechanisms of large language models. Prior work typically focuses on either special attention heads or task vectors at specific layers, but lacks a unified framework linking these components to the evolution of hidden states across layers that ultimately produce the model's output. In this paper, we propose such a framework for ICL in classification tasks by analyzing two geometric factors that govern performance: the separability and alignment of query hidden states. A fine-grained analysis of layer-wise dynamics reveals a striking two-stage mechanism: separability emerges in early layers, while alignment develops in later layers. Ablation studies further show that Previous Token Heads drive separability, while Induction Heads and task vectors enhance alignment. Our findings thus bridge the gap between attention heads and task vectors, offering a unified account of ICL's underlying mechanisms.

Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Builds on 17 of its 28 references that are in the map. First posted on arXiv 24 May 2025.

Builds on

17 of 28 references.

References · 17

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  3. 2013Efficient Estimation of Word Representations in Vector Spacecited by 4,346
  4. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
  5. 2023The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasetscited by 673
  6. 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
  7. 2023In-Context Learning Creates Task Vectorscited by 302
  8. 2023Function Vectors in Large Language Modelscited by 292
  9. 2024A Mechanistic Understanding of Alignment Algorithms: A Case Study on DPO and Toxicitycited by 179
  10. 2023The Truth is in There: Improving Reasoning in Language Models with Layer-Selective Rank Reductioncited by 120
  11. 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
  12. 2024What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formationcited by 86
5 more
  1. 2023Overthinking the Truth: Understanding how Language Models Process False Demonstrationscited by 78
  2. 2024Out-of-distribution generalization via composition: a lens through induction heads in Transformerscited by 28
  3. 2024Revisiting In-context Learning Inference Circuit in Large Language Modelscited by 16
  4. 2025The Geometry of Prompting: Unveiling Distinct Mechanisms of Task Adaptation in Language Modelscited by 14
  5. 2024Token-based Decision Criteria Are Suboptimal in In-context Learningcited by 9

Built on by

Cited by year (2026 to 7 Oct)

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

10 papers.