Label Words as Local Task Vectors in In-Context Learning
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have demonstrated remarkable abilities, one of the most important being in-context learning (ICL). With ICL, LLMs can derive the underlying rule from a few demonstrations and provide answers that comply with the rule. Previous work hypothesized that the network creates a task vector in specific positions during ICL. The task vector can be computed by averaging across the dataset. It conveys the overall task information and can thus be considered global. Patching the global task vector allows LLMs to achieve zero-shot performance with dummy inputs comparable to few-shot learning. However, we find that such a global task vector does not exist in all tasks, especially in tasks that rely on rules that can only be inferred from multiple demonstrations, such as categorization tasks. Instead, the information provided by each demonstration is first transmitted to its answer position and forms a local task vector associated with the demonstration. In some tasks but not in categorization tasks, all demonstrations' local task vectors converge in later layers, forming the global task vector. We further show that local task vectors encode a high-level abstraction of rules extracted from the demonstrations. Our study provides novel insights into the mechanism underlying ICL in LLMs, demonstrating how ICL may be achieved through an information aggregation mechanism.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 19 of its 40 references that are in the map. First posted on arXiv 23 Jun 2024.
Builds on
19 of 40 references.
References · 19
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,769
- 2013Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Mapscited by 2,348
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2019Are Sixteen Heads Really Better than One?cited by 803
- 2022A Survey on In-context Learningcited by 717
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2022Using cognitive psychology to understand GPT-3cited by 389
- 2023In-Context Learning Creates Task Vectorscited by 302
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
7 more
- 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 240
- 2023Label Words are Anchors: An Information Flow Perspective for Understanding In-Context Learningcited by 235
- 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
- 2023In-Context Learning through the Bayesian Prismcited by 78
- 2018Analyzing biological and artificial neural networks: challenges with opportunities for synergy?cited by 20
- 2014Demixed principal component analysis of population activity in higher cortical areas reveals independent representation of task parameterscited by 15
- 2024In-Context Learning State Vector with Inner and Momentum Optimizationcited by 15
Built on by
Citing papers per year: 2024: 1; 2025: 2.
3 papers.