Label Words as Local Task Vectors in In-Context Learning

Bowen Zheng, Ming Ma, Zhongqiao Lin, Tianming Yang


Abstract
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.
Anthology ID:
2026.findings-acl.314
Volume:
Findings of the Association for Computational Linguistics: ACL 2026
Month:
July
Year:
2026
Address:
San Diego, California, United States
Editors:
Maria Liakata, Viviane P. Moreira, Jiajun Zhang, David Jurgens
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
6319–6332
Language:
URL:
https://preview.aclanthology.org/ingest-acl/2026.findings-acl.314/
DOI:
Bibkey:
Cite (ACL):
Bowen Zheng, Ming Ma, Zhongqiao Lin, and Tianming Yang. 2026. Label Words as Local Task Vectors in In-Context Learning. In Findings of the Association for Computational Linguistics: ACL 2026, pages 6319–6332, San Diego, California, United States. Association for Computational Linguistics.
Cite (Informal):
Label Words as Local Task Vectors in In-Context Learning (Zheng et al., Findings 2026)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-acl/2026.findings-acl.314.pdf
Checklist:
 2026.findings-acl.314.checklist.pdf