Introduction
In-Context Learning (ICL) has emerged as a cornerstone of Large Language Model (LLM) utility, allowing models to adapt to new tasks via a few demonstrations without parameter updates. A prominent hypothesis in mechanistic interpretability suggests that LLMs perform ICL by compressing these demonstrations into a single hidden state activation—a "task vector"—which serves as an internal instruction. While this theory holds for simple linear transformations, its validity across complex, multi-faceted tasks remains largely untested. This paper introduces QUITEAFEW, a large-scale benchmark, to investigate the limits of the task vector hypothesis.
The QUITEAFEW Benchmark
To move beyond the "toy" benchmarks typical of previous studies (often limited to 10–40 tasks), the authors developed QUITEAFEW. Derived from the Alpaca dataset, this benchmark comprises 3,096 diverse tasks, each containing 30 unique input-output pairs. Tasks range from simple linguistic transformations (e.g., "Rewrite in the imperative") to complex structural generations (e.g., "Generate a specific JSON object"). This scale allows for a statistically robust analysis of how task complexity affects the efficacy of internal representations.
Methodology: Causal Intervention
The study employs a causal intervention framework to isolate and test task vectors:
- Extraction: A "few-shot" prompt is processed, and the hidden state activation of the final token is captured at a specific layer. This is the candidate Task Vector.
- Injection: This vector is then forcibly injected into the processing of a "zero-shot" query (one without examples) at the same layer.
- Evaluation: Outputs are graded by an LLM-based judge (Qwen-2.5-72B) on a 0–10 scale for both format adherence and correctness.
The "Goldilocks" Layer
A critical finding is the existence of a "Goldilocks" layer where task vector performance peaks. For Llama-3-8B, this consistently occurs around the 15th layer. This suggests a functional division within the model: the initial layers focus on task comprehension and extraction, while the latter layers handle response generation. The middle layers represent the point where the "instruction" is most purely encoded.
Performance and Task Complexity
The efficacy of task vectors is highly sensitive to task type. While "Region 1" tasks (simple translations or classifications) show significant improvement with vector injection, "Region 2" tasks (complex analysis or multi-step reasoning) often show negligible gains or even performance degradation.
Comparing the distributions of marks across different regimes reveals that while task vectors improve upon zero-shot performance, they still fall significantly short of full few-shot learning. This gap suggests that a single vector cannot capture the full nuance of complex instructions.
Beyond Single Vectors: Sub-Task Composition
The most striking revelation is that for complex tasks, such as generating JSON schemas, a single vector is insufficient. The model appears to rely on a distributed, compositional representation. In experiments with JSON generation, using "Sub-Task Vectors"—injecting specific states at different points in the output sequence—nearly doubled the probability of correct token prediction compared to the classic single-vector approach.
Conclusion
The "one task vector" theory is a useful but incomplete model of ICL. While middle-layer activations can capture the essence of simple tasks, complex reasoning and structural formatting require a more distributed mechanism. Future research should pivot from searching for a single "magic vector" toward understanding how LLMs compose multiple, distributed activations to solve sophisticated problems.
Summary updated