Introduction
Large Language Models (LLMs) possess the remarkable capability of In-Context Learning (ICL), allowing them to perform new tasks by observing a few examples within a prompt. Recent advancements have shown that these examples can be compressed into "task vectors"—compact representations derived from the model's hidden states. These vectors can be injected into new prompts to execute tasks without the original demonstrations, significantly reducing inference costs. However, the theoretical basis for their formation and their inherent limitations have remained largely unexplored. This paper introduces the Linear Combination Conjecture, providing a rigorous framework to understand task vectors as weighted sums of original demonstrations.
Theoretical Foundations: The Linear Combination Conjecture
The researchers employ a two-pronged approach, starting with a theoretical analysis of Linear-Attention Transformers trained on synthetic linear regression. By examining the loss landscape, they mathematically prove that task vectors emerge as linear combinations of the demonstration examples.
A key insight from this analysis is the role of redundancy. The model learns to store the "essence" of a task within specific intermediate tokens—often the separator tokens like the arrow (->)—as a defense mechanism against information loss during training (e.g., via dropout). This ensures that the model can still function even if specific example tokens are missing from the context. Theoretically, the first layer of a transformer acts to concatenate inputs, while subsequent layers perform a variant of internal gradient descent, with task vectors serving as the hidden states that facilitate this optimization.
Empirical Validation and the Rank-One Limitation
To test these theories in real-world scenarios, the authors evaluated models like Llama-7B, Llama-13B, and Pythia-12B across 33 tasks spanning knowledge retrieval, algorithmic logic, translation, and linguistics.
Visualization through saliency maps confirms the linear combination theory: in practical LLMs, the final separator token attends broadly to all preceding examples right before the optimal layer for task vector extraction. This confirms that the model is indeed aggregating information from the entire demonstration set into a unified vector.
However, this compression comes with a significant cost: the Rank-One Limitation. A single task vector acts as a rank-one meta-predictor. While this is sufficient for simple "A always maps to B" rules, it fails on complex structures like Bijection Tasks. For example, in a prompt requiring both "to uppercase" and "to lowercase" conversions (e.g., a -> A, B -> b), standard ICL achieves 100% accuracy by utilizing the full context. In contrast, the single task vector method plummets to roughly 55% accuracy, as it cannot represent the dual-mapping logic within a single rank-one vector.
Enhancing Performance with TaskV-M
Recognizing the limitations of single-vector compression, the authors propose TaskV-M, an enhanced method that injects multiple task vectors into a prompt. This approach allows the model to capture more complex task structures that a single vector would otherwise collapse.
Experimental results demonstrate the superiority of TaskV-M. In 4-shot scenarios using Llama-13B, TaskV-M improved average accuracy across benchmarks from 84.66% to 85.64%. The gains were most pronounced in the difficult bijection tasks, where accuracy rose from 70.44% to 72.53%, proving that multi-vector representations can partially bridge the gap between compressed task vectors and full-scale In-Context Learning.
Conclusion
This research moves the study of task vectors from empirical observation to theoretical understanding. By identifying the Linear Combination Conjecture and the rank-one bottleneck, the authors provide a clear explanation for why task vectors succeed on simple tasks but fail on complex ones. While TaskV-M offers a path toward more expressive compressed representations, future work is needed to determine if these mechanisms can eventually match the full power of many-shot ICL in non-linear, deep transformer architectures.
Summary updated