kefirski.me
ICLRPaper 1120259 min read

Learn Your Reference Model for Real Good Alignment

Freezing the reference model is a quiet cause of overoptimization in offline alignment. Updating it during training, softly or by periodic reset, gives better models at every scale we tried.

The anchor problem in offline alignment

Alignment starts from a bargain: make the model produce what people prefer, but keep it close to a trusted starting point. The classic objective maximizes reward under a KL penalty, maxπθE[rϕ(x,y)]βDKL[πθπref]\max_{\pi_\theta}\,\mathbb{E}\left[r_\phi(x,y)\right]-\beta\,\mathbb{D}_{\mathrm{KL}}\left[\pi_\theta\,\|\,\pi_{\mathrm{ref}}\right], where the reference πref\pi_{\mathrm{ref}} is usually the supervised fine-tuned model. Offline methods fold the reward away and train directly on preference pairs.

DPO is the workhorse of that family. For a prompt xx with a preferred completion ywy_w and a rejected one yly_l, it pushes the policy's preference margin past the reference's:

LDPO=E(x,yw,yl)D[logσ ⁣(βlogπθ(ywx)πref(ylx)πref(ywx)πθ(ylx))]\mathcal{L}_{\mathrm{DPO}}=-\,\mathbb{E}_{(x,y_w,y_l)\sim\mathcal{D}}\left[\log\sigma\!\left(\beta\log\frac{\pi_{\theta}(y_w|x)\,\pi_{\mathrm{ref}}(y_l|x)}{\pi_{\mathrm{ref}}(y_w|x)\,\pi_{\theta}(y_l|x)}\right)\right]

IPO and KTO reshape the same ingredients, and all three share one convention: πref\pi_{\mathrm{ref}} stays frozen for the entire run. All three also share a failure mode. Model quality rises, then falls, as the KL divergence from the reference grows, even though no reward model exists to hack. Rafailov and colleagues traced this offline overoptimization to probability mass escaping onto out-of-domain text.

Why a frozen reference stalls training

The DPO gradient is scaled by σ(s)\sigma(s), where ss measures how far the policy's log-preference margin has moved past the reference's. At the start s0s\approx 0 and updates are strong. As training widens the margin, ss drifts negative and σ(s)\sigma(s) decays toward zero, and we show the Hessian decays with it. The loss landscape flattens exactly where the model has moved furthest.

Here is the trap. In practice the probabilities of chosen and rejected completions both fall during DPO training, an effect Pal and colleagues documented. A probability distribution has to put that mass somewhere, so it flows onto sequences the training data never mentions. Once the curvature has vanished, there is no force left to pull it back.

Where the probability goes

Toy MDP, 100 seeds
Our smallest reproduction of overoptimization: a three-action MDP, an RNN policy, one preference pair. Vanilla DPO drains both in-domain sequences and the mass surfaces out of domain; updating the reference keeps it in domain. IPO behaves like DPO here; KTO resists in the toy but benefits on real tasks.

We can watch this happen in a system small enough to enumerate: a depth-three MDP with three actions per state and an RNN policy. We fine-tune on three trajectories, then align with the single pair (a1,a1,a0)(a0,a0,a0)(a_1,a_1,a_0)\succ(a_0,a_0,a_0), averaging 100 seeds. DPO steadily inflates the seven trajectories neither dataset contains. The same run with an updated reference inflates the chosen trajectory instead.

Let the anchor walk

Our fix is to move the reference during training, the way trust-region optimizers re-center their constraint on the current iterate. The soft variant merges the policy into the reference at every step, πrefαπθ+(1α)πref\pi_{\mathrm{ref}}\leftarrow\alpha\,\pi_\theta+(1-\alpha)\,\pi_{\mathrm{ref}}, under a stop-gradient. The hard variant simply copies, πrefπθ\pi_{\mathrm{ref}}\leftarrow\pi_\theta, every τ\tau steps. Setting α=0\alpha=0 recovers the vanilla method exactly.

Three ways to hold the reference

The mechanism
The preference loss always leashes the policy to the reference; what changes is whether the anchor moves. Weight averaging is justified here because policy and reference start from identical parameters.

The recipe applies to any offline method that keeps an implicit closeness constraint, so we get TR-DPO, TR-IPO, and TR-KTO for free. The price is small: keeping and refreshing the reference adds between 2.9 and 7.4 percent to training time across the three methods, with hard updates the cheaper option.

The update rate has a cliff on each side

How fast should the anchor walk? We swept α\alpha and τ\tau with Pythia 2.8B on Anthropic-HH, judging side-by-side against the frozen-reference baseline with GPT-4. We report the net preference margin, wins minus losses, so zero means no better than the vanilla method.

Net preference vs the frozen baseline, sweeping α

