TL;DR
Direct Preference Optimization (DPO) often suffers from "verbosity," where models learn to generate excessively long responses to maximize rewards. This paper identifies a hidden algorithmic bias in DPO's loss function that overestimates rewards for longer sequences and introduces SamPO, a lightweight down-sampling approach that eliminates this length reliance, leading to more concise and higher-quality model alignment.
What Problem Does This Paper Address?
Aligning Large Language Models (LLMs) with human preferences is a critical final step in training. While DPO has become a popular, simpler alternative to Reinforcement Learning from Human Feedback (RLHF), it has a notorious side effect: verbosity. Models trained with DPO tend to generate increasingly longer responses, a phenomenon often called "reward hacking" or "over-optimization."
Previous research largely blamed this on data bias—the fact that human annotators often prefer longer, more detailed-looking answers. However, the authors of this paper argue that the problem is also algorithmic. They show that DPO’s sequence-level loss function inherently favors longer sequences because the implicit reward is calculated by summing log-probability ratios across all tokens. Consequently, longer "chosen" responses naturally accumulate higher rewards, even if their per-token quality isn't superior.
Methods
The authors propose SamPO (Down-Sampled DPO) to break this algorithmic link between length and reward.
-
Analysis of the Bias: They decompose the DPO reward into a token-level sum. As shown in Figure 2(a), when a chosen response is longer than a rejected one, the total reward is often overestimated simply due to the higher token count. Comparison of rewards in DPO vs. SamPO.
-
The SamPO Approach: Instead of using the full sequences, SamPO down-samples tokens from both the chosen ($y_w$) and rejected ($y_l$) responses to a common length $T_m$, which is the minimum length of the two.
- Uniform Sampling: The tokens are selected using a uniform distribution across the entire sequence length. This ensures that the "budget" for accumulating reward is equal for both responses while still capturing the overall quality characteristics of the full sequence.
- Comparison with Averaging: They also explored simple length-averaging (DPO-SANorm), but found that down-sampling is superior because averaging tends to "vanish" the variance features among tokens, which are important for effective learning.
Datasets
The study utilizes several standard preference and evaluation datasets:
- Training: HH-RLHF (161k pairs), TL;DR (92.8k pairs), and a binarized version of UltraFeedback (61k pairs).
- Conditional Benchmarks: GSM8K (math), IFEval (instruction following), PiQA (physical commonsense), MMLU (general knowledge), and TruthfulQA.
- Open-ended Benchmarks: AlpacaEval2, evaluated using GPT-4 win rates.
- Human Evaluation: A custom dataset of 480k samples used to fine-tune a Qwen1.5-72B model for large-scale human testing.
Key Insights and Ideas
- Algorithmic Length Reliance: The core "aha" moment is that DPO treats tokens as discrete samples in a sum. This means length isn't just a feature the model learns to exploit; it's a scaling factor built into the optimization target itself.
- The "Seesaw" Dilemma: The authors note that other methods like SimPO, while effective at reducing length, can sometimes over-simplify responses to the point of being unhelpful or grammatically incorrect (e.g., responding with just "Sure!" to a complex request). SamPO aims for a better balance.
- Stability over Epochs: DPO typically sees response length skyrocket as training progresses. Figure 4 illustrates how SamPO maintains stable response lengths across multiple training epochs while steadily improving performance scores. Response length vs. performance over training epochs.
Key Results
SamPO consistently outperforms DPO and several recent variants (like IPO, TDPO, and SimPO) across different model scales (Pythia-2.8B, Llama3-8B, and Tulu2-13B):
- Performance Gains: SamPO achieves improvements of 5% to 12% over standard DPO across various benchmarks.
- Verbosity Mitigation: On the Tulu2-13B model, SamPO reduced the average response length on AlpacaEval2 from 372 tokens (DPO) to 339 tokens, while increasing the win rate.
- TL;DR Success: SamPO was particularly effective on the TL;DR summarization task, achieving a 73.58% win rate (Iterative SamPO) compared to DPO's 60.98%.
- Human Validation: In large-scale human evaluations on a 72B parameter model, SamPO significantly outperformed both the SFT base and DPO across MRC, Logical Reasoning, and RolePlay tasks.
Limitations and Future Work
- Scalability: While tested on models up to 72B, the authors acknowledge that more extensive testing across a broader range of architectures is needed to fully confirm generalization.
- Computational Overhead: The down-sampling step adds a small amount of extra computation during training. While negligible for the authors' setups, it might be a concern in extremely resource-constrained environments.
- Evaluation Depth: The human evaluation used a simple binary "incorrect vs. acceptable" metric. The authors suggest that future work should employ more nuanced, multi-dimensional human assessments.
Summary updated