Search

Search papers and lessons

A General Theoretical Paradigm to Understand Learning from Human Preferences

Mohammad Gheshlaghi Azar, Mark Rowland, Bilal Piot et al. · 2023

The paper gives one objective for learning from pairwise preferences, shows RLHF and DPO are special cases that can overfit, and proposes IPO, a squared loss that avoids this.

On this page

  • Colour = topic mix
  • Reinforcement learning
  • Probability
  • Discrete math
  • Calculus
  • Linear algebra
  • Neural network basics
  • ReadReady to readNot yet

TL;DR

The paper gives one general objective, called ΨPO, for learning a policy from pairwise human preferences. Standard RLHF and DPO are special cases of it, and the paper shows that both can overfit when the preferences are close to deterministic. It then sets the free function to the identity. The result is IPO, a simple squared loss that learns directly from preference pairs and keeps the policy close to its reference.

Builds on: DPO, Reward Model, Bradley–Terry Model, Kullback–Leibler Divergence · Leads to: SimPO, a later reference-free preference method

Why it mattered

DPO became a common way to tune language models on preference pairs without a reinforcement-learning loop (see Direct Preference Optimization). It was attractive because it was simpler than RLHF, but its theory was thin. This paper supplied the missing analysis. It showed that DPO and RLHF are two special cases of one objective, and it identified a concrete failure of DPO: when one answer always wins, DPO drives the policy to a deterministic answer whatever the strength of the regularisation. The paper proposes IPO as a fix and tests it on small bandit problems. The authors state that scaling these experiments to training language models on human preference data is future work, so this lesson does not claim that IPO has been shown to work at that scale.

The problem

Preferences come from people. Given a prompt, a person sees two answers and says which one is better. The model should then prefer the better answers, while staying close to a trusted reference model so that it does not drift into strange text. The paper names two approximations that practical methods rely on:

  1. Pairwise preferences can be replaced by pointwise scores, called rewards, through the Bradley-Terry model.
  2. A reward model fitted to those scores generalises to answers that the policy itself produces.

RLHF uses both approximations. DPO removes the second by training the policy directly, but it keeps the first. The paper's concern is the first one. When the labels are always 0 or 1, the Bradley-Terry model can only fit them by pushing the score gap to infinity. The regularisation term then stops mattering, and the policy overfits the labels.

Notation used below follows the DPO paper. A prompt is xx, an answer is yy, πref\pi_{\text{ref}} is the reference policy, and τ>0\tau \gt 0 is the regularisation strength. The DPO lesson calls the same strength β\beta.

How it works

Take one prompt with two answers, y1y_1 and y2y_2. People always prefer y1y_1, so the true preference is p∗(y1≻y2)=1p^{*}(y_1 \succ y_2) = 1. The reference policy and the data-generating policy μ\mu are both uniform, so each answer has probability 0.5. Use τ=1\tau = 1.

  1. Score each answer against the data. An answer's score g(y)g(y) is its average win probability against answers drawn from μ\mu. An answer compared with itself counts as a coin toss, 0.5. So g(y1)=0.5×0.5+0.5×1=0.75g(y_1) = 0.5 \times 0.5 + 0.5 \times 1 = 0.75, and g(y2)=0.5×0.5+0.5×0=0.25g(y_2) = 0.5 \times 0.5 + 0.5 \times 0 = 0.25. Check: the two scores average to 0.5, as they must for two answers with equal chances under μ\mu.

  2. Find the best policy for the regularised objective. The optimum multiplies the reference probability of each answer by exp⁡(g(y)/τ)\exp(g(y)/\tau) and renormalises. The weights are exp⁡(0.75)≈2.117\exp(0.75) \approx 2.117 and exp⁡(0.25)≈1.284\exp(0.25) \approx 1.284, which sum to 3.4013.401. So π∗(y1)=2.117/3.401≈0.622\pi^{*}(y_1) = 2.117 / 3.401 \approx 0.622 and π∗(y2)≈0.378\pi^{*}(y_2) \approx 0.378. Check: the two add to 1.

  3. Turn the optimum into a target gap. At the optimum, the log ratio of the two answers equals (g(y1)−g(y2))/τ(g(y_1) - g(y_2)) / \tau. Here that is 0.5/1=0.50.5 / 1 = 0.5. Check: log⁡(0.622/0.378)≈log⁡(1.646)≈0.5\log(0.622 / 0.378) \approx \log(1.646) \approx 0.5.

  4. Write a loss that can be trained from labelled pairs. Let hh be the log ratio of the chosen answer to the rejected one, measured against the reference. For one observed pair, the IPO loss is (h−12τ)2(h - \tfrac{1}{2\tau})^2. Here 12τ=0.5\tfrac{1}{2\tau} = 0.5. The loss is zero when h=0.5h = 0.5, which means π(y1)/π(y2)=e0.5≈1.649\pi(y_1)/\pi(y_2) = e^{0.5} \approx 1.649. Check: that ratio gives π(y1)≈0.622\pi(y_1) \approx 0.622, the same answer as step 2.

  5. Compare with DPO on the same pair. DPO's loss, −log⁡σ(τh)-\log \sigma(\tau h), decreases as hh grows and never reaches a minimum at a finite hh. So DPO keeps pushing π(y1)\pi(y_1) toward 1, for any τ\tau. IPO stops at a finite gap that depends on τ\tau.

