arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.07817cs.CLcs.AIcs.LG

论指令微调损失对泛化能力的影响

On the Effect of Instruction Tuning Loss on Generalization

Dept. of Electrical Engineering(电气工程系);Indian Institute of Technology Delhi(印度理工学院德里);Media and Data Science Research(媒体与数据科学研究);Adobe Inc., India(Adobe公司,印度)

Anwoy Chatterjee, H S V N S Kowndinya Renduchintala, Sumit Bhatia, Tanmoy Chakraborty

AI总结:

本文研究了指令微调中损失函数对提示和响应令牌差异化加权的影响,提出加权指令微调(WIT)方法,发现适度加权提示与响应令牌能显著提升模型的泛化能力、鲁棒性及后续偏好对齐效果。

摘要:

指令微调已成为一种关键的训练后范式,使预训练语言模型能更好地遵循用户指令。尽管其意义重大,但鲜少有人关注优化所用的损失函数。一个基本却常被忽视的问题是:仅对响应令牌计算损失而不包含提示令牌的常规自回归目标,是否真正对指令微调最优。在本研究中,我们系统地调查了在指令微调损失中对提示令牌和响应令牌进行差异化加权的影响,并提出了加权指令微调(WIT)作为常规指令微调的更优替代方案。通过在5个不同家族和规模的模型、3个不同规模的数据集和5个多样化评估基准上进行广泛实验,我们表明标准指令微调损失通常会导致次优性能,且对输入提示变化的鲁棒性有限。我们发现,为提示令牌施加低至中等权重,同时为响应令牌施加中至高权重,能在各种设置下产生性能最佳的模型,并且也可作为后续偏好对齐训练的更优起点。这些发现凸显了重新审视指令微调损失的必要性,并为开发更鲁棒和具泛化能力的模型提供了可行见解。我们的代码已在 https://github.com/kowndinya-renduchintala/WIT 开源。

英文摘要:

Instruction Tuning has emerged as a pivotal post-training paradigm that enables pre-trained language models to better follow user instructions. Despite its significance, little attention has been given to optimizing the loss function used. A fundamental, yet often overlooked, question is whether the conventional auto-regressive objective - where loss is computed only on response tokens, excluding prompt tokens - is truly optimal for instruction tuning. In this work, we systematically investigate the impact of differentially weighting prompt and response tokens in instruction tuning loss, and propose Weighted Instruction Tuning (WIT) as a better alternative to conventional instruction tuning. Through extensive experiments on five language models of different families and scale, three finetuning datasets of different sizes, and five diverse evaluation benchmarks, we show that the standard instruction tuning loss often yields suboptimal performance and limited robustness to input prompt variations. We find that a low-to-moderate weight for prompt tokens coupled with a moderate-to-high weight for response tokens yields the best-performing models across settings and also serve as better starting points for the subsequent preference alignment training. These findings highlight the need to reconsider instruction tuning loss and offer actionable insights for developing more robust and generalizable models. Our code is open-sourced at https://github.com/kowndinya-renduchintala/WIT.

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

↑