arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.11129cs.CL
收藏

DeCoVec:通过上下文学习构建基于解码空间的任务向量以指导大语言模型

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

College of Computer Science and Software Engineering, Shenzhen University(深圳大学计算机与软件学院)

Feiyang Li, Yile Wang

AI总结:

DeCoVec通过上下文学习在解码空间中构建任务向量,无需微调或侵入性操作,有效提升大语言模型性能,实验显示在多个数据集上优于基线方法。

摘要:

任务向量,代表模型或激活空间中的方向,编码任务特定行为,已成为指导大语言模型(LLMs)的有前景工具。然而,现有方法通常需要微调或侵入性操作内部状态,限制了其灵活性和可扩展性。我们提出DeCoVec(基于解码空间的任务向量),一种无需训练且非侵入性的框架,通过利用上下文学习(ICL)在解码空间中直接构建任务向量。具体而言,DeCoVec将任务本质视为少量示例提示和零示例提示输出logit分布的差异,然后通过将此向量注入解码过程来引导生成。在TruthfulQA、Math-500和AQUA-RAT上对七种LLM(0.5B-9B)的实验表明,DeCoVec在多个数据集上一致优于标准少样本基线,平均准确率提升高达+5.50。进一步分析显示,DeCoVec有效抑制生成退化和逻辑错误,同时在演示顺序方面表现出强鲁棒性,且不增加额外输入token成本。我们的方法提供了一种无需训练和侵入性的LLM引导解决方案,无需权重更新或辅助模型。

英文摘要:

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 \textsc{DeCoVec} (Decoding Space based Task Vector), a training-free and non-invasive framework that constructs task vectors directly in the \textit{decoding space} by leveraging in-context learning (ICL). Specifically, \textsc{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 \textsc{DeCoVec} consistently outperforms standard few-shot baselines, with gains up to +5.50 average accuracy. Further analysis demonstrates that \textsc{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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