The plot shows how the optimal probability of y1y_1 depends on the regularisation strength in this example.

0.511.522.530.50.60.70.80.91tau (regularisation strength)pi(y1)
  • optimal pi(y1) under IPO
Strong regularisation (large tau) keeps the policy near uniform. Weak regularisation (small tau) lets it approach the deterministic answer.
flowchart LR
  D[Labelled pairs of answers] --> P[Preference scores against the data distribution]
  P --> T[Target log-ratio gap, scaled by 1 over tau]
  T --> L[Squared loss on the observed pairs]
  L --> U[Update the policy toward the target]

The math

Write p∗(y≻y′∣x)p^{*}(y \succ y' \mid x) for the probability that answer yy is preferred to y′y' given the prompt xx, and μ\mu for the data-generating policy.

Step 1 in symbols: total preference

The expected preference of an answer yy over the distribution μ\mu is

p∗(y≻μ∣x)=Ey′∼μ(⋅∣x)[p∗(y≻y′∣x)].p^{*}(y \succ \mu \mid x) = \mathbb{E}_{y' \sim \mu(\cdot \mid x)}\big[p^{*}(y \succ y' \mid x)\big].

In step 1 this was g(y)g(y) for the two-answer example, with p∗(y1≻μ)=0.75p^{*}(y_1 \succ \mu) = 0.75. It replaces the reward r(x,y)r(x, y) with a quantity that comes straight from pairwise labels.

Step 2 in symbols: the ΨPO objective and its optimum

The paper's general objective is

max⁡π Ex∼ρ, y∼π(⋅∣x), y′∼μ(⋅∣x)[Ψ(p∗(y≻y′∣x))]−τ DKL(π ∥ πref),\max_{\pi} \ \mathbb{E}_{x \sim \rho,\ y \sim \pi(\cdot \mid x),\ y' \sim \mu(\cdot \mid x)}\big[\Psi\big(p^{*}(y \succ y' \mid x)\big)\big] - \tau \, D_{\text{KL}}(\pi \,\|\, \pi_{\text{ref}}),

where Ψ\Psi is any non-decreasing function. Define g(y)=Ey′∼μ[Ψ(p∗(y≻y′))]g(y) = \mathbb{E}_{y' \sim \mu}[\Psi(p^{*}(y \succ y'))]. Its optimum is

π∗(y)∝πref(y)exp⁡ ⁣(τ−1g(y)).\pi^{*}(y) \propto \pi_{\text{ref}}(y) \exp\!\big(\tau^{-1} g(y)\big).

