How Few-Shot Examples Add Up: A Causal Decomposition of Function Vectors in In-Context Learning
Not on the map. Why?
Abstract (arXiv)
In-context learning (ICL) excels at new tasks from minimal examples, yet we still lack a mechanistic explanation of how few-shot prompts shape a model's function vector (FV)--a causal activation direction that drives task behavior on the ICL query. Across tasks and models, an n-shot FV is well-approximated by a linear combination of example-level sub-FVs, suggesting additive and composable contributions from individual demonstrations. Beyond additivity, we show that models contextualize individual examples' representations based on prior examples to adaptively reweight which demonstrations dominate the FV: attention shifts toward examples that are more informative and less ambiguous under the context. Finally, a causal decomposition separates Query-Key routing from Value updates, finding that contextualization's most consistent contributions to FV quality arise from Query-Key alignment--particularly in ambiguous settings--while Value-mediated effects are more heterogeneous. Together, these results unify additive superposition with context-dependent attention reweighting into a mechanistic, testable account of how few-shot prompts implement tasks.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 3 of its 39 references that are in the map. First posted on arXiv 15 May 2026.
Builds on
3 of 39 references.
References · 3
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2022Can In-context Learners Learn a Reasoning Concept from Demonstrations?
- 2025Is In-Context Learning Learning?
- 2024Does In-Context Learning Really Learn? Rethinking How Large Language Models Respond and Solve Tasks via In-Context Learning
- 2026When Correct Demonstrations Hurt: Rethinking the Role of Exemplars in In-Context Learning
- 2023Is attention required for ICL? Exploring the Relationship Between Model Architecture and In-Context Learning Ability
- 2026The Alchemy of Thought: Understanding In-Context Learning Through Supervised Classification
- 2026In-Context Learning Can Help Vision-Language Models Overcome Training Priors
- 2024Many-Shot In-Context Learning