给每个词分配重要性权重,让大模型对齐更精准高效
TIS-DPO: Token-level Importance Sampling for Direct Preference Optimization With Estimated Weights
- 按词重要性加权优化,突破传统整体响应处理的局限
- 在有害性与帮助性任务上显著超越多个基线方法
- 适合需要精细对齐的场景,如安全可控生成
直接偏好优化(DPO)因其简单有效被广泛用于大语言模型的偏好对齐。但传统DPO将整个回复视为单一动作,忽略词间重要性差异,可能影响优化效率并难以达到最优。本文提出:理想数据应使胜/负回应中各词期望奖励相等。由于理想数据不可得,我们利用原始数据进行重要性采样以实现无偏优化。为此提出词级重要性采样DPO(TIS-DPO),基于词的奖励分配重要性权重。通过对比模型预测概率差异估计权重,采用三种构建对比模型的方法:(1)使用对比提示引导原模型,(2)分别用胜/负回应训练两个独立模型,(3)对胜/负回应进行正向与反向DPO训练。实验表明,TIS-DPO在有害性与帮助性对齐及摘要任务上显著优于多个基线方法。可视化结果验证了权重能有效识别关键词位置。
原文摘要 · Abstract (English)
Direct Preference Optimization (DPO) has been widely adopted for preference alignment of Large Language Models (LLMs) due to its simplicity and effectiveness. However, DPO is derived as a bandit problem in which the whole response is treated as a single arm, ignoring the importance differences between tokens, which may affect optimization efficiency and make it difficult to achieve optimal results. In this work, we propose that the optimal data for DPO has equal expected rewards for each token in winning and losing responses, as there is no difference in token importance. However, since the optimal dataset is unavailable in practice, we propose using the original dataset for importance sampling to achieve unbiased optimization. Accordingly, we propose a token-level importance sampling DPO objective named TIS-DPO that assigns importance weights to each token based on its reward. Inspired by previous works, we estimate the token importance weights using the difference in prediction probabilities from a pair of contrastive LLMs. We explore three methods to construct these contrastive LLMs: (1) guiding the original LLM with contrastive prompts, (2) training two separate LLMs using winning and losing responses, and (3) performing forward and reverse DPO training with winning and losing responses. Experiments show that TIS-DPO significantly outperforms various baseline methods on harmlessness and helpfulness alignment and summarization tasks. We also visualize the estimated weights, demonstrating their ability to identify key token positions.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。