Abstract
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.
Introduction: The Alignment Tug-of-War
Aligning Large Language Models (LLMs) using human preferences is essential for ensuring AI helpfulness and safety. The current standard, Reinforcement Learning from Human Feedback (RLHF), has been simplified by methods like Direct Preference Optimization (DPO), which fine-tune models directly using margin-based losses. However, these methods suffer from a fundamental flaw: under-specification. Because these losses only optimize the difference between a "chosen" and "rejected" response, they do not explicitly constrain the absolute probabilities of either. This leads to a phenomenon the authors call Gradient Entanglement, where the probabilities of both responses move in the same direction, potentially increasing the likelihood of unsafe outputs even as the model learns the "correct" preference.
The Mechanics of Gradient Entanglement
The authors provide a rigorous theoretical framework to explain this behavior. They define gradient entanglement as the effect where the inner product between the gradients of the chosen and rejected log-probabilities is large relative to their individual norms. If the gradients are too similar (highly correlated), the model cannot move them independently.
A primary driver of this entanglement is the "Shared Token Trap." When two responses share many identical tokens—such as a long common prefix—the model spends most of its gradient energy updating the shared components, which affects both responses equally. This prevents the model from simultaneously increasing the probability of the chosen response while decreasing the rejected one.
Empirical Analysis and Algorithm Comparison
The researchers validated their findings across several benchmarks, including TL;DR and UltraFeedback, using models such as Mistral-7B and Llama-3-8B. As shown in Figure 1, the log-probabilities of chosen and rejected responses often move in sync. In some cases, such as Llama-3 8B, both probabilities trend downwards together, which can degrade model performance on preferred tasks.
Furthermore, the study compares various alignment algorithms to see how they handle this entanglement. While standard DPO and R-DPO show high levels of synchronized movement, other methods like SPPO demonstrate a distinct ability to decouple these dynamics, matching theoretical predictions about their specific loss structures.
Proposed Solutions and Future Work
To address these issues, the authors suggest two algorithmic directions:
- Normalized Preference Optimization (NPO): Reweighting the loss to ensure the "gradient condition" is met, forcing the probabilities to move in the desired directions.
- Sparse Preference Optimization (SPO): Using token-level masking to focus the model only on "significant" tokens that differentiate the two responses, thereby reducing gradient similarity.
While this study focuses on "offline" preference optimization, future work is needed to investigate how these dynamics manifest in "online" RLHF settings where the model generates its own samples. Refining SPO into a production-ready algorithm remains a key goal for improving the robustness of language model alignment.
Summary updated