The Atlas of In-Context Learning: How Attention Heads Shape In-Context Retrieval Augmentation
Patrick Kahardipraja, Reduan Achtibat, Thomas Wiegand, Wojciech Samek, Sebastian Lapuschkin
摘要
Large language models are able to exploit in-context learning to access external knowledge beyond their training data through retrieval-augmentation. While promising, its inner workings remain unclear. In this work, we shed light on the mechanism of in-context retrieval augmentation for question answering by viewing a prompt as a composition of informational components. We propose an attributionbased method to identify specialized attention heads, revealing in-context heads that comprehend instructions and retrieve relevant contextual information, and parametric heads that store entities' relational knowledge. To better understand their roles, we extract function vectors and modify their attention weights to show how they can influence the answer generation process. Finally, we leverage the gained insights to trace the sources of knowledge used during inference, paving the way towards more safe and transparent language models.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 7 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Unifying Attention Heads and Task Vectors via Hidden State Geometry in In-Context Learning 引用了 Language Models are Few-Shot Learners
- Localizing Task Recognition and Task Learning in In-Context Learning via Attention Head Analysis 引用了 Unifying Attention Heads and Task Vectors via Hidden State Geometry in In-Context Learning
- Localizing Task Recognition and Task Learning in In-Context Learning via Attention Head Analysis 引用了 Language Models are Few-Shot Learners
- Language Models are Few-Shot Learners 引用了 Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
- Finetuned Language Models are Zero-Shot Learners 引用了 Language Models are Few-Shot Learners
- Finetuned Language Models are Zero-Shot Learners 引用了 Training language models to follow instructions with human feedback
- Training language models to follow instructions with human feedback 引用了 Finetuned Language Models are Zero-Shot Learners
- Training language models to follow instructions with human feedback 引用了 Language Models are Few-Shot Learners
- Attribution-Guided Decoding 引用了 Language Models are Few-Shot Learners
- Attribution-Guided Decoding 引用了 Finetuned Language Models are Zero-Shot Learners
- Attribution-Guided Decoding 引用了 Training language models to follow instructions with human feedback
引用它的顶会 Paper7
- Unifying Attention Heads and Task Vectors via Hidden State Geometry in In-Context LearningHaolin Yang, Hakaze Cho, Yiqiao Zhong, Naoya InoueNeurIPS 2025 · 11 次引用
- Large Vision-Language Models Get Lost in AttentionGongli Xi, Ye Tian, Mengyu Yang, Huahui Yi 等ICML 2026 · 4 次引用
- Localizing Task Recognition and Task Learning in In-Context Learning via Attention Head AnalysisHaolin Yang, Hakaze Cho, Naoya InoueICLR 2026 · 2 次引用
- Attribution-Guided DecodingPiotr Komorowski, Elena Golimblevskaia, Reduan Achtibat, Thomas Wiegand 等ICLR 2026 · 1 次引用
- Provable In-Context Vector Arithmetic via Retrieving Task ConceptsDake Bu, Wei Huang, Andi Han, Atsushi Nitanda 等ICML 2025
它引用的 Paper46
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksPatrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni 等NeurIPS 2020 · 19,162 次引用
- Finetuned Language Models are Zero-Shot LearnersJason Wei, Maarten Bosma, Vincent Y. Zhao, Kelvin Guu 等ICLR 2022 · 4,966 次引用
- Retrieval Augmented Language Model Pre-TrainingKelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat 等ICML 2020 · 2,937 次引用
相关 Paper
- Retrieval Head Mechanistically Explains Long-Context FactualityWenhao Wu, Yizhong Wang, Guangxuan Xiao, Hao Peng 等ICLR 2025
- Cognitive Mirrors: Exploring the Diverse Functional Roles of Attention Heads in LLM ReasoningXueqi Ma, Jun Wang, Yanbei Jiang, Sarah M. Erfani 等NeurIPS 2025 · 5 次引用
- Retrieval Heads are DynamicYuping Lin, Zitao Li, Yue Xing, Pengfei He 等ACL 2026
- Understanding Parametric and Contextual Knowledge Reconciliation within Large Language ModelsJun Zhao, Yongzhuo Yang, Xiang Hu, Jingqi Tong 等NeurIPS 2025 · 10 次引用
- DeCoRe: Decoding by Contrasting Retrieval Heads to Mitigate HallucinationsAryo Pradipta Gema, Chen Jin, Ahmed Abdulaal, Tom Diethe 等EMNLP Findings 2025 · 2 次引用
