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

通过对比上下文采样训练上下文和权重混合

Contrast Matters: Understanding Robustness of In-Context Fine-Tuning to Target-Context Relatedness

Deeptanshu Malu, Deevyanshu Malu, Aditya Nemiwal, Sunita Sarawagi

AI总结:

本文研究了同时开发上下文学习和权重学习的训练策略,通过对比上下文采样提升两种学习模式的混合效果,避免模型退化为单一模式或简单复制。

摘要:

我们研究了同时开发上下文学习(ICL)和权重学习(IWL)的训练策略,并探讨基于上下文相关性切换这两种模式的能力。尽管当前大语言模型(LLM)同时具备这两种模式,但标准任务特定微调通常会削弱ICL,促使IC-Train(使用上下文示例进行微调)。先前工作表明,IC-Train后ICL的出现取决于诸如任务多样性和训练持续时间等因素。在本文中,我们证明了目标输入与上下文示例之间的相似性结构也起着重要作用。随机上下文会导致ICL和IWL主导的丧失,而仅在上下文中使用相似的示例会使ICL退化为不考虑相关性的标签复制。为了解决这一问题,我们提出了一种简单的对比上下文方法,强制两种类型的对比:(1)在上下文中混合相似和随机示例以发展正确的ICL形式,(2)在不同上下文中变化相似度等级以发展ICL-IWL混合。我们通过理论分析最小模型得出了对比的重要性。我们通过在四个LLM和多个任务上的广泛实证评估进行了验证。诊断探针确认,对比上下文会产生稳定的ICL-IWL混合,避免退化为纯ICL、IWL或复制。

英文摘要:

In-context fine-tuning (IC-Train), training an LLM with labeled examples in-context, is increasingly used in place of standard fine-tuning for domain adaptation and continual absorption of labeled data. We study the robustness of the in-context learning ability that emerges from such training: does the fine-tuned model perform well across test inputs whose in-context examples range from unrelated to nearly identical? Across 32 configurations spanning four open-source LLMs and eight test sets over machine translation, Text-to-SQL, and multilingual semantic parsing, we show that robustness hinges on an overlooked design choice: how in-context examples are selected relative to the target during training. The two prevailing strategies turn out to be accurate over complementary parts of this spectrum: random contexts yield a model that gains little from related examples even when they are placed in its context, while retrieved similar contexts weaken accuracy on targets lacking close neighbors and raise the propensity to copy labels from context. Probes tracking in-weights learning, in-context learning, and copying trace these failures to distinct training dynamics, and show that introducing contrast in target-context similarity both within a context and across batches, restores robustness across the entire spectrum.

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

↑