Unifying Attention Heads and Task Vectors via Hidden State Geometry in In-Context Learning
Haolin Yang, Hakaze Cho, Yiqiao Zhong, Naoya Inoue
摘要
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 primarily 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. 1 is not a continuous function, S * as a supremum can be attained on S d-1
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- CoT Vectors: Transferring and Probing the Reasoning Mechanisms of LLMs 引用了 In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steering
- CoT Vectors: Transferring and Probing the Reasoning Mechanisms of LLMs 引用了 Language Models are Few-Shot Learners
- In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steering 引用了 Language Models are Few-Shot Learners
- A Survey on In-context Learning 引用了 Data Distributional Properties Drive Emergent In-Context Learning in Transformers
- A Survey on In-context Learning 引用了 Language Models are Few-Shot Learners
- Localizing Task Recognition and Task Learning in In-Context Learning via Attention Head Analysis 引用了 In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steering
- Localizing Task Recognition and Task Learning in In-Context Learning via Attention Head Analysis 引用了 A Survey on In-context Learning
- Localizing Task Recognition and Task Learning in In-Context Learning via Attention Head Analysis 引用了 Language Models are Few-Shot Learners
- HiFICL: High-Fidelity In-Context Learning for Multimodal Tasks 引用了 A Survey on In-context Learning
- Task Vectors, Learned Not Extracted: Performance Gains and Mechanistic Insights 引用了 In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steering
- Task Vectors, Learned Not Extracted: Performance Gains and Mechanistic Insights 引用了 A Survey on In-context Learning
- Task Vectors, Learned Not Extracted: Performance Gains and Mechanistic Insights 引用了 Language Models are Few-Shot Learners
- Mechanism of Task-oriented Information Removal in In-context Learning 引用了 Data Distributional Properties Drive Emergent In-Context Learning in Transformers
引用它的顶会 Paper5
- CoT Vectors: Transferring and Probing the Reasoning Mechanisms of LLMsLi Li, Ziyi Wang, Yongliang Wu, Jianfei Cai 等ICLR 2026 · 4 次引用
- Mechanism of Task-oriented Information Removal in In-context LearningHakaze Cho, Haolin Yang, Gouki Minegishi, Naoya InoueICLR 2026 · 3 次引用
- Localizing Task Recognition and Task Learning in In-Context Learning via Attention Head AnalysisHaolin Yang, Hakaze Cho, Naoya InoueICLR 2026 · 2 次引用
- HiFICL: High-Fidelity In-Context Learning for Multimodal TasksXiaoyu Li, Yuhang Liu, xuanshuo kang, zheng luo 等CVPR 2026 · 1 次引用
- Task Vectors, Learned Not Extracted: Performance Gains and Mechanistic InsightsHaolin Yang, Hakaze Cho, Kaize Ding, Naoya InoueICLR 2026
它引用的 Paper19
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- A Survey on In-context LearningQingxiu Dong, Lei Li, Damai Dai, Ce Zheng 等EMNLP 2024 · 479 次引用
- Data Distributional Properties Drive Emergent In-Context Learning in TransformersStephanie C. Y. Chan, Adam Santoro, Andrew K. Lampinen, Jane X. Wang 等NeurIPS 2022 · 407 次引用
- Language Models Represent Space and TimeWes Gurnee, Max TegmarkICLR 2024 · 303 次引用
- In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space SteeringSheng Liu, Haotian Ye, Lei Xing, James Y. ZouICML 2024 · 244 次引用
相关 Paper
- Which Attention Heads Matter for In-Context Learning?Kayo Yin, Jacob SteinhardtICML 2025
- Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in TransformersSiyu Chen, Heejune Sheen, Tianhao Wang, Zhuoran YangNeurIPS 2024 · 48 次引用
- In-Context Learning Creates Task VectorsRoee Hendel, Mor Geva, Amir GlobersonEMNLP Findings 2023 · 43 次引用
- Beyond Induction Heads: In-Context Meta Learning Induces Multi-Phase Circuit EmergenceGouki Minegishi, Hiroki Furuta, Shohei Taniguchi, Yusuke Iwasawa 等ICML 2025
- How do Large Language Models Learn In-Context? Query and Key Matrices of In-Context Heads are Two Towers for Metric LearningZeping Yu, Sophia AnaniadouEMNLP 2024 · 2 次引用