Two choices matter. With Ψ(q)=log⁡q1−q\Psi(q) = \log\frac{q}{1-q} and the Bradley-Terry model true, the optimum matches RLHF and DPO. With Ψ\Psi the identity, g(y)=p∗(y≻μ)g(y) = p^{*}(y \succ \mu), which is the IPO case. Since p∗p^{*} lies in [0,1][0, 1], this gg is bounded, and the regularisation keeps its effect.

Step 3 in symbols: the root-finding form

Let hπ(y,y′)=log⁡π(y) πref(y′)π(y′) πref(y)h_\pi(y, y') = \log \dfrac{\pi(y)\, \pi_{\text{ref}}(y')}{\pi(y')\, \pi_{\text{ref}}(y)}. Taking logs of the optimum gives

h∗(y,y′)=τ−1(g(y)−g(y′)).h^{*}(y, y') = \tau^{-1}\big(g(y) - g(y')\big).

For IPO this is τ−1(p∗(y≻μ)−p∗(y′≻μ))\tau^{-1}\big(p^{*}(y \succ \mu) - p^{*}(y' \succ \mu)\big). The paper turns these equations into one loss:

L(π)=Ey,y′∼μ[(hπ(y,y′)−τ−1(p∗(y≻μ)−p∗(y′≻μ)))2].L(\pi) = \mathbb{E}_{y, y' \sim \mu}\Big[\big(h_\pi(y, y') - \tau^{-1}\big(p^{*}(y \succ \mu) - p^{*}(y' \succ \mu)\big)\big)^2\Big].

The optimum π∗\pi^{*} makes LL zero. The paper's Theorem 2 shows that, when the support of μ\mu equals the support of πref\pi_{\text{ref}}, π∗\pi^{*} is the unique minimiser among policies with that same support, and the loss is convex in the logits.

Step 4 in symbols: the sampled loss

The true p∗p^{*} is unknown, but each observed label is a sample: I(y,y′)=1I(y, y') = 1 if yy won, else 0, with mean p∗(y≻y′)p^{*}(y \succ y'). The paper shows that replacing p∗p^{*} with these labels changes the loss only by a constant that does not depend on π\pi. Each labelled pair (yw,yl)(y_w, y_l) then contributes two terms, one with label 1 for (yw,yl)(y_w, y_l) and one with label 0 for (yl,yw)(y_l, y_w). Because hπ(yl,yw)=−hπ(yw,yl)h_\pi(y_l, y_w) = -h_\pi(y_w, y_l), averaging the two terms gives the final form:

LIPO(π)=E(x,yw,yl)∼D[(log⁡π(yw∣x)π(yl∣x)−log⁡πref(yw∣x)πref(yl∣x)−12τ)2].\mathcal{L}_{\text{IPO}}(\pi) = \mathbb{E}_{(x, y_w, y_l) \sim \mathcal{D}}\left[\left(\log \frac{\pi(y_w \mid x)}{\pi(y_l \mid x)} - \log \frac{\pi_{\text{ref}}(y_w \mid x)}{\pi_{\text{ref}}(y_l \mid x)} - \frac{1}{2\tau}\right)^2\right].

The loss is a squared difference of log ratios, and training pulls that difference to 12τ\tfrac{1}{2\tau}. Weaker regularisation (small τ\tau) raises the target, but the target stays finite.

Step 5 in symbols: why DPO overfits

The DPO loss is

LDPO(π)=−E[log⁡σ ⁣(τlog⁡π(yw∣x)πref(yw∣x)−τlog⁡π(yl∣x)πref(yl∣x))].\mathcal{L}_{\text{DPO}}(\pi) = -\mathbb{E}\left[\log \sigma\!\left(\tau\log\frac{\pi(y_w \mid x)}{\pi_{\text{ref}}(y_w \mid x)} - \tau\log\frac{\pi(y_l \mid x)}{\pi_{\text{ref}}(y_l \mid x)}\right)\right].

Here Ψ\Psi is the unbounded log-odds function. If p∗(y1≻y2)=1p^{*}(y_1 \succ y_2) = 1, the loss keeps decreasing as the gap grows, so the optimal policy puts zero probability on y2y_2 whatever τ\tau is. The paper also shows that a policy's support can grow beyond that of μ\mu and then uniqueness fails (its Appendix A.2), so the support assumption matters.

Results

The paper has no benchmark table for language models. Its results are learning curves on small bandit problems, plus a theorem and proofs.

  • Deterministic preference, two answers. Under DPO the optimal policy is the deterministic one for any τ\tau. Under IPO it is σ(0.5/τ)\sigma(0.5 / \tau), which goes to uniform as τ\tau grows and to the deterministic answer as τ\tau shrinks. This is the example in the walkthrough above.
  • Total ordering, three actions (dataset D1\mathcal{D}_1). The paper reports that DPO always converges to a deterministic policy, whatever τ\tau, so it ignores the reference. IPO avoids the greedy policy when regularisation is strong.
  • One unobserved pair (dataset D3\mathcal{D}_3). One action pair is never compared. DPO ignores the reference prior however strong the regularisation. IPO gradually lowers the probability of the unobserved action as τ\tau changes.
  • Setup. Policies are softmax over three logits, optimised with Adam for 18000 steps, learning rate 0.01, mini-batches of 9, over 10 seeds with 95 percent confidence intervals.

Limits. These are toy settings with a finite action set and no context in the main experiments. The uniqueness result depends on the support assumption, and Appendix A.2 shows that without it there can be many minimisers. The paper's claim is that IPO is better suited to learn from sampled preferences than DPO in these examples. It does not measure text quality or safety.

Common misreadings. RLHF and DPO have the same optimal policy only under the Bradley-Terry assumption and a perfectly fitted reward (Proposition 4 in Appendix B gives the general statement). In practice RLHF's reward model is underfit when labels are 0 or 1, and that underfitting keeps RLHF regularised. DPO has no reward model to underfit, so it loses that regularisation. Bounded Psi fixes the specific failure the paper describes, under its assumptions; it does not remove overfitting in general. The paper does not show IPO beating DPO on language models.

Reading guide

Check yourself

QuestionWhat role does the function Psi play in the general objective, and which choices give RLHF/DPO and IPO?Show answer

Psi is applied to the pairwise preference probability inside the objective. It is any non-decreasing function. The log-odds choice Psi(q) = log(q/(1-q)) gives RLHF and DPO, under the Bradley-Terry model. The identity choice gives IPO.

QuestionTwo answers, reference and mu uniform, p*(y1 beats y2) = 1, and tau = 0.5. Under IPO, what is the optimal probability of y1?Show answer

Compute the preference scores: g(y1) = 0.75 and g(y2) = 0.25, so the gap is 0.5. The weights are exp(0.75 / 0.5) = exp(1.5) ≈ 4.482 and exp(0.25 / 0.5) = exp(0.5) ≈ 1.649. Their sum is 6.131, so the probability is 4.482 / 6.131 ≈ 0.731. This equals sigma(1), as the closed form sigma(0.5 / tau) predicts.

QuestionWhy does DPO push the probability of an always-winning answer to 1, whatever the regularisation strength?Show answer

DPO's loss is minus the log of a sigmoid of the scaled log-ratio gap. That gap can grow without bound, and the loss keeps falling as it grows, so it has no minimum at a finite gap. The bounded identity choice of Psi in IPO gives a finite target instead, 1 over 2 tau, and that target is what keeps the policy near the reference.

QuestionA team has 20 comparisons where answer A beats answer B every time, and a strong reference model. Which method is the paper predicting will keep the policy closer to the reference, and why?Show answer

IPO. DPO's loss has no finite minimiser when labels are deterministic, so it drives A's probability toward 1 regardless of the regularisation. IPO's loss pulls the log-ratio gap to 1 over 2 tau, so a strong regularisation keeps the policy near the reference. The paper's evidence is toy bandit experiments, not a test on real language-model data.

Sources

Read the full paper

Mohammad Gheshlaghi Azar, Mark Rowland, Bilal Piot et al., 2023. arXiv:2310.12036