arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.20730cs.CLcs.AI
收藏

分布对齐作为设计任务向量在上下文学习中的准则

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

Seoul National University(首尔国立大学);Yonsei University(延世大学)

Jihoon Kwon, Jiwon Choi, Jy-yong Sohn

AI总结:

本文提出通过分布对齐来设计任务向量,引入了NTP距离作为衡量指标,并开发了线性任务向量方法以提升性能和效率。

摘要:

在上下文学习(ICL)中,大型语言模型(LLMs)通过演示来适应新任务,但随着上下文长度增加,推理成本也随之上升。虽然任务向量通过压缩演示为紧凑的隐藏状态表示提供了有前途的替代方案,但其质量只能通过下游任务准确性来评估。本文认为,使用任务向量的推理应使其预测分布与ICL的预测分布对齐。为此,我们引入了$d_{ ext{NTP}}$,一个衡量任务向量推理与ICL推理之间下一个标记概率差异的指标。我们的实证分析表明,$d_{ ext{NTP}}$作为性能代理,与下游准确性呈强负相关。受此启发,我们开发了线性任务向量(LTV)方法,通过闭合形式的线性映射来最小化$d_{ ext{NTP}}$,通过回归估计演示效果。在八个分类基准和五个LLMs上,LTV一致优于现有任务向量基线,平均准确率提高了9.2%,同时减少了推理延迟。我们进一步证明LTV在回归任务上优于基线。此外,我们研究了LTV在不同模型规模间的可转移性;这在任务向量研究中仍是一个初级问题。具体而言,我们实证显示,较大模型的任务向量可以将较小模型的性能提高6.4%,表明提取的任务表示有新的用途。

英文摘要:

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.

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

↑