arXiv:2605.20730cs.CLcs.AI2026-05

用分布对齐优化任务向量,提升上下文学习效率与效果

Distributional Alignment as a Criterion for Designing Task Vectors in In-Context Learning

论文配图:Distributional Alignment as a Criterion for Designing Task Vectors in In-Context Learning
图 1 · 摘自论文原文
  • 以预测分布一致性为目标设计任务向量提取方法
  • 在8个分类任务上平均提升准确率9.2%,加速推理
  • 可跨模型规模迁移,大模型向量能提升小模型性能

上下文学习(ICL)使大语言模型通过示例适应新任务,但上下文过长导致推理成本上升。任务向量将示例压缩为紧凑的隐状态表示,但其质量仅通过下游任务准确率评估,难以指导优化。本文提出,任务向量推理应使其下一词概率分布与ICL一致。为此引入$d_{\text{NTP}}$,量化两者在下一词概率上的差异。实验表明,$d_{\text{NTP}}$与下游准确率呈强负相关,可作为性能代理指标。基于此,我们提出线性任务向量(LTV),通过闭式线性映射回归示例影响,最小化$d_{\text{NTP}}$。在8个分类基准和5个LLM上,LTV平均准确率提升9.2%,推理延迟降低。还证明其在回归任务中优于基线。进一步发现,大模型提取的任务向量可使小模型性能提升6.4%,拓展了任务表示的迁移应用。

原文摘要 · Abstract (English)

In-context learning (ICL) allows large language models (LLMs) to adapt to new tasks through demonstrations, yet it suffers from escalating inference costs as context length increases. While task vectors offer a promising alternative by compressing demonstrations into compact hidden-state representations, their quality has been evaluated only through downstream task accuracy. This indirect criterion provides limited insight into how to design more effective task vector extraction methods. In this paper, we posit that inference using task vectors should align their predictive distribution with that of ICL. To quantify this, we introduce $d_{\text{NTP}}$, a metric that measures the discrepancy in next-token probabilities between task vector-based and ICL-based inference. Our empirical analysis reveals that $d_{\text{NTP}}$ serves as a performance proxy, exhibiting a strong negative correlation with downstream accuracy. Motivated by this, we develop Linear Task Vector (LTV), a method designed to minimize $d_{\text{NTP}}$ via a closed-form linear mapping that estimates demonstration effects through regression. Across eight classification benchmarks and five LLMs, LTV consistently outperforms existing task vector baselines, improving average accuracy by 9.2\% while reducing inference latency. We further show that LTV outperforms the baselines on regression tasks. Moreover, we investigate the transferability of LTV across different model scales; an aspect that has remained nascent in task vector research. Specifically, we empirically show that task vectors from a larger model can enhance a smaller model's performance by 6.4\%, suggesting a new utility for extracted task representations.

任务向量上下文学习分布对齐模型压缩

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。