Aligning Language Models with Preferences through f-divergence Minimization

Dongyoung Go, Tomasz Korbak, Germán Kruszewski, Jos Rozen, Nahyeon Ryu, Marc Dymetman

Aligning Language Models with Preferences through $f$-divergence Minimization

Aligning Large Language Models (LLMs) with human preferences—such as making them helpful, non-offensive, or factually consistent—is fundamentally a distribution matching problem. The goal is to adjust the model's output distribution ($\pi_\theta$) to match a "target" distribution ($p$) that represents these desired behaviors.

Currently, the field is split between two main approaches, each with significant trade-offs:

  1. RLHF (Reinforcement Learning from Human Feedback): This method effectively minimizes the reverse KL divergence. While it produces highly aligned models, it often leads to "mode collapse," where the model becomes excellent at a narrow set of high-reward responses but loses its creative variety and diversity.
  2. GDC (Generative Distributional Control): This approach minimizes the forward KL divergence. While it maintains better diversity and coverage, it can be sensitive to noise and notoriously difficult to optimize.

To bridge this gap, researchers have introduced $f$-DPG (Distributional Policy Gradient for $f$-divergences), a unified mathematical framework that treats language model alignment as a general $f$-divergence minimization problem.

The $f$-DPG Framework

The $f$-DPG framework allows practitioners to minimize any divergence in the $f$-divergence family (which includes forward KL, reverse KL, Jensen-Shannon, and Total Variation) against any evaluable target distribution.

Key Technical Contributions: * Universal Gradient Formula: The authors derive a general gradient descent formula for $f$-divergences, allowing the model to be updated using a "pseudo-reward" defined as $r_\theta(x) = -f'(\frac{\pi_\theta(x)}{p(x)})$. * Unification: The paper proves that existing methods like RLHF and GDC are simply specific instantiations of $f$-DPG using different $f$ functions. * Variance Reduction & Estimation: They adapt standard RL techniques (like using a baseline to stabilize training) and use importance sampling to dynamically estimate the normalizing constant ($Z$) for unnormalized target distributions.

The Pareto Frontier of Alignment vs. Diversity

Evaluating $f$-DPG across 13 different alignment tasks (including sentiment alignment, debiasing, and factual summarization) revealed a fundamental trade-off between alignment (following the preference) and diversity (output entropy).

Comparison of divergence objectives across training epochs showing the trade-off between reward and entropy.

As seen in the training dynamics, Reverse KL (RKL, often used in RLHF) sits at the extreme end of this spectrum: it achieves the highest alignment scores but suffers a catastrophic drop in entropy, confirming its "mode-seeking" nature. Forward KL sits at the opposite extreme, preserving diversity but struggling to optimize alignment effectively.

The Jensen-Shannon "Sweet Spot"

By exploring the space between these extremes, the authors identified Jensen-Shannon (JS) divergence as a robust middle ground. JS divergence consistently appeared on the Pareto frontier, offering better alignment than forward KL while avoiding the severe diversity loss of reverse KL.

Interestingly, the pseudo-reward "shapes" explain this behavior. Forward KL gives massive, unbounded rewards for samples where the target density is higher than the model density, causing instability. JS divergence, however, provides smoother, bounded rewards in both directions.

JS divergence optimization outperforming KL divergence optimization on both KL and JS metrics.

On many tasks, JS-DPG actually outperformed the standard forward KL objective (KL-DPG) even when the evaluation metric was the forward KL itself. This highlights JS as a fundamentally more stable optimization objective for language model alignment.

Conclusion and Future Work

The relative strengths and weaknesses of these divergences are not artifacts of small models; the authors demonstrated that these patterns persist as models scale up to 1.5B parameters.

While $f$-DPG requires an evaluable target distribution $p(x)$—adding some complexity compared to standard reward models—the framework provides a much-needed principled approach to balancing alignment and diversity. Future work will need to explore how these divergence properties hold up at the extreme scale of frontier models (100B+ parameters).

Summary updated

BibTeX
@inproceedings{go2023aligning,
  author = {Dongyoung Go and Tomasz Korbak and Germán Kruszewski and Jos Rozen and Nahyeon Ryu and Marc Dymetman},
  title = {{Aligning Language Models with Preferences through f-divergence Minimization}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=8zByfSOZzi6},
}
Figure