The Atlas of In-Context Learning: How Attention Heads Shape In-Context Retrieval Augmentation
Kahardipraja, Patrick, Achtibat, Reduan, Wiegand, Thomas, Samek, Wojciech, Lapuschkin, Sebastian
–arXiv.org Artificial Intelligence
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 attribution-based 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.
arXiv.org Artificial Intelligence
Oct-28-2025
- Country:
- Africa (0.04)
- Asia
- China > Hong Kong (0.04)
- Indonesia > Bali (0.04)
- Middle East
- Republic of Türkiye > Istanbul Province
- Istanbul (0.04)
- UAE > Abu Dhabi Emirate
- Abu Dhabi (0.04)
- Republic of Türkiye > Istanbul Province
- Singapore (0.04)
- Thailand
- Uzbekistan > Toshkent Shahri
- Tashkent (0.04)
- Europe
- Belgium > Brussels-Capital Region
- Brussels (0.04)
- Finland > Uusimaa
- Helsinki (0.04)
- Ireland > Leinster
- County Dublin > Dublin (0.04)
- Italy > Tuscany
- Florence (0.04)
- Middle East > Republic of Türkiye
- Istanbul Province > Istanbul (0.04)
- Netherlands > Gelderland
- Nijmegen (0.04)
- Spain > Galicia
- Madrid (0.04)
- United Kingdom
- England > Oxfordshire
- Oxford (0.04)
- Wales (0.04)
- England > Oxfordshire
- Belgium > Brussels-Capital Region
- North America
- Canada > Ontario
- Toronto (0.04)
- Dominican Republic (0.04)
- United States
- California > Monterey County
- Salinas (0.04)
- Florida > Miami-Dade County
- Miami (0.04)
- Illinois > Cook County
- Chicago (0.04)
- Indiana (0.04)
- Minnesota > Hennepin County
- Minneapolis (0.14)
- New Mexico > Bernalillo County
- Albuquerque (0.04)
- California > Monterey County
- Canada > Ontario
- South America
- Genre:
- Research Report (1.00)
- Industry:
- Leisure & Entertainment (1.00)
- Media
- Music (0.67)
- Television (0.46)
- Technology: