Earlier Tokens Contribute More: Learning Direct Preference Optimization From Temporal Decay Perspective

📄 arXiv: 2502.14340v1 📥 PDF

作者: Ruichen Shao, Bei Li, Gangao Liu, Yang Chen, Xiang Zhou, Jingang Wang, Xunliang Cai, Peng Li

分类: cs.CL

发布日期: 2025-02-20

备注: Accepted by ICLR 2025

🔗 代码/项目: GITHUB


💡 一句话要点

提出基于时间衰减的直接偏好优化方法以解决长度偏差问题

🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 直接偏好优化 时间衰减 人类反馈 自然语言处理 模型对齐 深度学习 机器学习

📋 核心要点

  1. 现有的直接偏好优化方法存在长度偏差,生成的响应往往过长,影响模型的对齐效果。
  2. 本文提出了一种结合时间衰减因子的偏好优化方法,通过动态调整奖励的影响,优先考虑早期标记。
  3. 实验结果显示,所提方法在多个基准测试中均优于传统DPO,提升幅度在5.9-9.7分之间,且不影响模型的通用能力。

📝 摘要(中文)

直接偏好优化(DPO)作为一种高效的替代方案,逐渐受到关注,用于将大型语言模型(LLMs)与人类偏好对齐。然而,DPO存在长度偏差,生成的响应往往比参考模型更长。现有的解决方案如SimPO和SamPO未能考虑奖励在序列中的时间动态。为此,本文提出了一种增强的偏好优化方法,结合了由伽马参数控制的时间衰减因子,动态调整每个奖励的影响,优先考虑对对齐更为关键的早期标记。实验结果表明,该方法在多个基准测试中相较于传统DPO表现出5.9-8.8的提升,且在数学和推理基准上也未损害模型的通用能力。

🔬 方法详解

问题定义:本文旨在解决直接偏好优化(DPO)中存在的长度偏差问题,现有方法未能有效考虑奖励在序列中的时间动态,导致生成的响应过长。

核心思路:本文提出了一种新的偏好优化方法,结合时间衰减因子,通过动态调整奖励的影响力,优先关注序列中早期的标记,从而提高对齐效果。

技术框架:该方法的整体架构包括奖励计算模块、时间衰减因子应用模块和优化更新模块。奖励计算模块负责根据模型输出和人类反馈生成奖励,时间衰减因子模块根据标记位置调整奖励影响,优化更新模块则根据调整后的奖励更新模型参数。

关键创新:本文的主要创新在于引入了时间衰减因子,允许模型根据标记在序列中的位置动态调整奖励的影响,这与现有方法的静态处理方式形成了鲜明对比。

关键设计:在参数设置上,伽马参数用于控制时间衰减的强度,损失函数设计上则考虑了动态调整后的奖励影响,确保模型在训练过程中能够更好地对齐人类偏好。

🖼️ 关键图片

fig_0
img_1

📊 实验亮点

实验结果表明,所提方法在AlpacaEval 2上提升了5.9-8.8分,在Arena-Hard上提升了3.3-9.7分,显示出在不同模型架构和规模下的优越性能。此外,在数学和推理基准(如MMLU、GSM8K和MATH)上也验证了方法的有效性,未损害模型的通用能力。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、对话系统和推荐系统等。通过更好地对齐人类偏好,模型能够生成更符合用户期望的响应,提升用户体验。未来,该方法可能在多种人机交互场景中发挥重要作用,推动智能系统的进一步发展。

📄 摘要(原文)

Direct Preference Optimization (DPO) has gained attention as an efficient alternative to reinforcement learning from human feedback (RLHF) for aligning large language models (LLMs) with human preferences. Despite its advantages, DPO suffers from a length bias, generating responses longer than those from the reference model. Existing solutions like SimPO and SamPO address this issue but uniformly treat the contribution of rewards across sequences, overlooking temporal dynamics. To this end, we propose an enhanced preference optimization method that incorporates a temporal decay factor controlled by a gamma parameter. This dynamic weighting mechanism adjusts the influence of each reward based on its position in the sequence, prioritizing earlier tokens that are more critical for alignment. By adaptively focusing on more relevant feedback, our approach mitigates overfitting to less pertinent data and remains responsive to evolving human preferences. Experimental results on several benchmarks show that our approach consistently outperforms vanilla DPO by 5.9-8.8 points on AlpacaEval 2 and 3.3-9.7 points on Arena-Hard across different model architectures and sizes. Furthermore, additional experiments on mathematical and reasoning benchmarks (MMLU, GSM8K, and MATH) confirm that our method enhances performance without compromising general capabilities. Our codebase would be available at \url{https://github.com/LotuSrc/D2PO}.