Length Desensitization in Directed Preference Optimization

Wei Liu, Yang Bai, Chengcheng Han, Rongxiang Weng, Jun Xu, Xuezhi Cao, Jingang Wang, Xunliang Cai · DOI

TL;DR

Large Language Models (LLMs) trained with Direct Preference Optimization (DPO) often become overly verbose, hindering performance. This paper introduces LD-DPO, a novel method that theoretically and empirically demonstrates how DPO's optimization objective is sensitive to response length. LD-DPO effectively desensitizes models to length, producing more concise and higher-quality responses while maintaining alignment with human preferences.

What Problem Does This Paper Address?

Aligning Large Language Models (LLMs) with human preferences is crucial for making them helpful, honest, and harmless. Direct Preference Optimization (DPO) is a popular technique for this, simplifying the Reinforcement Learning from Human Feedback (RLHF) process by directly optimizing a policy based on preference data. However, a significant issue observed with DPO is its tendency to produce overly verbose responses. This verbosity can negatively impact user experience and even degrade the model's performance on tasks like reasoning. The authors identify that this problem stems from DPO's inherent "length sensitivity," where the optimization objective is disproportionately influenced by the length of the training data's preferred and rejected responses.

Methods

The core of this paper is the development of LD-DPO (Length-Desensitization DPO). The authors first conduct a theoretical analysis to pinpoint the source of DPO's length sensitivity. They show that the optimization objective's partial derivatives with respect to the likelihood of chosen and rejected responses are inversely proportional to their respective values. Since longer sequences have lower likelihoods, DPO inadvertently favors longer responses.

LD-DPO addresses this by reparameterizing the likelihood function. Specifically, it decomposes the likelihood of a response into a "public-length portion" (common to both chosen and rejected responses) and an "excessive portion" (unique to the longer response). By introducing a hyperparameter $\alpha$, LD-DPO can decouple the "verbosity preference" (associated with the excessive length) from other intrinsic preferences. This allows the model to focus on the substantive content rather than being driven by response length. When $\alpha=1$, LD-DPO behaves like standard DPO; when $\alpha=0$, only the public-length portion is considered.

Datasets

The authors utilize the UltraFeedback dataset for training. For evaluation, they employ several standard benchmarks:

  • MT-Bench: An 80-question benchmark covering 8 capability dimensions.
  • AlpacaEval 2: A benchmark with 805 questions derived from 5 datasets, with a focus on length-controlled win rates.
  • Arena-Hard: A more challenging benchmark with 500 technical problem-solving queries.
  • ProofWriter: A specialized dataset for evaluating reasoning capabilities, distinguishing between open-world and closed-world assumptions.
  • OpenLLM Leaderboard: Used for evaluating performance on various downstream tasks like GSM8K, BBH, WinoGrande, CSQA, ARC, MMLU, HellaSwag, and ProofWriter.

Key Insights and Ideas

  • DPO is inherently length-sensitive: The paper provides a theoretical foundation for why DPO leads to verbose outputs, linking it directly to the mathematical formulation of its optimization objective and the probabilistic nature of language models.
  • Length bias can mask true preferences: The authors argue that DPO's focus on length can lead it to prioritize longer responses even if they are not genuinely preferred by humans, thus misaligning the model.
  • Decoupling length preference is key: LD-DPO's success lies in its ability to disentangle the "verbosity preference" from other, more important, human preferences, allowing for more nuanced alignment.
  • Model capability influences length sensitivity: The study observes that more capable models (like Llama3-8B-Instruct) are less sensitive to length during DPO training compared to less capable ones (like Llama2-13B-Chat), suggesting a correlation between model capacity and the need for length desensitization.
  • Conciseness can improve reasoning: The paper demonstrates that by generating more concise Chain-of-Thought (CoT) responses, LD-DPO not only reduces verbosity but also enhances the model's reasoning abilities.

Key Results

  • Significant length reduction: LD-DPO consistently produces more concise responses, achieving a 10-40% reduction in length compared to DPO across various benchmarks and model families (Llama2, Llama3, Qwen2).
  • State-of-the-art performance: LD-DPO outperforms DPO and other baseline methods on MT-Bench and AlpacaEval 2 in terms of both quality (score/win rate) and conciseness.
  • Improved reasoning capabilities: Experiments on ProofWriter and MT-Bench show that LD-DPO significantly enhances the reasoning abilities of LLMs, likely due to its ability to generate more direct and less verbose reasoning steps.
  • Optimal hyperparameter $\alpha$ varies: The best performance for LD-DPO is achieved with different $\alpha$ values depending on the model's capability, suggesting a trade-off between desensitization and preserving genuine human preferences. For instance, Llama3-8B-Instruct performs best at $\alpha=0.5$, while Llama2-13B-Chat prefers $\alpha=0.3$.

Limitations and Future Work

  • Extreme $\alpha$ values are suboptimal: The paper notes that setting $\alpha=0$ (complete length decoupling) can lead to a loss of human-like preferences, indicating that some degree of length preference is still desirable. Conversely, $\alpha=1$ (standard DPO) leads to verbosity.
  • Hyperparameter tuning: The optimal value of $\alpha$ is model-dependent and requires tuning, which adds a layer of complexity.
  • Future work: The authors suggest that the length sensitivity coefficient ($\gamma$) they define could be instructive for understanding preference optimization across models of varying capabilities. Further exploration of this coefficient and its implications for designing more robust alignment strategies is a promising direction. They also highlight that verbose responses can negatively impact reasoning, and LD-DPO's ability to produce concise CoTs is a key advantage.

Summary updated

BibTeX
@misc{liu2024length,
  author = {Wei Liu and Yang Bai and Chengcheng Han and Rongxiang Weng and Jun Xu and Xuezhi Cao and Jingang Wang and Xunliang Cai},
  title = {{Length Desensitization in Directed Preference Optimization}},
  year = {2024},
  eprint = {2409.06411},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.06411},
}
Figure