arXiv:2410.13828cs.LGcs.AI2024-10ICLR被引 10

发现语言模型对齐中的梯度纠缠问题,导致越优化越不安全

A Common Pitfall of Margin-based Language Model Alignment: Gradient Entanglement

  • 提出梯度纠缠概念,解释边际损失为何会同步影响偏好与非偏好响应概率
  • 实验证明:边际越大,不安全回复概率可能上升,理想回复概率反而下降
  • 适合研究大模型对齐、强化学习训练的开发者参考

基于人类反馈的强化学习(RLHF)是当前语言模型对齐的主流方法,其核心采用基于边距的损失函数,仅通过偏好与非偏好回复之间的差异来定义理想行为。本文揭示了一类常见陷阱:边际方法对单个偏好/非偏好响应的描述不足,当边距增大时会导致两个意外后果:(1) 非偏好(如不安全)回复的概率可能上升,引发安全对齐失败;(2) 理想偏好回复的概率可能下降。我们解析其原因:边际损失将偏好概率的变化与非偏好梯度耦合,反之亦然,常导致两者同步增减,难以独立优化。这一现象称为梯度纠缠。我们形式化推导出在何种条件下该问题严重——偏好与非偏好对数概率梯度的内积远大于各自模长。理论分析表明,语言模型对齐时该内积易变大,并通过实验验证。该框架可解释不同偏好优化算法的训练动态差异,并为改进边际方法提供设计思路。

原文摘要 · Abstract (English)

Reinforcement Learning from Human Feedback (RLHF) has become the predominant approach for language model (LM) alignment. At its core, RLHF uses a margin-based loss for preference optimization, specifying ideal LM behavior only by the difference between preferred and dispreferred responses. In this paper, we identify a common pitfall of margin-based methods -- the under-specification of ideal LM behavior on preferred and dispreferred responses individually, which leads to two unintended consequences as the margin increases: (1) The probability of dispreferred (e.g., unsafe) responses may increase, resulting in potential safety alignment failures. (2) The probability of preferred responses may decrease, even when those responses are ideal. We demystify the reasons behind these problematic behaviors: margin-based losses couple the change in the preferred probability to the gradient of the dispreferred one, and vice versa, often preventing the preferred probability from increasing while the dispreferred one decreases, and thus causing a synchronized increase or decrease in both probabilities. We term this effect, inherent in margin-based objectives, gradient entanglement. Formally, we derive conditions for general margin-based alignment objectives under which gradient entanglement becomes concerning: the inner product of the gradients of preferred and dispreferred log-probabilities is large relative to the individual gradient norms. We theoretically investigate why such inner products can be large when aligning language models and empirically validate our findings. Empirical implications of our framework extend to explaining important differences in the training dynamics of various preference optimization algorithms, and suggesting potential algorithm designs to mitigate the under-specification issue of margin-based methods and thereby improving language model alignment.

语言模型对齐梯度纠缠强化学习安全对齐

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。