DeCoVec: Building Decoding Space based Task Vector for Large Language Models via In-Context Learning

Feiyang Li, Yile Wang


Abstract
Task vectors, representing directions in model or activation spaces that encode task-specific behaviors, have emerged as a promising tool for steering large language models (LLMs). However, existing approaches typically require fine-tuning or invasive manipulation of internal states, limiting their flexibility and scalability. We propose DeCoVec (Decoding Space based Task Vector), a training-free and non-invasive framework that constructs task vectors directly in the decoding space by leveraging in-context learning (ICL). Specifically, DeCoVec captures the task essence as the difference between the output logit distributions of few-shot and zero-shot prompts, then steers generation by injecting this vector into the decoding process. Experiments across seven LLMs (0.5B–9B) on TruthfulQA, Math-500, and AQUA-RAT show that DeCoVec consistently outperforms standard few-shot baselines, with gains up to +5.50 average accuracy. Further analysis demonstrates that DeCoVec effectively suppresses generation degeneration and logical flaws while exhibiting strong robustness to demonstration ordering, all without incurring additional input token costs. Our method offers a training-free and non-invasive solution for LLM steering without requiring weight updates or auxiliary models.
Anthology ID:
2026.findings-acl.953
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:
19096–19111
Language:
URL:
https://preview.aclanthology.org/ingest-acl/2026.findings-acl.953/
DOI:
Bibkey:
Cite (ACL):
Feiyang Li and Yile Wang. 2026. DeCoVec: Building Decoding Space based Task Vector for Large Language Models via In-Context Learning. In Findings of the Association for Computational Linguistics: ACL 2026, pages 19096–19111, San Diego, California, United States. Association for Computational Linguistics.
Cite (Informal):
DeCoVec: Building Decoding Space based Task Vector for Large Language Models via In-Context Learning (Li & Wang, Findings 2026)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-acl/2026.findings-acl.953.pdf
Checklist:
 2026.findings-acl.953.checklist.pdf