How Few-Shot Examples Add Up: A Causal Decomposition of Function Vectors in In-Context Learning
Pith reviewed 2026-06-30 19:04 UTC · model grok-4.3
The pith
An n-shot function vector is well-approximated by a linear combination of example-level sub-vectors, with attention reweighting that favors informative demonstrations.
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
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, 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. 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
What carries the argument
The function vector (FV), a causal activation direction that drives task behavior on the ICL query, together with its decomposition into per-example sub-FVs and the attention-based reweighting that modulates their sum.
If this is right
- Individual demonstrations contribute additively to the overall task direction extracted by the model.
- Attention reweighting allows the model to emphasize clearer or more diagnostic examples once the full prompt context is available.
- Query-key alignment supplies the most reliable improvement to FV quality when examples are ambiguous.
- Value updates produce more variable and task-dependent changes to the resulting function vector.
Where Pith is reading between the lines
- Prompt construction strategies could prioritize example clarity and ordering to maximize the additive signal rather than relying on emergent synergies.
- The same decomposition could be tested on non-classification tasks to check whether additivity persists when the output space is structured differently.
- If the linear approximation holds, one could predict the quality of an n-shot prompt from measurements on its constituent single-example prompts alone.
- The separation of query-key and value effects offers a concrete target for interventions that aim to improve few-shot performance without retraining.
Load-bearing premise
The function vector identified by causal interventions remains a stable task-driving direction whose linear decomposition and attention effects hold across tasks, models, and prompt formats without large higher-order interactions.
What would settle it
A systematic measurement across many tasks showing that the residual norm between the observed n-shot FV and the linear sum of the individual example sub-FVs stays large would falsify the additivity claim.
Figures
read the original abstract
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.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper claims that n-shot function vectors (FVs) in in-context learning are well-approximated by linear combinations of example-level sub-FVs, that models contextually reweight individual examples via attention based on prior context, and that a causal decomposition isolating Query-Key routing from Value updates shows Query-Key alignment (especially in ambiguous cases) as the dominant contributor to contextualization effects on FV quality.
Significance. If the linear decomposition, reweighting effects, and causal separation hold with the reported consistency across tasks and models, the results would unify additive superposition accounts of ICL with context-dependent attention mechanisms into a single mechanistic framework, offering testable predictions about how demonstrations contribute to task behavior.
minor comments (2)
- [Abstract] Abstract: the phrase 'across tasks and models' is used without enumerating the specific tasks, models, or prompt formats tested; adding this list would improve clarity and allow readers to assess the scope immediately.
- The term 'FV quality' is used in the final sentence without an explicit operational definition or metric; a brief parenthetical or reference to the relevant evaluation section would resolve ambiguity.
Simulated Author's Rebuttal
We thank the referee for their positive assessment of our work and the recommendation of minor revision. The referee's summary accurately reflects the paper's core claims on the linear decomposition of n-shot function vectors, attention-based reweighting of examples, and the causal isolation of Query-Key versus Value contributions.
Circularity Check
No significant circularity in derivation chain
full rationale
The provided abstract and reader summary describe empirical approximations (linear combination of sub-FVs) and causal interventions separating Query-Key from Value effects. No equations, fitted parameters, or self-citations are quoted that reduce any claimed prediction or decomposition to a definition or input by construction. The central claims rest on observable attention shifts and intervention results rather than self-referential fitting or imported uniqueness theorems. This is the expected non-finding for a paper whose internal logic does not collapse to its own inputs.
Axiom & Free-Parameter Ledger
Reference graph
Works this paper leans on
-
[1]
URL https://arxiv.org/abs/2510.1 0425. Elhage, N., Nanda, N., Olsson, C., Henighan, T., Joseph, N., Mann, B., Askell, A., Bai, Y ., Chen, A., Conerly, T., et al. A mathematical framework for transformer circuits. Transformer Circuits Thread, 2021. URL https://tr ansformer-circuits.pub/2021/framework /index.html. Gu, Z., Zou, H. P., Liu, A., Chen, Y ., Zha...
-
[2]
URL https://openreview.net/forum ?id=w7LU2s14kE. Jiang, G., Jiang, C., Li, Z., Xue, S., Zhou, J., Song, L., Lian, D., and Wei, Y . Unlocking the power of function vectors for characterizing and mitigating catastrophic forgetting in continual instruction tuning. InThe Thirteenth Inter- national Conference on Learning Representations, ICLR 2025, Singapore, ...
-
[3]
Min, S., Lyu, X., Holtzman, A., Artetxe, M., Lewis, M., Hajishirzi, H., and Zettlemoyer, L
URL https://openreview.net/pdf?i d=8p3fu56lKc. Min, S., Lyu, X., Holtzman, A., Artetxe, M., Lewis, M., Hajishirzi, H., and Zettlemoyer, L. Rethinking the role of demonstrations: What makes in-context learning work? InProceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, EMNLP 2022, Abu Dhabi, United Arab Emirates, Decembe...
2022
-
[4]
In-context Learning and Induction Heads
URL https://aclanthology.org/2022. emnlp-main.759/. Nguyen, K. A., im Walde, S. S., and Vu, N. T. Distin- guishing antonyms and synonyms in a pattern-based neural network. InEACL (1), pp. 76–85. Association for Computational Linguistics, 2017. URL https: //aclanthology.org/E17-1008/. Olsson, C., Elhage, N., Nanda, N., Joseph, N., DasSarma, N., Henighan, T...
work page internal anchor Pith review Pith/arXiv arXiv doi:10.18653/v1/2024.emnlp-main.192 2022
-
[5]
Zhou, H., Bradley, A., Littwin, E., Razin, N., Saremi, O., Susskind, J
URL https://openreview.net/forum ?id=WZH7099tgfM. Zhou, H., Bradley, A., Littwin, E., Razin, N., Saremi, O., Susskind, J. M., Bengio, S., and Nakkiran, P. What algorithms can transformers learn? a study in length generalization. InThe Twelfth International Conference on Learning Representations, 2024. URL https:// proceedings.iclr.cc/paper_files/pape r/20...
2024
-
[6]
Why are the findings about linear superposition in Section 3 then nontrivial? Conditioned on fixed attention weights, each head output is linear in V
The function vector is the output of attention, which by definition is a linear combination. Why are the findings about linear superposition in Section 3 then nontrivial? Conditioned on fixed attention weights, each head output is linear in V . But the weights themselves areprompt- dependentnonlinear functions via softmax(QK ⊤), and Q is produced by multi...
-
[7]
on normal datasets, we do not observe a single universal alignment driver
The task suite is restricted to classification-style mappings, failing to represent complex behaviors like creative generation or complex algorithmic tasks. We follow relevant prior work to focus on short-horizon, discrete mappings because their computational cost is desirable, and ambiguity can be introduced in a controlled way. We agree that open-ended ...
-
[8]
The attention outputPn i=1 ai ·ψ(x i, yi) can be viewed as a FV , in thatϕ(xn+1,·)evaluates the task for other queriesx n+1 as well
For unambiguous examples, ψ(x, y) only depends on the task. The attention outputPn i=1 ai ·ψ(x i, yi) can be viewed as a FV , in thatϕ(xn+1,·)evaluates the task for other queriesx n+1 as well
-
[9]
better than chance performance
Whenever a prompt has both ambiguous and unambiguous examples, attention is lower on the ambiguous examples than the unambiguous examples. Here, by “better than chance performance” we rule out solutions where regularization is so strong that the optimal solution provides a constant answerϕ(·). 2Allowing infinite attention logits is an idealizing assumptio...
2024
-
[10]
Write u:=ϕ A(xn+1), v:=ϕ B(xn+1), and, without loss of generality, assumeF A(xn+1) = 1andF B(xn+1) =−1
For any unambiguous ICL query xn+1, we have {FA(xn+1), FB(xn+1)}={−1,1} . Write u:=ϕ A(xn+1), v:=ϕ B(xn+1), and, without loss of generality, assumeF A(xn+1) = 1andF B(xn+1) =−1. Define m:= u+v 2 , s:= u−v 2 . 68 How Few-Shot Examples Add Up Then (u−1) 2 + (v+ 1) 2 2 =m 2 + (s−1) 2. By (8), we have|s| ≤L √ S. Therefore, (u−1) 2 + (v+ 1) 2 2 ≥inf |s|≤L √ S ...
-
[11]
for unambiguous examples,ψ(x i, yi)depends only on the task 2.ψ pA =−ψ pB 3.ϕis linear on the line betweenψ pA andψ pB
-
[12]
First, for any choice of S:= max x,y ∥ψ(x, y)∥2 2 and L, there is a model satisfying 1–4 that makes (6), (8), and (9) tight
in prompts containing both ambiguous and unambiguous examples, attention is zero on the ambiguous examples We want to show that any global optimum that has above-chance performance must satisfy these features. First, for any choice of S:= max x,y ∥ψ(x, y)∥2 2 and L, there is a model satisfying 1–4 that makes (6), (8), and (9) tight. Take ψA to be any vect...
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.