Noise Contrastive Alignment of Language Models with Explicit Rewards

📄 arXiv: 2402.05369v3 📥 PDF

作者: Huayu Chen, Guande He, Lifan Yuan, Ganqu Cui, Hang Su, Jun Zhu

分类: cs.LG, cs.CL

发布日期: 2024-02-08 (更新: 2024-10-30)

备注: NeurIPS 2024


💡 一句话要点

提出噪声对比对齐方法以优化语言模型的奖励机制

🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)

关键词: 语言模型 噪声对比估计 奖励机制 对齐方法 直接偏好优化 复杂推理 自然语言处理

📋 核心要点

  1. 现有的对齐方法主要针对隐式定义的偏好数据,难以处理显式奖励数据,限制了语言模型的优化效果。
  2. 本文提出的框架通过噪声对比估计(NCE)方法,能够有效处理显式标注的奖励数据,提供更直接的对齐策略。
  3. 实验结果显示,InfoNCA和NCA在奖励数据集上表现优异,尤其在复杂推理任务中,NCA显著超越了DPO方法。

📝 摘要(中文)

用户意图通常通过评估奖励形式化,以在微调语言模型时进行最大化。现有的对齐方法,如直接偏好优化(DPO),主要针对隐式定义的成对偏好数据,而非显式给出的奖励。本文提出了一种通用框架,利用噪声对比估计(NCE)来处理显式标注的奖励数据。该框架包括两个并行算法,NCA和InfoNCA,能够直接从奖励和偏好数据中提取语言模型策略。我们证明了DPO损失是InfoNCA目标在成对偏好设置下的特例,从而整合和扩展了现有对齐理论。实验表明,在奖励数据集可用的情况下,InfoNCA/NCA超越了多种偏好基线,并且在复杂推理任务中NCA显著优于DPO。

🔬 方法详解

问题定义:本文旨在解决现有对齐方法在处理显式奖励数据时的不足,特别是DPO方法对隐式偏好数据的依赖。

核心思路:通过引入噪声对比估计(NCE),本文提出的NCA和InfoNCA算法能够直接从显式奖励数据中提取语言模型策略,克服了传统方法的局限性。

技术框架:整体框架包括两个主要算法:NCA和InfoNCA,前者优化绝对似然性,后者则在成对偏好设置下优化相对似然性。两者均可处理奖励和偏好数据。

关键创新:最重要的创新在于将DPO损失视为InfoNCA目标的特例,整合了现有的对齐理论,并提出了新的优化视角。

关键设计:在算法设计中,NCA专注于绝对似然性的优化,避免了选择的似然性下降,同时在损失函数和网络结构上进行了针对性的调整,以适应不同类型的数据集。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,在使用奖励数据集时,InfoNCA和NCA的性能显著优于多种偏好基线,尤其在复杂推理任务中,NCA的表现比DPO提升了显著的效果,展示了新方法的有效性。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理中的对话系统、推荐系统和智能助手等。通过优化语言模型的奖励机制,可以提升模型在复杂任务中的表现,具有重要的实际价值和未来影响。

📄 摘要(原文)

User intentions are typically formalized as evaluation rewards to be maximized when fine-tuning language models (LMs). Existing alignment methods, such as Direct Preference Optimization (DPO), are mainly tailored for pairwise preference data where rewards are implicitly defined rather than explicitly given. In this paper, we introduce a general framework for LM alignment, leveraging Noise Contrastive Estimation (NCE) to bridge the gap in handling reward datasets explicitly annotated with scalar evaluations. Our framework comprises two parallel algorithms, NCA and InfoNCA, both enabling the direct extraction of an LM policy from reward data as well as preference data. Notably, we show that the DPO loss is a special case of our proposed InfoNCA objective under pairwise preference settings, thereby integrating and extending current alignment theories. By comparing NCA and InfoNCA, we demonstrate that the well-observed decreasing-likelihood trend of DPO/InfoNCA is caused by their focus on adjusting relative likelihood across different responses. In contrast, NCA optimizes the absolute likelihood for each response, thereby effectively preventing the chosen likelihood from decreasing. We evaluate our methods in both reward and preference settings with Mistral-8*7B and 7B models. Experiments suggest that InfoNCA/NCA surpasses various preference baselines when reward datasets are available. We also find NCA significantly outperforms DPO in complex reasoning tasks like math and coding.