How Few-Shot Examples Add Up: A Causal Decomposition of Function Vectors in In-Context Learning
Abstract
Lay Summary
Large language models can often learn what to do from just a few examples in the prompt, without being retrained. But it is still unclear how the model combines those examples internally, especially when some examples are more helpful than others. We study this process by looking inside the model while it performs simple few-shot tasks. We find that each example contributes a small “task signal,” and the model’s overall understanding of the task is approximately built by adding these signals together. However, the model does not treat all examples equally. When some examples clearly reveal the intended task, and others are ambiguous, the model learns to focus more on the clearer examples. These findings help explain why a few well-chosen examples can strongly guide a language model, and why unclear or misleading examples may have less influence than expected.