-100 to 16
0.10.20.30.40.50.60.70.8
TR-DPO+2.2+1.4+1.8+5.4+7.4+10.0+6.6-2.4
TR-IPO+4.8+8.6+9.0+13.4+14.0+8.8+14.6-13.6
TR-KTO-67.6-61.8-62.0+0.6-1.2+3.0-61.2-80.0
Wins minus losses against the frozen baseline on Anthropic-HH with Pythia 2.8B; brighter is better. DPO and IPO peak around α of 0.5 to 0.7 and only collapse at 0.8. KTO tolerates a far narrower band: outside α of 0.4 to 0.6 it loses catastrophically.

Net preference vs the frozen baseline, sweeping τ

-100 to 16
641282565121024
TR-DPO-21.4-0.2+6.0+7.6+8.2
TR-IPO-21.8+11.6+10.2+13.2+7.6
TR-KTO-85.4-19.4-4.4+6.8-67.2
Updating too often is worse than not updating at all: at τ of 64 every method loses to its baseline, TR-KTO by 85 points. DPO and IPO recover by τ of 256; KTO needs 512 and falls off a cliff again at 1024.

Both extremes fail for a reason. Update too often and the leash chases the policy so closely that nothing constrains it, which is where TR-KTO posts its worst number, a margin of 85.4-85.4 at τ=64\tau=64. Update too rarely and you are back to the frozen anchor. We found α=0.9\alpha=0.9 and τ<16\tau<16 outright unstable, and the gains at α\alpha of 0.5 to 0.6 and τ=512\tau=512 are the statistically significant ones under probability-of-improvement analysis.

It transfers to real assistants

The sweep used a 2.8B model and one dialogue dataset, so the test that matters is a modern assistant setup. On Llama3-Base 8B, trained on UltraChat and aligned on UltraFeedback, the Trust Region versions beat every vanilla method on AlpacaEval 2 length-controlled win rate, with α=0.8\alpha=0.8 and τ=32\tau=32 chosen for this setting.

AlpacaEval 2 on Llama3-Base, length-controlled

LC win rate, %
vanillaTR soft (α)TR hard (τ)
AlpacaEval 2 on Llama3-Base, length-controlled Length-controlled win rates with GPT-4 as judge; the SFT starting point scores 8.5. TR-IPO doubles its baseline. On Arena-Hard the same models gain 5.4, 3.3, and 2.4 points over DPO, IPO, and KTO respectively. DPO: vanilla 18.2; TR soft 27.3; TR hard 27.7 IPO: vanilla 14.4; TR soft 29.5; TR hard 28.1 KTO: vanilla 14.2; TR soft 14.7; TR hard 16.5 08162432 18.2vanilla: DPO, 18.227.3TR soft: DPO, 27.327.7TR hard: DPO, 27.7DPO14.4vanilla: IPO, 14.429.5TR soft: IPO, 29.528.1TR hard: IPO, 28.1IPO14.2vanilla: KTO, 14.214.7TR soft: KTO, 14.716.5TR hard: KTO, 16.5KTO LC win rate, %
Length-controlled win rates with GPT-4 as judge; the SFT starting point scores 8.5. TR-IPO doubles its baseline. On Arena-Hard the same models gain 5.4, 3.3, and 2.4 points over DPO, IPO, and KTO respectively.

Llama3-Instruct 8B, both benchmarks

MethodAlpacaEval 2 LC %Arena-Hard WR %
SFT24.919.1
DPO40.332.6
TR-DPO, soft43.534.7
TR-DPO, hard42.832.4
IPO35.630.5
TR-IPO, soft43.633.8
TR-IPO, hard42.634.5
KTO33.126.4
TR-KTO, soft37.929.2
TR-KTO, hard41.330.9
In the Instruct setting, where preference pairs come from the model's own ranked generations, every Trust Region variant improves on its base method on both benchmarks.

Task-specific results agree. On Reddit TL;DR with Pythia 6.9B, updating the reference improves side-by-side win rates by 8.4 points for DPO, 14.3 for IPO, and 15 for KTO. And the overoptimization analysis closes the loop: at matched KL divergence from the SFT policy, our variants score higher on coherence, correctness, detail, helpfulness, and harmlessness, and hold that advantage at matched generation diversity as well.

What it costs and where it bends

The honest reading of the sweeps is that α\alpha and τ\tau are real hyperparameters. Good defaults exist, near α=0.6\alpha=0.6 and τ=512\tau=512 for the task-specific runs, but the optimum shifted to α=0.8\alpha=0.8 and τ=32\tau=32 on Llama3, and KTO punishes a bad setting harshly. Tuning bought us further gains; skipping the tuning can cost more than the method gives.

Two caveats frame the result. Very large τ\tau means few updates on small datasets, so the hard variant may not scale down gracefully, and adaptive schedules look like the natural next step. And all our judgments flow through GPT-4 as a proxy evaluator, on AutoSxS, AlpacaEval 2, and Arena-Hard alike, so the field's open question about judge reliability applies to us too.

The reference policy works better as a moving trust region than as a frozen anchor: walk it forward at the right pace and offline alignment stops fighting itself.