揭示大模型对齐为何浅层:梯度只关注决定危害的早期位置。
Why Is RLHF Alignment Shallow? A Gradient Analysis
- 通过鞅分解分析序列危害,发现梯度仅在危害决定前的位置有效
- 训练中后期位置梯度为零,导致对齐集中在早期token
- 提出危害信息量概念,解释对齐分布与优化目标的关系
为何大模型的安全对齐是浅层的?我们证明基于梯度的对齐会自然聚焦于决定危害的位置,而在危害已定之后消失。通过序列级危害的鞅分解,我们推导出对齐梯度的精确表达式:位置t的梯度等于条件期望危害与得分函数的协方差。这表明,当输出的危害性已确定(即超出危害时域)时,训练中该位置梯度信号为零。这解释了经验观察:对齐模型与基础模型间的KL散度集中于早期词元。因此,无论优化质量如何,标准对齐目标都无法实现深层对齐。我们引入危害信息量$I_t$,量化每位置对危害的影响,并证明均衡状态下的KL散度恰好跟踪该量。最后,我们提出基于恢复惩罚的目标,在所有位置生成梯度信号,为成功的数据增强技术提供了理论支持。
原文摘要 · Abstract (English)
Why is safety alignment in LLMs shallow? We prove that gradient-based alignment inherently concentrates on positions where harm is decided and vanishes beyond. Using a martingale decomposition of sequence-level harm, we derive an exact characterization of alignment gradients. The gradient at position $t$ equals the covariance between the conditional expected harm and the score function. This implies that positions beyond the harm horizon where the output's harmfulness is already determined receive zero gradient signal during training. This explains empirical observations that KL divergence between aligned and base models concentrates on early tokens. Consequently, standard alignment objectives cannot produce deep alignment, regardless of optimization quality. We introduce the concept of harm information $I_t$, which quantifies each position's influence on harm, and prove that equilibrium KL divergence tracks this quantity. Finally, we derive an objective based on recovery penalties that creates gradient signal at all positions, providing theoretical grounding for empirically successful data augmentation techniques.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。