Log inStart free
LESSON 12.08 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

DPO and its variants

Watch a policy learn straight from ranked pairs of answers, with no reward model.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 12.08 · PREFERENCE BAY4 PAIRS · π_REF PREFERS ✗ IN 2 OF 4
01
Stage 1 of 6 · Preference pairs
Each prompt has a chosen ✓ and a rejected ✗ answer. The reference policy π_ref prefers ✗ in prompts 3 and 4.
Explain it simply

You see the four prompts from the reward model lesson. Each one has a chosen answer with a tick and a rejected answer with a cross. The dashed bars show how often the untuned model gives each answer. In prompts 3 and 4 it likes the cross answer more.

Four prompts, each with four answers: one chosen, one rejected and two without a label. A dashed bar shows each answer's reference probability. The reference prefers the rejected answer in prompts 3 and 4.

prompts, answersweightsπ, u, rewardwrong token, loss, KLdashed: π_ref, unlabelled answers
prompts and answersπ_ref1 2 + 3 =2 Capital of France?3 Opposite of hot?4 7 × 6 =✓Itis5.0.30✗60.20?50.35?Sure,itis6,thanks!0.15✓Sure!Paris.0.25✗IthinkitisRome.0.15?Paris0.45?Lyon,thanks.0.15✓Itiscold,thanks.0.25✗Cold.0.30?Warm,sure.0.15?Hot0.30✓Sure,42.0.20✗Itis48,thanks.0.30?420.25?Ithinkitis48.0.25prompts and answersπ_ref1 2 + 3 =2 Capital of France?3 Opposite of hot?4 7 × 6 =✓Itis5.0.30✗60.20?50.35?Sure,itis6,thanks!0.15✓Sure!Paris.0.25✗IthinkitisRome.0.15?Paris0.45?Lyon,thanks.0.15✓Itiscold,thanks.0.25✗Cold.0.30?Warm,sure.0.15?Hot0.30✓Sure,42.0.20✗Itis48,thanks.0.30?420.25?Ithinkitis48.0.25
Toy: 4 prompts, 4 answers each, 1 ranked pair per prompt
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
πref(y∣x),yw=✓, yl=×\sy{ref}{out}{\pi_{\text{ref}}(y \mid x)},\quad y_w = \checkmark,\ y_l = \times
πref(yw)=0.25, πref(yl)=0.30 (prompt 3)\pi_{\text{ref}}(y_w) = 0.25,\ \pi_{\text{ref}}(y_l) = 0.30 \text{ (prompt 3)}

The reference policy gives each answer a probability.

Common mix-ups

MYTHDPO trains a policy without any reward.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01At 50 DPO steps, does β = 2 keep π closer to π_ref than β = 0.5?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.