mlsanityData to 14 Oct 2026

How Few-Shot Examples Add Up: A Causal Decomposition of Function Vectors in In-Context Learning

arXiv 2605.16591 ↗First posted 15 May 2026cs.LG cs.AIcited by 0

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

  1. 2022In-context Learning and Induction Headscited by 964
  2. 2023Larger language models do in-context learning differentlycited by 394
  3. 2025Softmax ≥ Linear: Transformers may learn to classify in-context by kernel gradient descentcited by 4

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2022Can In-context Learners Learn a Reasoning Concept from Demonstrations?
  2. 2025Is In-Context Learning Learning?
  3. 2024Does In-Context Learning Really Learn? Rethinking How Large Language Models Respond and Solve Tasks via In-Context Learning
  4. 2026When Correct Demonstrations Hurt: Rethinking the Role of Exemplars in In-Context Learning
  5. 2023Is attention required for ICL? Exploring the Relationship Between Model Architecture and In-Context Learning Ability
  6. 2026The Alchemy of Thought: Understanding In-Context Learning Through Supervised Classification
  7. 2026In-Context Learning Can Help Vision-Language Models Overcome Training Priors
  8. 2024Many-Shot In-Context Learning