Uncertainty-Penalized Direct Preference Optimization

Sam Houliston, Alizée Pace, Alexander Immer, Gunnar Ratsch

TL;DR

Direct Preference Optimization (DPO) can easily overfit to noisy, ambiguous, or mislabeled preference pairs because its loss disproportionately amplifies gradient updates when the model underperforms. Inspired by pessimistic offline reinforcement learning, this paper introduces Energy Factor Penalization, a method that downweights gradient updates for high-uncertainty samples by multiplicatively scaling implicit rewards. Experiments on GPT-2 Medium show this pessimistic regularization outperforms standard DPO overall, achieves higher generation quality on ambiguous prompts, and improves stability across sampling temperatures.

What Problem Does This Paper Address?

Direct Preference Optimization (DPO) is widely used to align Large Language Models (LLMs) with human preferences without explicitly training a separate reinforcement learning reward model. However, DPO treats every binary pair in a dataset equally, regardless of label quality or preference strength.

Analyzing the DPO loss reveals a major failure mode: the gradient magnitude scales with $\sigma(-\rho_\theta)$, where $\rho_\theta$ is the margin between the chosen and rejected implicit rewards. When a pair is mislabeled or inherently ambiguous (where human annotator agreement is near 50/50), the policy underperforms the reference model, driving $\rho_\theta$ down. DPO responds by applying massive gradient updates to these uncertain samples. This leads to severe reward overoptimization and overfitting.

Methods

To introduce pessimism—a standard technique in offline RL to handle out-of-distribution or uncertain states—the authors explore uncertainty-aware modifications to the RLHF and DPO objectives:

  1. Standard Lower Confidence Bound (LCB) Addition: Subtracting uncertainty from rewards ($r(x, y) - u(y|x)$) yields a DPO objective with an additive margin $\Delta_u = u(y_w|x) - u(y_l|x)$. While intuitive, if both chosen and rejected completions have high uncertainty, their penalties cancel out.

  2. Energy Factor Penalization (Core Contribution): To prevent cancellation, the authors scale the reward multiplicatively by an energy-like function of uncertainty: $$\max_{\pi_\theta} \mathbb{E}\left[ r(x, y) e^{-u(y|x)/\tau} \right] - \beta D_{\text{KL}}(\pi_\theta \parallel \pi_{\text{ref}})$$ Deriving the implicit reward under DPO transforms the loss into: $$\mathcal{L}_{\text{DPO}}^u = -\mathbb{E}\left[ \log \sigma \left( e^{u(y_w|x)/\tau} \hat{r}_\theta(x, y_w) - e^{u(y_l|x)/\tau} \hat{r}_\theta(x, y_l) \right) \right]$$ This decouples the chosen and rejected completions, ensuring that the uncertainty of each response directly attenuates its corresponding policy gradient term.

  3. Adaptive Scaling & Generalization: Uncertainties are scaled dynamically using exponential moving averages of implicit rewards and uncertainty values. The authors also generalize these penalties to general preference frameworks like $\Psi$PO and Identity Preference Optimization (IPO).

Datasets

The authors evaluated their approach using:

  • Anthropic-HH (Helpful and Harmless): Contains 160,800 training pairs and 8,552 test pairs of human-assistant conversations.
  • Uncertainty Source: An ensemble of 5 GPT-2 (300M) reward models trained on 90% data splits. Epistemic uncertainty $u(y|x)$ is computed as the standard deviation across ensemble predictions.

No new datasets were introduced.

Key Insights and Ideas

  • DPO has an "inverse" gradient problem: Standard DPO aggressively prioritizes samples where the policy is most "wrong." When data is noisy or preferences are ties, DPO overfits by pushing hardest on the most questionable training points.
  • Additive penalties cancel; multiplicative factors do not: Naively subtracting an uncertainty margin creates an offset $\Delta_u = u(y_w) - u(y_l)$. If a prompt produces two equally ambiguous outputs, $\Delta_u \approx 0$, leaving the sample unregularized. Energy factor multiplication resolves this by scaling gradient components independently.
  • Better robustness across sampling temperatures: Pessimistic regularization prevents the model from assigning extreme probability spikes to low-confidence tokens, yielding a policy that degrades much less when altering generation temperatures.

Key Results

Experiments were conducted on GPT-2 Medium (355M) across 500 Anthropic-HH test prompts:

  • Overall Test Performance: The Multiplication (30% penalty) scheme achieved a mean reward of $0.099 \pm 0.011$, outperforming both vanilla DPO ($-0.001 \pm 0.011$) and SFT ($-0.026 \pm 0.011$).
  • Performance on Ambiguous Data: On the 50 test prompts with the highest response uncertainty:
  • Vanilla DPO score dropped to $-0.271 \pm 0.012$.
  • Multiplication (10% and 30%) maintained substantially higher quality at $-0.069 \pm 0.014$ and $-0.083 \pm 0.012$, respectively.
  • Sampling Temperature Robustness: When sweeping temperature from 0.25 to 1.25, vanilla DPO experienced steep performance drops, whereas the Energy Factor models produced consistently flatter, higher-reward curves.

Limitations and Future Work

  • Model Scale: Validation was limited to GPT-2 Medium (355M parameters). Testing on modern LLM scales (7B+ parameters) is necessary to assess scalability.
  • Ensemble Overhead: Relying on an ensemble of reward models adds computational overhead, partially offsetting DPO’s key advantage of being reward-model-free.
  • Reward Model Ceiling: The reward model ensemble achieved only 67% test accuracy on Anthropic-HH, which may introduce noise into the uncertainty estimates themselves.
  • Future Directions: The paper sketches reward-model-free formulations (using LLM predictive entropy or Bayesian LoRA) and derivations for IPO, leaving their empirical implementation for future work.

Summary updated

BibTeX
@inproceedings{houliston2024uncertainty,
  author = {Sam Houliston and Alizée Pace and Alexander Immer and Gunnar Ratsch},
  title = {{Uncertainty-Penalized Direct Preference Optimization}},
  booktitle = {AFM @ NeurIPS},
  year = {2024},
  url = {https://openreview.net/forum?id=Nnw3kDgB8o},
}
Figure