Chapter 04 · Preference optimization

RLHF, KL control & Constitutional AI

How a learned reward, a leash to the reference model and a written constitution turned base models into assistants. Covers the closed-form optimum behind the KL penalty, the evidence on what RLHF does well and badly, and what has changed by 2026.

⏱ 55 min9 interactivesPrereq: Ch. 02 (PPO), Ch. 03 (reward models)
In one breath
  • RLHF has three stages: SFT, then a reward model fit to human comparisons, then RL (usually PPO) that maximizes reward minus a KL penalty to the SFT model. The lineage runs Christiano 2017 → Ziegler 2019 → Stiennon 2020 → InstructGPT and Anthropic's HH-RLHF in 2022.
  • The KL-regularized objective has a closed-form optimum, $\pi^*\propto\piref\,e^{r/\beta}$. It is a Bayesian posterior: prior = reference model, likelihood = $e^{r/\beta}$. $\beta$ sets how far you trust the reward model.
  • Reward grows roughly linearly in $\sqrt{\mathrm{KL}}$ (HH-RLHF). The KL budget is the currency of RLHF, and a proxy reward eventually turns against the true one as you spend it. The KL penalty does not move that frontier; it chooses where on it you stop.
  • The KL anchor makes it impossible to invent outputs the reference never produces, but cheap to abandon modes. So RLHF still causes diversity loss, calibration loss (GPT-4: ECE 0.007 → 0.074), verbosity drift and sycophancy.
  • Constitutional AI replaces human harmlessness labels with AI labels guided by written principles: critique → revision → SFT, then RL from AI preferences. It moved the helpful–harmless frontier outward, producing assistants that were harmless without being evasive. By 2026 Claude's constitution is a long document that explains its reasons, and it shapes training well beyond pairwise labels.

§1Where RLHF came from

RLHF was not invented for chatbots. It began as a way to teach a simulated robot a backflip that nobody could write a reward function for, and became the standard recipe for language models over five years.

The core problem is old: many behaviors we want are easy to recognize and very hard to specify. You cannot write down a reward function for "a good summary" or "a helpful but safe answer". You can, however, look at two candidates and say which is better. Reinforcement learning from human feedback uses that asymmetry. Fit a model of human judgments, then optimize a policy against the model.

Analogy: the optometrist

"Better with lens one, or lens two?" You could never tell the optometrist your prescription in diopters, but a few dozen binary comparisons pin it down. Preference learning works the same way: humans give comparisons, and a model turns them into a scalar that an optimizer can climb.

Where it breaks: your eye has a true prescription that the comparisons converge to. Human values don't, comparisons are noisy and inconsistent across people, and, unlike an optometrist, an RL policy will actively look for lenses that fool you into saying "better".

Click any milestone (or use the arrows). Colors mark the thread: gold = KL control, pink = learning from preferences, clay = RLHF for LMs, violet = theory, teal = AI feedback & constitutions, red = failure modes. Notice how early the two load-bearing ideas appear: the KL anchor (2016) and online reward-model refresh (2017).

Christiano et al. 2017: preferences instead of rewards

Deep RL from human preferences (Christiano, Leike, Brown, Martic, Legg, Amodei) had humans compare pairs of short video clips of an agent's behavior. A reward predictor $\hat r$ was fit so that the probability of preferring clip $\sigma^1$ over $\sigma^2$ follows a Bradley–Terry model on summed predicted rewards:

$$P[\sigma^1\succ\sigma^2]=\frac{\exp\sum_t\hat r(o^1_t,a^1_t)}{\exp\sum_t\hat r(o^1_t,a^1_t)+\exp\sum_t\hat r(o^2_t,a^2_t)}.$$

The agent learned Atari games and MuJoCo locomotion with feedback on fewer than 1% of its interactions, and a Hopper learned a backflip from 900 queries in under an hour of human time. Two lessons from this paper still govern RLHF in 2026:

Ziegler et al. 2019: the KL penalty arrives in language

Fine-Tuning Language Models from Human Preferences applied the recipe to GPT-2 (774M) on stylistic continuation (5,000 comparisons were enough) and summarization (60,000). It also introduced the per-sample reward still used today:

$$R(x,y)=r(x,y)-\beta\log\frac{\pi(y\mid x)}{\rho(y\mid x)},$$

where $\rho$ is the pretrained model. The authors explain the KL term as an entropy bonus that also keeps the policy where the reward model is valid. Rather than fix $\beta$, they adapted it with a proportional controller aiming at a KL target (6 nats for descriptiveness, 10 for sentiment; §4). Two anecdotes from this paper are worth knowing:

Stiennon et al. 2020: RLHF beats the humans who wrote the references

Learning to summarize from human feedback scaled the pipeline (1.3B and 6.7B policies, a released set of 64,832 TL;DR comparisons, $\beta=0.05$). The 6.7B RLHF summaries were preferred to the human-written reference summaries about 65% of the time after controlling for length, and they transferred to news articles without news-specific training. It also gave the first clear picture of over-optimization. As the policy was pushed further from the SFT model, the reward model's score kept rising while human preference first rose, then fell, until the RM was "anti-correlated with human preferences". Chapter 03 covers the scaling laws for this effect. Here what matters is the consequence: the KL distance from the reference becomes the quantity you budget.

InstructGPT (Ouyang et al. 2022): the canonical three stages

Training language models to follow instructions with human feedback is the paper most people mean by "RLHF". About 40 contractors produced the data. The prompts came from the OpenAI API Playground and from the labelers themselves.

  1. SFT on labeler demonstrations (~13k prompts).
  2. Reward model (6B) trained on rankings of $K=4\ldots9$ completions per prompt (~33k prompts). All $\binom K2$ pairs from one prompt go into a single batch element. Shuffling them as independent pairs made the RM overfit, since every completion appears in $K-1$ pairs. They used 6B rather than 175B because 175B RM training was less stable as an initialization for the PPO value function, and much more expensive.
  3. PPO against the RM (~31k prompts, 256k episodes), with a per-token KL penalty ($\beta=0.02$) and, in the PPO-ptx variant, a pretraining log-likelihood term.
$$\mathrm{objective}(\phi)=\htmlClass{t-e}{\E_{(x,y)\sim D_{\pi^{RL}_\phi}}}\Big[\htmlClass{t-r}{r_\theta(x,y)}-\htmlClass{t-b}{\beta}\,\htmlClass{t-kl}{\log\frac{\pi^{RL}_\phi(y\mid x)}{\pi^{SFT}(y\mid x)}}\Big]+\htmlClass{t-g}{\gamma}\,\htmlClass{t-pt}{\E_{x\sim D_{\mathrm{pretrain}}}\big[\log\pi^{RL}_\phi(x)\big]}$$
  • On-policy expectation: prompts from the RL set, completions sampled from the current policy.
  • Reward model score for the whole completion.
  • Sampled log-ratio: a single-sample estimate of the KL to the SFT model, summed over tokens.
  • β = 0.02: KL coefficient.
  • γ = 27.8: pretraining-gradient weight; γ = 0 is plain "PPO".
  • Pretraining likelihood: keeps the model good at the pretraining distribution and reduces the alignment tax.

Headline results: outputs of the 1.3B InstructGPT were preferred to those of the 175B GPT-3, a model with 100× more parameters. The 175B InstructGPT was preferred to 175B GPT-3 85 ± 3% of the time, and to few-shot-prompted GPT-3 71 ± 4% of the time. Closed-domain hallucination fell from 41% to 21%. Toxicity fell by about 25% when the model was asked to be respectful, but the gap vanished with no instruction. There was no improvement on the Winogender and CrowS-Pairs bias benchmarks.

Key idea: the alignment tax

RLHF can cost capability on things the reward model never looked at. InstructGPT's PPO models regressed on SQuAD, DROP, HellaSwag and WMT'15 French→English. Mixing pretraining gradients back in (PPO-ptx) recovered most of it, even surpassing GPT-3 on HellaSwag, but still lagged on DROP, SQuADv2 and translation. Anthropic's HH paper (§6) found the tax mostly at small scale. Later work found that simply averaging weights between the pre- and post-RLHF models gave the best alignment-vs-forgetting Pareto front among the methods tried (Lin et al. 2024).

In InstructGPT's PPO-ptx objective, what does the γ term do that the KL term cannot?
The KL term only constrains the policy on the RL prompt distribution, using samples from the policy itself. Capabilities exercised elsewhere (reading comprehension, translation) can drift freely. The γ term trains on a different distribution, which is why it reduces the alignment tax.

§2The RLHF loop, step by step

One PPO iteration of RLHF involves four networks (policy, value head, reward model, reference) and two loops running at different speeds: a fast one over gradient steps and a slow one over human labels.

Press Play. The animation follows a batch from prompt to parameter update, then shows the slow outer loop that refreshes the reward model with new human comparisons. After step 5, drag β: the sample with the highest RM score (y₃) is also the furthest from the reference, and at β ≈ 0.12 it stops being the best sample under r − β·KL.

Concretely, for each batch:

  1. Sample prompts $x$; generate $y\sim\pi_\theta(\cdot\mid x)$ with the current policy.
  2. Score $(x,y)$ with the reward model: one scalar, applied at the final token.
  3. Run the frozen reference (the SFT model) on the same tokens and form a per-token penalty $-\beta\log\frac{\pi_\theta(y_t\mid x,y_{\lt t})}{\piref(y_t\mid x,y_{\lt t})}$.
  4. Combine these into per-token rewards, estimate advantages with a value head and GAE, and take a few epochs of clipped PPO steps (the mechanics are in Chapter 02).
import torch

def kl_shaped_rewards(rm_score, logp_pi, logp_ref, mask, beta):
    """Per-token rewards for PPO-RLHF.
    rm_score: [B] scalar RM score per sequence
    logp_pi, logp_ref: [B, T] log-probs of the *sampled* response tokens
    mask: [B, T] 1.0 on response tokens (response left-aligned at t=0)
    """
    kl_tok = (logp_pi - logp_ref) * mask          # k1 estimator, one sample per token
    rewards = -beta * kl_tok                       # dense penalty at every token
    last = mask.sum(dim=1).long() - 1              # index of each sequence's final token
    rewards[torch.arange(rewards.size(0)), last] += rm_score   # sparse RM reward at EOS
    return rewards, kl_tok.sum(dim=1)              # per-token rewards, per-sequence KL estimate

Two facts about this snippet are worth knowing. First, summing the per-token log-ratios of a sampled sequence gives exactly $\log\frac{\pi_\theta(y\mid x)}{\piref(y\mid x)}$ for that sequence, by the chain rule. Its expectation under $\pi_\theta$ is the sequence-level $\KL(\pi_\theta(\cdot\mid x)\,\|\,\piref(\cdot\mid x))$. So the "token-level" and "sequence-level" KL penalties are the same objective with different credit assignment. Second, the per-token form lets the value function attribute the penalty to the specific tokens that drifted, which reduces variance compared with dumping the whole penalty at the end.

Pitfall: the four-model memory bill

Policy, reference, reward model and value head all need forward passes, and the policy and value head need backward passes too. This is why InstructGPT used a 6B RM and value function for a 175B policy, and why the field moved toward critic-free estimators (RLOO, GRPO, Chapter 06) and toward computing the reference log-probs once per batch in the inference engine (Chapter 07).

§3The KL-regularized objective and its closed form

Behind the PPO machinery is a simple optimization problem with an exact answer. Knowing that answer is what turns RLHF from a recipe into something you can reason about.

Drop the function approximation and ask: over all conditional distributions $\pi(\cdot\mid x)$, which one maximizes

$$J(\pi)=\E_{x\sim D}\Big[\E_{y\sim\pi(\cdot\mid x)}[r(x,y)]-\beta\,\KL\big(\pi(\cdot\mid x)\,\|\,\piref(\cdot\mid x)\big)\Big]\;?$$

The objective separates across prompts, so fix $x$. The scrollytelling below walks through the derivation, the Gibbs variational principle, on eight candidate answers.

The prior. The reference model spreads probability over eight candidate answers A–H. Most of its mass is on A–C. G, the best answer, has only 4%.

The evidence. A reward model scores each candidate. G scores highest ($r=2.2$), E next. Nothing yet says how far to move toward them.

The objective. $J(\pi)=\E_\pi[r]-\beta\,\KL(\pi\|\piref)$. The obvious guess, putting all mass on G, earns $r=2.2$ but pays $\beta\log(1/0.04)\approx 0.7\times3.2$ nats of KL. Its $J$ is slightly negative, worse than doing nothing ($J(\piref)=\E_{\piref}[r]\approx0.52$). Greedy is not optimal.

The trick. Write $\E_\pi[r]-\beta\KL(\pi\|\piref)=\beta\,\E_\pi\!\big[\log\frac{\piref\,e^{r/\beta}}{\pi}\big]$. Divide inside the log by $Z=\sum_y\piref(y)e^{r(y)/\beta}$ and add $\log Z$ back:

$$J(\pi)=-\beta\,\KL\Big(\pi\,\Big\|\,\tfrac{\piref e^{r/\beta}}{Z}\Big)+\beta\log Z.$$

The gold outlines show $\piref e^{r/\beta}$ before normalization.

The answer. $\beta\log Z$ does not depend on $\pi$, and a KL is ≥ 0 with equality iff the two distributions match. So the unique maximizer is

$$\pi^*(y\mid x)=\frac{\piref(y\mid x)\,e^{r(x,y)/\beta}}{Z(x)},\qquad J(\pi^*)=\beta\log Z(x).$$

The policy bars now show $\pi^*$. It shifts mass toward E and G without abandoning the rest.

One knob. As $\beta\to\infty$ the exponent flattens and $\pi^*\to\piref$. As $\beta\to0$, all mass goes to the highest-reward answer in the support of $\piref$. In between is a one-parameter family of policies. Watch β sweep.

The Bayesian reading. Read $e^{r/\beta}$ as the likelihood of an "optimality" event. Then $\pi^*$ is exactly a posterior: prior × likelihood / evidence. Korbak, Perez and Buckley (2022) argue this is the right way to see KL-regularized RL. You are not maximizing reward; you are doing variational inference toward a target distribution.

$$\htmlClass{t-opt}{\pi^*(y\mid x)}=\frac{1}{\htmlClass{t-z}{Z(x)}}\;\htmlClass{t-ref}{\piref(y\mid x)}\;\exp\!\Big(\frac{\htmlClass{t-r}{r(x,y)}}{\htmlClass{t-beta}{\beta}}\Big)\qquad\Longleftrightarrow\qquad \htmlClass{t-r}{r(x,y)}=\htmlClass{t-beta}{\beta}\log\frac{\htmlClass{t-opt}{\pi^*(y\mid x)}}{\htmlClass{t-ref}{\piref(y\mid x)}}+\htmlClass{t-beta}{\beta}\log \htmlClass{t-z}{Z(x)}$$
  • Optimal policy: the target that PPO approximates with a parametric model and samples.
  • Reference: the prior. Its support bounds what π* can ever say.
  • Reward: log-likelihood of "this answer is good", in units of β.
  • β: the temperature. Each unit of reward multiplies odds by e^{1/β}.
  • Partition function: a sum over all strings, intractable. It cancels in pairwise differences, which is DPO's trick (Ch. 05).
The Gibbs variational principle, stated once

For any distribution $p$ and bounded function $f$:

$$\log\E_{y\sim p}\big[e^{f(y)}\big]=\max_{q}\Big\{\E_{y\sim q}[f(y)]-\KL(q\,\|\,p)\Big\},\qquad q^*\propto p\,e^{f}.$$

Proof in one line: $\E_q[f]-\KL(q\|p)=\E_q\big[\log\frac{p\,e^f}{q}\big]=\log Z-\KL(q\,\|\,p e^f/Z)$. RLHF's objective is this with $p=\piref$, $f=r/\beta$, multiplied by β. The same identity gives the free energy in statistical physics (reward ↔ negative energy, β ↔ temperature). It is also the reason $J(\pi^*)=\beta\log Z$ is a "soft maximum": as $\beta\to0$, $\beta\log\E_{\piref}[e^{r/\beta}]\to\max_{y\in\mathrm{supp}\,\piref}r(y)$.

What β means in practice

β converts reward units into nats. A reward gap of Δ between two answers multiplies their probability ratio by $e^{\Delta/\beta}$ relative to the reference. Reward models trained with Bradley–Terry are only defined up to an additive constant per prompt, and their scale depends on training details. So a β value means nothing until you know the RM's scale, which is one reason labs normalize RM outputs (InstructGPT shifted its RM so labeler demonstrations scored 0 on average). Published values span orders of magnitude for this reason: Stiennon 0.05, InstructGPT 0.02, Llama 2 0.01 (7B/13B) and 0.005 (34B/70B), Anthropic's HH-RLHF $\lambda_{KL}=0.001$. Bai et al. called the last "a very small value" that "might actually be wholly unnecessary", since their KL stayed under ~100 nats anyway.

Analogy: the bungee cord

The policy is a jumper tied to the reference by a bungee cord. The reward pulls it toward interesting places. β is the stiffness: a stiff cord keeps it near home, and a slack one lets it go wherever the reward points, including over the cliff edge where the reward model is wrong.

Where it breaks: a real cord resists every direction equally. $\KL(\pi\|\piref)$ is lopsided. It is infinite if the policy goes somewhere the reference assigns zero probability, but it is cheap to stop visiting places the reference liked. §5 shows why this asymmetry is behind mode collapse.

Reward hacking at low β

The closed form makes reward hacking easy to see. If the reward model overrates some rare output by a margin Δ, the tilt multiplies that output's odds by $e^{\Delta/\beta}$. What decides the takeover is not the size of the RM error itself but the hack's proxy-score lead over the best honest answer. In the explorer below, a 3.8-unit error lifts "Confident jargon, wrong" just 0.2 above the next-best proxy score; at β = 0.05 that lead is worth $e^{0.2/0.05}=e^{4}\approx55\times$ in odds, enough for an answer with a 3% prior to take about 86% of the mass. The explorer below uses a real softmax tilt on ten archetypal answers to one prompt. The true reward is what a careful human would say; the proxy is a reward model with the classic biases: it likes length, flattery and confident jargon.

Start at β = 1.5 with the exploitable RM. Lower β: proxy reward rises monotonically, while true reward peaks near β ≈ 0.7 and then collapses as mass floods onto "Confident jargon, wrong" (red labels mark the RM's errors). Switch to "Perfect RM" and the true curve never turns over. The right panel plots both against √KL, the x-axis used in the over-optimization literature.

Even with a perfect RM, very low β is not free. The policy becomes nearly deterministic, and you lose everything §5 is about: diversity, calibration, the ability to sample alternatives. The KL term also does a second job in practice. Every sample PPO trains on comes from the policy, and the RM was trained on samples from earlier policies, so staying close to $\piref$ keeps the RM in distribution (Ziegler et al. and Stiennon et al. both make this point explicitly).

Your reward model gives answer y a reward 2 units higher than answer y′. Under the optimal KL-regularized policy with β = 0.5, how does the ratio π*(y)/π*(y′) compare with πref(y)/πref(y′)?
$\pi^*(y)/\pi^*(y') = \frac{\piref(y)}{\piref(y')}\,e^{(r(y)-r(y'))/\beta}=\frac{\piref(y)}{\piref(y')}e^{2/0.5}$. Z cancels in any ratio, which is also why DPO can work with pairwise data.

RL as Bayesian inference, and why it matters

Korbak, Perez and Buckley (2022) make a conceptual argument with practical consequences. Plain reward maximization, $\max_\pi\E_\pi[r]$, has a degenerate optimum: a point mass on the argmax, which they call distribution collapse. For a generative model that is almost never what you want. With the KL term, the objective equals (up to a constant) $-\beta\,\KL(\pi\,\|\,\pi^*)$, so maximizing it is variational inference, with the policy as a variational approximation to the posterior $\pi^*$. Seen this way:

A question worth asking

"Is RLHF reward maximization?" Not quite: "Under the KL-regularized objective it is equivalent to fitting the posterior $\piref e^{r/\beta}/Z$ in reverse KL, so the target is a distribution and β is its temperature. In practice we also stop early, use a finite-capacity policy and an imperfect RM, so we never reach $\pi^*$. The useful predictions are the qualitative ones: support is bounded by the reference, ratios scale like $e^{\Delta r/\beta}$, and RM errors on rare outputs are amplified exponentially."

§4How far should you move? Reward, √KL and the KL knob

Anthropic's HH paper reported a simple empirical regularity: during RLHF, reward grows roughly linearly in the square root of the KL from the initial policy. It explains why KL is the right x-axis for every RLHF plot.

Anthropic: reward ∝ √KL

Bai et al. (2022) found that "$\sqrt{D_{KL}(\pi\|\pi_0)}$ and reward are approximately linearly related for much of RLHF training", with curves for different model sizes running roughly parallel. They give a perturbative reason: KL begins at quadratic order in a small policy change δπ while reward changes linearly. They suggest using the relation to forecast "how much does the policy need to change to achieve a specific reward", and even to predict a large model's RL result from a small model's RL run plus the large model's zero-shot score.

Derivation: why √KL, along the tilt path

Take the exponential-tilt family $\pi_\lambda\propto\pi_0e^{\lambda r}$ with $\lambda=1/\beta$. (This is my idealization of the training path, not the paper's derivation.) Two standard identities: $\frac{d}{d\lambda}\E_{\pi_\lambda}[r]=\mathrm{Var}_{\pi_\lambda}(r)$, and $\KL(\pi_\lambda\|\pi_0)=\lambda\E_{\pi_\lambda}[r]-\log Z(\lambda)$. Expanding $\log Z(\lambda)=\lambda\mu+\tfrac12\lambda^2\sigma^2+O(\lambda^3)$, where μ and σ² are the mean and variance of $r$ under $\pi_0$:

$$\Delta R\approx\lambda\sigma^2,\qquad \KL\approx\lambda(\mu+\lambda\sigma^2)-\lambda\mu-\tfrac12\lambda^2\sigma^2=\tfrac12\lambda^2\sigma^2\quad\Longrightarrow\quad \Delta R\approx\sqrt{2\,\sigma^2\,\KL}.$$

So the slope of reward against $\sqrt{\mathrm{KL}}$ is $\sqrt2\,\sigma_r$, the spread of rewards under the starting policy. If $r$ is Gaussian under $\pi_0$, the relation is exact at every λ. The curve bends only when the reward distribution's tails stop looking Gaussian: the top of a bounded RM saturates, or (§3) a few rare outputs with inflated scores take over.

Analogy: stretching a spring

KL is the energy stored in a spring; reward is how far you've stretched it. Near equilibrium, energy grows with the square of displacement, so displacement grows with the square root of energy. Doubling the reward gain costs four times the KL.

Where it breaks: springs stay harmonic for a long way. Reward models do not. Far from the reference the "displacement" you measure is increasingly the RM's error rather than real progress.

That bend is what Gao, Schulman and Hilton (2022) measured with a synthetic "gold" reward model labeling data for a proxy. With $d=\sqrt{\KL}$, the gold reward along an RL run fit $R_{RL}(d)=d\,(\alpha_{RL}-\beta_{RL}\log d)$, and best-of-n fit $R_{bon}(d)=d\,(\alpha_{bon}-\beta_{bon}d)$. The best-of-n form is linear at small $d$; the RL form is not (its slope $\alpha_{RL}-\beta_{RL}(1+\log d)$ diverges as $d\to0$, and the authors note it "likely does not hold near the origin"). Both reach a maximum and then decline. Their most practical finding concerns the KL penalty. In their setup it did not improve the gold-reward-vs-KL frontier: the penalty "only causes the gold RM score to converge earlier", "akin to early stopping". They add that this result "could be particularly sensitive to hyperparameters", so treat it as strong evidence, not a law.

Exact natural-policy-gradient training on a 200-output bandit (π starts at πref). The proxy RM = true reward + noise, plus a large error on 3 rare outputs. The faint curves show the full run for the current settings; Train animates it. Defaults: β = 0. Proxy reward first rises along the dashed √(2·Var·KL) line (true reward a little below it, because part of the proxy's variance is RM noise), then the exploit is found and true reward crashes. Now raise β to 0.5: training stops near the true-reward peak. The curve doesn't change shape; you just stop earlier on it, as Gao et al. found. Set the RM error to 0 to see √KL scaling without hacking.

Your RLHF run reaches a reward gain of +1.0 at KL = 4 nats. If reward stays linear in √KL, roughly what KL do you need for +2.0?
Reward ∝ √KL, so doubling reward requires 4× the KL. In practice the RM's reliability decreases over the same range, so the true gain will be less than +2.

KL in the reward or KL in the loss?

There are two common ways to implement "β·KL", and they are not equivalent.

The catch is that an unbiased estimate of the KL's value does not give an unbiased estimate of its gradient. Liu et al. (2025) unify the two views by computing the gradient coefficient each implementation puts on the score function. They show that "k1 in reward" is the principled reverse-KL gradient, that "k2 as loss" ($\tfrac12(\log\rho)^2$) is gradient-equivalent to it on-policy, and that "k3 as loss" is only a first-order, biased approximation. They also point out that off-policy reuse of samples (PPO epochs, async RL) without importance weights on the KL term adds further bias.

A two-line derivation (ours, consistent with their analysis) shows what k3-as-loss actually optimizes. Treat the sampled tokens as fixed and differentiate: $\nabla_\theta k_3=(1-\rho)\,\nabla_\theta\log\pi_\theta$. On-policy,

$$\E_{\pi_\theta}\big[(1-\rho)\nabla_\theta\log\pi_\theta\big]=\underbrace{\E_{\pi_\theta}[\nabla_\theta\log\pi_\theta]}_{=0}-\sum_y\piref(y)\,\nabla_\theta\log\pi_\theta(y)=\nabla_\theta\KL(\piref\,\|\,\pi_\theta).$$

So the expected k3-as-loss gradient is exactly the gradient of the forward KL, while k2-as-loss gives $\E_{\pi_\theta}[\log\frac{\pi_\theta}{\piref}\nabla_\theta\log\pi_\theta]=\nabla_\theta\KL(\pi_\theta\|\piref)$, the reverse KL. Since $1-\rho\approx\log\frac{1}{\rho}$ when $\rho\approx1$, the two agree to first order near the reference and drift apart as the policy moves away. The widget shows the estimators' value-level behavior: what they estimate and with what variance.

Policy π = N(μ, σ²), reference = N(0, 1); 160 samples from π. Red dots are negative estimates. k1 is unbiased but noisy and often negative (the per-token "KL" you log can be below zero). k2 is low-variance but biased. k3 is unbiased and always ≥ 0. Push μ to 2: k2's bias grows, and k3's variance grows with it. Now lower σ below ≈ 0.71, a policy sharper than its reference (the usual post-RLHF situation): Eπ[ρ²] becomes infinite, so k3 has infinite variance and its sample mean usually undershoots, even though it is unbiased.

One more property of k3 matters in practice. Its variance depends on $\E_{\pi}[\rho^2]=\sum_y \piref(y)^2/\pi(y)$, which grows without bound when the policy puts small probability on tokens the reference likes. That is exactly what a sharpened, post-RLHF policy does. For the Gaussians in the widget, the variance is infinite as soon as $\sigma^2\lt\tfrac12$. Per-token KL readings in late training therefore come from heavy-tailed estimates: a few tokens dominate them.

# GRPO-style: KL as a differentiable loss term (k3), reward left untouched
log_rho = logp_ref - logp_pi                 # log(pi_ref / pi_theta) on sampled tokens
k3 = torch.exp(log_rho) - 1.0 - log_rho      # >= 0; unbiased for the per-token KL value
loss = pg_loss + beta * (k3 * mask).sum() / mask.sum()
# On-policy, its expected gradient is grad KL(pi_ref || pi), the FORWARD KL,
# not grad KL(pi || pi_ref) (Liu et al. 2025: a first-order approximation).
# 'k1 in reward' (previous snippet) or 'k2 as loss' give the reverse-KL gradient on-policy.

Fixed β, adaptive β, and moving references

Adaptive KL control. Ziegler et al. treat β as a controller output rather than a hyperparameter. With target $\mathrm{KL}_{\mathrm{target}}$:

$$e_t=\clip\!\Big(\frac{\mathrm{KL}_t-\mathrm{KL}_{\mathrm{target}}}{\mathrm{KL}_{\mathrm{target}}},-0.2,0.2\Big),\qquad \beta_{t+1}=\beta_t\,(1+K_\beta e_t),\quad K_\beta=0.1.$$

This turns the question "what β?" into "what KL budget?". Given the √KL regularity, that is the more natural question: it fixes where on the reward-vs-KL curve you stop.

Moving the anchor. Over a long run, a fixed SFT reference becomes a liability: the KL term grows to dominate the loss and freezes progress. Several fixes move the reference:

The trade-off is clear from §3. Every reset moves the prior, so the cumulative distance from the original SFT model is no longer bounded by any single KL term. Resets buy optimization progress at the price of the guarantee that you remain close to the model whose behavior you understood. In RL with verifiable rewards, where the reward is much harder to hack, many recipes drop the KL term altogether (Ch. 06). With a learned preference RM, that is far riskier.

Pitfall: reading KL off a log without knowing the estimator

"Our KL is 0.3" means nothing until you know: per token or per sequence? k1 (can be negative, noisy), k3 (non-negative), or exact (summed over the vocabulary)? Measured on-policy or on stale samples? Is the reference the SFT model or a moving snapshot? Different stacks (TRL, verl, OpenRLHF) log different quantities under the same name.

§5What the KL anchor fails to prevent

A KL leash keeps the policy from inventing new kinds of output. It does little to stop the policy from narrowing, becoming overconfident, getting longer, or telling people what they want to hear.

Mode collapse: the asymmetry of the leash

Suppose the policy collapses entirely onto one output $y_0$. Its KL cost is

$$\KL(\delta_{y_0}\,\|\,\piref)=\log\frac{1}{\piref(y_0)}.$$

If the reference gave $y_0$ 5% probability, total collapse costs only $\log 20\approx3$ nats, which is well within a typical RLHF budget. Reverse KL does contain an entropy bonus, since $\KL(\pi\|\piref)=-H(\pi)-\E_\pi[\log\piref]$ (this is why Ziegler et al. describe the term as one), but the bonus is capped: dropping every other output can never cost more than $\log\frac{1}{\piref(y_0)}$. Reverse KL is infinite only for putting mass where the reference has none. A penalty that blows up when coverage is lost would need the forward KL $\KL(\piref\|\pi)$, which RLHF does not use explicitly.

Analogy: the radio station tuned by call-in votes

A station that keeps whichever song most listeners call in to praise ends up playing the same five songs. No single choice is wrong (people really did like them), but the station loses everything else in its library. Its license (the KL anchor) only forbids playing songs that aren't in the library. It says nothing about rotation.

Where it breaks: the station's listeners also get bored, which feeds back into votes. RLHF reward models do not get bored: each prompt is scored on its own, so repetition across samples is never penalized.

There is a second, data-level push toward collapse. Zhang et al. (2025, "Verbalized Sampling") argue that human raters have a typicality bias: given equal quality, they prefer familiar-sounding text. Model it as a reward that includes the base model's own log-probability:

$$r(x,y)=r^\star(x,y)+\alpha\log\piref(y\mid x)+\epsilon\quad\Longrightarrow\quad \pi^*\propto\piref^{\,1+\alpha/\beta}\;e^{r^\star/\beta}.$$

Plugging into the closed form, the reference distribution is raised to a power $\gamma=1+\alpha/\beta>1$. This is a temperature below 1 applied before any real quality signal. On HelpSteer they fit a logistic model to correctness-matched response pairs and estimate $\hat\alpha=0.57\pm0.07$ and $0.65\pm0.07$ (using Llama-3.1-405B and GLM-4.5 base models as $\piref$), both clearly positive. Be careful with the magnitude. Their regressor is the difference in average per-token log-likelihood, whereas the formula above uses the whole-sequence $\log\piref(y\mid x)$. Plugging $\hat\alpha\approx0.6$ and β = 0.1 straight in would give γ ≈ 7, but for a $T$-token answer the sequence-level coefficient is closer to $\hat\alpha/T$, so the real sharpening is far smaller. The robust result is the sign: human preference data rewards typicality, which pushes γ above 1.

40 story openings with nearly equal true quality (r* ~ N(0, 0.12)) and a Zipf-shaped reference. The RM adds α·log πref on whole outputs (a toy: α here is a free knob, not the paper's per-token estimate). Defaults α = 0.6, β = 0.15 (γ = 5): entropy falls from 3.2 to about 0.4 nats, one opening ends up with ~90% of the mass, and "distinct openings in 20 samples" drops from ~13 to ~2, all for a KL bill of only ~1.3 nats. Set α = 0 to see how little a flat true reward changes the distribution. Raise β: the end state is less collapsed (β = 1 still leaves γ = 1.6 and ~9 distinct openings), but a large β also drowns the real quality signal r*/β.

The empirical evidence is consistent with this picture:

A policy collapses onto one answer that the reference gave 2% probability. What does the KL penalty charge for this, per prompt?
$\KL(\delta_{y_0}\|\piref)=\sum_y \delta(y)\log\frac{\delta(y)}{\piref(y)}=\log\frac{1}{0.02}$. Zeros in π contribute nothing to $\KL(\pi\|\piref)$. Only zeros in $\piref$ where π has mass would make it infinite.

Calibration

The GPT-4 Technical Report includes a widely cited plot (Figure 8). On a subset of MMLU, the pre-trained model's confidence in its multiple-choice answers matched its accuracy closely, with an expected calibration error (ECE) of 0.007. After post-training, labeled "ppo" in the figure, the ECE was 0.074. The caption says plainly that "post-training hurts calibration significantly." This follows from the tilt. Multiplying probabilities by $e^{r/\beta}$ and renormalizing is a reward-weighted sharpening. Unless the reward is itself a calibrated log-likelihood of correctness, there is no reason the resulting confidences should match accuracy. Kadavath et al. (2022) report a useful nuance: RLHF policies "naively appear very miscalibrated", but a single temperature ($T=2.5$) "largely fixes calibration issues" on their evaluations. Much of the knowledge survives; the readout is sharpened.

Verbosity drift and sycophancy

Reward models inherit any correlation in the preference data between a cheap feature and the label. Length is the classic one. Singhal et al. (2023) found that RLHF reward gains in their settings were mostly driven by longer outputs, and that "even a purely length-based reward reproduces most downstream RLHF improvements" over SFT. Agreement with the user is another. Sharma et al. (2023), an Anthropic paper, showed that five production assistants were sycophantic across four tasks. In existing preference data, responses that matched the user's views were more likely to be preferred, and optimizing against preference models could trade truthfulness for agreement. The production version of this story came in April 2025, when OpenAI rolled back a GPT-4o update days after shipping it. Its postmortem ("Expanding on what we missed with sycophancy", May 2025) blamed several changes that each looked beneficial alone, including an added reward signal from ChatGPT thumbs-up/down data. In aggregate, OpenAI wrote, they "weakened the influence of our primary reward signal, which had been holding sycophancy in check", and user feedback "can sometimes favor more agreeable responses".

Pitfall: "the RM's accuracy is 72%, so it's fine"

Pairwise accuracy on held-out comparisons measures the RM near the data distribution. RLHF evaluates the RM where the policy goes, and the policy goes where the RM is wrong in its favor. A 1-nat error on a rare behavior is irrelevant on the test set and dominant after optimization (§3). Evaluate RMs on the policy's own late-training samples, with fresh human labels, and plot length, agreement and refusal rates over training.

§6Anthropic's HH-RLHF: helpful versus harmless

Anthropic's 2022 assistant paper is a set of careful empirical observations about what happens when you optimize two partly opposed objectives with RLHF at scale.

Training a Helpful and Harmless Assistant with RLHF (Bai et al. 2022) trained models from 13M to 52B parameters. The data was collected mostly with 52B models: about 118k helpfulness comparisons (44k base, 52k from rejection-sampling models, 22k online) and 44k harmlessness comparisons from red-teaming. RL used the PM score directly, with $r_{\mathrm{total}}=r_{PM}-\lambda_{KL}\KL(\pi\|\pi_0)$ and $\lambda_{KL}=0.001$.

The tension

A preference model trained only on helpfulness data performed "much worse than chance" on harmlessness data, and vice versa. A PM trained on both learned both, and larger PMs were better at it and less sensitive to the data mix. Policy behavior was harder. Early policies produced "the same exaggerated responses to all remotely sensitive questions", such as recommending therapy or saying "I can't answer that", which the authors attributed to "over-optimizing for harmlessness, while under-optimizing helpfulness". Part of the cause was the data design. Red-teamers chose the more harmful of two responses, so the data taught the model what not to say without demonstrating a good refusal. The cheapest harmless answer was an evasive one.

Analogy: the pharmacist

A pharmacist who refuses to answer any question about medication is perfectly safe and useless. One who hands out anything requested is helpful and dangerous. A good pharmacist explains why a combination is risky and what to ask your doctor: an engaged refusal on the dangerous part and full help on the rest. RLHF with only "comply" and "refuse" as candidates can only trade one bad extreme against the other.

Where it breaks: a pharmacist's judgment comes from training on the domain. An RLHF policy only gets better options if they exist in its samples, which is what CAI's revisions add (§7).

A toy (illustrative scores, not data): three prompt types (benign 50%, sensitive-but-legitimate 25%, harmful 25%) and five response styles. Reward = w·helpfulness + (1 − w)·harmlessness, then the KL-tilt of a reference policy (β = 0.12). Sweeping w traces a frontier. With only comply / care / evasive / preachy available, lowering w first buys harmlessness by declining harmful requests, but below w ≈ 0.3 the extra harmlessness comes from evasive refusals and lectures on sensitive-but-legitimate requests (watch that bar). Add engaged, explained refusals and the whole frontier moves up and to the right, qualitatively matching Fig. 2 of the CAI paper.

The lesson of the widget is the paper's lesson: changing weights moves you along a frontier, while adding better candidate behaviors moves the frontier itself. No choice of w fixes an evasiveness problem if the policy rarely samples a good engaged answer.

Iterated online RLHF

To improve the top of the distribution, the team ran an iterated online mode. The best current RLHF policy collected new comparisons, these were mixed with existing data, and new PMs and policies were trained, roughly weekly over about five weeks. The online data populated the high-score tail of the PM's distribution, where the original data was thin. Online PM accuracy on test sets was lower (74% base, 70% rejection sampling, 67% online-only). The authors read this as evidence that comparing two good samples is harder, not that the PM got worse. In a controlled comparison with equal data, the iterated-online mixture was preferred. Against professional writers, crowdworkers preferred the HH online model 56% of the time, with the caveat that the writers' prompts were not very adversarial.

Robustness findings

Red teaming as data

The harmlessness data came from red-teaming, written up in Ganguli et al. (2022). They released 38,961 attacks and compared four model types at 2.7B, 13B and 52B. Plain, HHH-prompted and rejection-sampling models showed a flat trend with scale, while RLHF models became harder to red team as they scaled. (Rejection-sampling models were hard to red team at every size, but mostly by being evasive.) Methodologically, the paper treats red-teaming as data collection with its own instructions, statistics and uncertainties, not as a demo. That remains the right framing. Red-team data is a training distribution, and its biases (which harms people think to try, which response they mark) become the policy's biases.

§7Constitutional AI

Constitutional AI keeps human labels for helpfulness and replaces the harmlessness labels with AI feedback guided by a short list of written principles. It changes both who supervises and what kind of signal they give.

Constitutional AI: Harmlessness from AI Feedback (Bai et al. 2022b) had two motivations. The first was scalable oversight: if models will eventually need supervision on tasks humans cannot easily judge, it helps to learn now how to make AI supervision reliable. The second was the evasiveness problem of §6. HH models often gave canned refusals; the CAI paper reports its RL-CAI models are "virtually never evasive" and explain their objections instead.

Phase 1: SL-CAI (critique → revision → SFT)

  1. Take red-team prompts: 42,496 human-written (from Ganguli et al.) plus 140,335 model-generated, 182,831 in total.
  2. Sample a response from a helpful-only RLHF model. It will often comply with harmful requests.
  3. Append a critique request built from one principle drawn at random from 16. The same model critiques its response.
  4. Append the matching revision request; the model rewrites the response.
  5. Repeat with freshly sampled principles (the paper studies up to four rounds).
  6. Fine-tune a pretrained model on (prompt, final revision) pairs, mixed with helpfulness samples from the helpful RLHF model so the new model stays helpful.

Phase 2: RL-CAI (RL from AI feedback)

  1. Starting from the SL-CAI model, sample two responses to each red-team prompt.
  2. Ask a feedback model (typically a pretrained LM) a multiple-choice question: "Consider the following conversation between a human and an assistant: […] [principle] Options: (A) […] (B) […] The answer is:".
  3. Use the normalized probabilities of "(A)" vs "(B)" as a soft label. Soft labels "led to much better results than hard labels", which the authors attribute to their calibration. Each comparison uses one randomly sampled principle; this gave more robust PM behavior than any single fixed principle.
  4. Chain-of-thought feedback: let the (helpful RLHF) feedback model reason step by step before answering. Its probabilities then saturate near 0 or 1, so they are clamped to 40–60%. Without clamping, the policy learned more extreme behavior; a 20–80% band helped less.
  5. Train a PM on AI harmlessness labels plus human helpfulness labels, then run RL against it, initialized from SL-CAI.

Press Play. The SL-CAI dialogue is quoted verbatim from Section 3.1 of the paper (the wifi example); the principle in the RL phase is one of the paper's 16. Response (B) and the probability values in the RL phase are illustrative. Use the Jump buttons to replay one phase.

import random, torch

def sl_cai_pair(model, prompt, principles, n_rounds=4):
    """Critique-revision loop. principles: list of (critique_request, revision_request)."""
    convo = f"Human: {prompt}\n\nAssistant:"
    response = model.generate(convo)
    for _ in range(n_rounds):
        crit_req, rev_req = random.choice(principles)          # one principle per round
        ctx = f"{convo} {response}\n\nCritiqueRequest: {crit_req}\n\nCritique:"
        critique = model.generate(ctx)
        ctx += f" {critique}\n\nRevisionRequest: {rev_req}\n\nRevision:"
        response = model.generate(ctx)
    return prompt, response                                     # one SFT example

def ai_preference(feedback_lm, convo, a, b, principle):
    q = (f"Consider the following conversation between a human and an assistant:\n{convo}\n"
         f"{principle}\nOptions:\n(A) {a}\n(B) {b}\nThe answer is:")
    lp = torch.tensor([feedback_lm.logprob(q, " (A)"), feedback_lm.logprob(q, " (B)")])
    return torch.softmax(lp, dim=0)[0].item()                   # soft label P(A preferred)
Analogy: the writer with a style guide

Instead of an editor marking up every draft, the writer gets a short style guide and is told to reread each draft against one rule at a time and fix it. Then a second reader, working from the same guide, picks the better of two drafts. The guide is the constitution; the rewrites are SL-CAI; the second reader is RL-CAI.

Where it breaks: the writer and the second reader are the same kind of model, so their blind spots are correlated. What the guide does not say, nobody checks. And an over-eager writer can learn to staple the same disclaimer to everything.

What the constitution was

In the 2022 paper the constitution was 16 short principles, each phrased as a critique/revision pair for SL and a comparison question for RL. An example: "Which of these assistant responses is less harmful? Choose the response that a wise, ethical, polite and friendly person would more likely say." When Anthropic published Claude's constitution in May 2023, it was a longer list (58 principles, per Anthropic's later CCAI post) of mostly "Choose the response that…" principles. The sources were the UN Declaration of Human Rights, trust-and-safety practice, other labs' principles (DeepMind's Sparrow rules), platform terms of service (e.g. Apple's), attempts to include non-Western perspectives, and Anthropic's own research. The post is candid about a side effect: the model sometimes "became judgmental or annoying", so principles were added against responses that were "too preachy, obnoxious or overly-reactive". The CAI paper reports the same failure in its most extreme form: over-trained RL-CAI policies appended boilerplate such as "you are valid, valued, and cared for" to most red-team responses. Goodhart applies to AI feedback too.

Key idea: CAI changes the candidate set, not just the labeler

The usual summary, "CAI = RLHF with AI labels", leaves out half of it. SL-CAI produces new kinds of responses (engaged, explained refusals) and puts them into the policy's distribution before RL starts. RL can only tilt what the reference samples (§3), so this is the step that moves the helpful–harmless frontier. The AI labels then make harmlessness supervision cheap enough to scale.

In the original RL-CAI setup, which preference labels came from AI feedback?
The paper states that helpfulness labels came from human feedback, while harmlessness labels were AI-generated from constitutional principles. "No human harmlessness labels" is the precise claim.

RLAIF beyond Anthropic

Lee et al. (Google, ICML 2024) ran a controlled RLAIF vs RLHF comparison with PaLM 2 as the labeler. Human win rates against the SFT baseline were 71% (RLAIF) vs 73% (RLHF) on summarization and 63% vs 64% on helpful dialogue. Head-to-head, the two were statistically indistinguishable (50% and 52%). On harmlessness, RLAIF reached an 88% harmless rate, against 76% for RLHF and 64% for SFT. Practical details carried over: position bias in the labeler (handled by scoring both orders and averaging), larger labelers aligning better with humans, a small gain from chain-of-thought, and a "direct RLAIF" variant that skips the RM and queries the LLM for a score during RL. Related lines include self-rewarding models that judge their own samples for iterative DPO (Yuan et al. 2024), OpenAI's Rule-Based Rewards that pair explicit rules with an LLM grader for safety (Mu et al. 2024), and Inverse Constitutional AI, which compresses an existing preference dataset into the principles that best reconstruct it (Findeis et al., ICLR 2025).

How specific should principles be? Who writes them?

Kundu et al. (2023) tested the extreme: a single principle, roughly "do what's best for humanity". The largest dialogue models generalized from it to harmless behavior, "with no stated interest in specific motivations like power". Detailed constitutions still gave finer control over specific harms, so the conclusion was that both kinds of principle are useful. Collective Constitutional AI (Anthropic with the Collective Intelligence Project, 2023; FAccT 2024 paper) asked about 1,000 demographically sampled Americans to propose and vote on rules via Polis: 1,127 statements and 38,252 votes. The public constitution overlapped Anthropic's by about 50% in concepts. It emphasized objectivity, impartiality and accessibility, and tended to promote desired behavior rather than prohibit undesired behavior. The model trained on it was less biased on all nine BBQ social dimensions, at equivalent MMLU/GSM8K and helpful/harmless Elo.

Anthropic, 2026: from a list of principles to a constitution that explains itself

In January 2026 Anthropic published a new constitution for Claude (full text, released under CC0). It differs from the 2022–2023 lists in kind. It is a long document that explains its reasoning, with a priority ordering for conflicts: broadly safe, broadly ethical, compliant with Anthropic's guidelines, genuinely helpful. It keeps a small set of hard constraints (for example, that Claude should "never provide significant uplift to a bioweapons attack") where bright lines beat judgment. The announcement says the constitution is used at various stages of training, and that Claude uses it to generate synthetic training data: example conversations, responses aligned with its values, and rankings of possible responses. The CAI mechanisms (self-critique, AI preference labels) are still present, now driven by a document designed to generalize rather than to be applied one rule at a time. Chapter 08 covers the document, character training and its relation to model specs in depth.

A May 2026 Alignment Science post, "Teaching Claude Why", gives evidence on why. Anthropic traced Claude 4-era agentic misalignment in honeypot evaluations (such as blackmail scenarios) mainly to gaps in safety training, not to rewards for bad behavior. At the time, the HHH mix was mostly standard chat-based RLHF data with no agentic tool use, so in agentic settings the model fell back on its pretraining prior. Training on demonstrations of the desired behavior helped little (22% → 15% misalignment from ~10k transcripts). Data that explained why (constitution-guided advice on ethical dilemmas, documents about the constitution, stories of aligned AI) generalized far better. Documents about the constitution combined with such stories cut the blackmail rate from 65% to 19%. The post's own phrasing: "Training on demonstrations of desired behavior is often insufficient."

Informed speculation: where CAI sits in a 2026 pipeline

Anthropic has not published Claude's current post-training pipeline at the level of InstructGPT's appendix. From its public writing we can say that constitution-driven synthetic data, AI-generated rankings and RL all appear. A plausible reading, which is speculation, is that pairwise preference RL is now one of several channels through which a constitution shapes the model, alongside SFT on constitution-guided responses, document-style training on the constitution itself, and RL environments with verifiable or rubric-based rewards. Independent work points the same way: a July 2026 preprint (Cho et al.) inserted a 394M-token corpus built from Anthropic's constitution into midtraining (a 120B-parameter model) and reports alignment gains that survived SFT and benign fine-tuning, with no average capability cost. The advantage did not hold where the model had to resist in-context pressure.

§8Practical RLHF: online, offline, iterated

Most RLHF engineering decisions come down to one question: is the reward model still accurate on the samples the policy is producing now?

Online vs offline

"Online" has two meanings that are worth keeping apart:

Analogy: the map drawn before the expedition

A reward model is a map of good and bad territory, drawn from samples of the old policy. As the policy improves, it walks off the edge of the map, where the map shows a featureless plain that the optimizer reads as "probably great". Refreshing the RM is sending surveyors to where the expedition actually is.

Where it breaks: surveyors (raters) can be fooled by the expedition's own reports. A sufficiently persuasive policy makes the territory look good to the people drawing the map (Wen et al., §9).

Reward-model drift and iterated rounds

When the RM is refreshed, the reward scale and its biases change, so a policy tuned against RMk is moved by RMk+1 in a direction that partly reflects its errors. Practical consequences:

DecisionDefault that worked historicallyWatch for
Reference modelThe SFT model, frozen; reset between iterated roundsKL dominating the loss late in long runs (ProRL-style resets)
β / KL budgetAdaptive controller toward a KL target; Llama 2 0.01 → 0.005 for larger modelsRM scale changes between versions; per-token vs per-sequence confusion
RM sizeOften smaller than the policy (InstructGPT 6B RM for 175B)Small RMs are less robust (HH: larger PMs overfit less)
Multiple objectivesSeparate helpfulness and safety RMs (Llama 2) or a mixed PM (HH)Evasive optimum when harmlessness is cheaper to satisfy
Data refreshNew comparisons on the latest policy each roundHigher-quality comparisons are harder (accuracy drops), not a broken RM
Capability retentionPretraining mix (PPO-ptx), weight averagingRegressions on tasks the RM never sees
MonitoringHeld-out PM, human spot checks, length/refusal/agreement ratesSign bugs: Ziegler's flipped reward ran to completion unnoticed overnight

Rejection sampling as RLHF's sibling

Best-of-n sampling against the RM, followed by SFT on the winners ("rejection sampling fine-tuning"), approximates the same tilted target without policy gradients. Llama 2 used only rejection sampling through RLHF-V4 and added PPO on top for the final round. HH-RLHF's second data tranche came from rejection-sampling models. It is more stable and easier to debug than PPO, uses the same KL currency (best-of-n moves the policy by at most $\log n-\frac{n-1}{n}$ nats), and is limited by the same RM errors. See Chapter 03 for its over-optimization curve.

§9What RLHF is good at, what it's bad at

RLHF is very good at the problem it was designed for: moving a capable model toward behavior that people can recognize as better. It has no answer for cases where people cannot tell, disagree, or can be fooled.

Good at

Bad at: the Casper et al. taxonomy

Open Problems and Fundamental Limitations of RLHF (Casper et al. 2023) is the standard reference for RLHF's limits. Its central move is to separate tractable problems, which better engineering can fix, from fundamental ones that require going beyond RLHF:

StageFundamental (quoted)Tractable (examples)
Human feedback"Humans cannot evaluate performance on difficult tasks"; "Humans can be misled, so their evaluations can be gamed"; "an inherent cost/quality tradeoff"; feedback types trade richness against efficiencyMisaligned or careless evaluators; limited time and attention; partial observability; biased data collection
Reward model"An individual human's values are difficult to represent with a reward function"; "A single reward function cannot represent a diverse society of humans"; "Optimizing for an imperfect reward proxy leads to reward hacking"Evaluating reward models
Policy"Policies can perform poorly in deployment even if rewards seen during training were perfectly correct"; "Optimal RL agents tend to seek power""It is (still) challenging to optimize policies effectively"; adversarial exploitability; "RL contributes to mode collapse"; biases from the pretrained model
Joint training—"Joint training induces distribution shifts"; balancing efficiency against overfitting

Evidence since 2023 has filled in several of these cells:

How to think about it

"Is RLHF enough for alignment?" Both "yes, with enough data" and "no, it's hopeless" miss the point. Separate the cases. Where humans can reliably judge outputs, RLHF works and its failures (length, sycophancy, collapse) are tractable with better data and monitoring. Where they cannot (superhuman tasks, persuasive errors, long agentic trajectories), the learned reward inherits the evaluator's blind spots, and RL actively searches for them. That is what motivates scalable oversight (AI-assisted evaluation, CAI as a first step), interpretability-based monitoring, and evaluating behavior in agentic settings, not only chat.

§10Frontier & open problems

What is unresolved as of late 2026
  • Which anchor? A fixed SFT reference, an EMA, periodic resets, or none? Each choice is a different answer to "close to what?", and there is little theory for long runs where the cumulative drift is large.
  • Diversity by design. The closed form says collapse comes from the reward's shape (typicality bias, per-prompt scoring) as much as from β. Open directions: rewards defined over sets of samples, forward-KL or preference-matching regularizers, and inference-time fixes such as verbalized sampling.
  • Calibration after RL. Can we train toward a reward that is itself a proper scoring rule for the model's stated confidence, rather than repairing calibration with temperature afterwards?
  • Oversight beyond human judgment. RLAIF works when the AI labeler is at least as good a judge as the humans it replaces. When the labeler and the policy share blind spots, AI feedback can amplify errors instead of catching them. Measuring correlated error between policy and judge is an open evaluation problem.
  • Agentic distribution shift. Anthropic's 2025–2026 work shows that chat-distribution RLHF safety training does not reliably transfer to agentic settings. Building RLHF and constitutional data for long tool-using trajectories, where judging is slower and harder, is active work.
  • Reasons, not just labels. If explanation-rich training (constitution documents, "why" data) generalizes better than pairwise preferences, the role of pairwise RLHF may shrink. It might be used for polish and tone, while values come from document-style, constitution-driven and verifiable-reward training. How these channels interact during RL is poorly understood.
  • A theory of √KL. The linear regime is easy to motivate (§4). Predicting where it bends for a given RM, from RM size, data and uncertainty, would let you set KL budgets before training instead of after.

§11Check yourself

Try each one before opening the answer. A mix of derivations, design questions and research taste.

Derive the optimal policy of the KL-regularized RLHF objective, and say what it implies about support. core

Fix x. $\E_\pi[r]-\beta\KL(\pi\|\piref)=\beta\E_\pi[\log(\piref e^{r/\beta}/\pi)]=-\beta\KL(\pi\|\piref e^{r/\beta}/Z)+\beta\log Z$. The last term is constant and KL ≥ 0 with equality iff equal, so $\pi^*=\piref e^{r/\beta}/Z$. Support: $\pi^*(y)=0$ wherever $\piref(y)=0$, so RLHF cannot produce outputs the reference never produces. It can only reweight. As β → 0 it becomes argmax over the reference's support; as β → ∞ it returns to the reference.

Why doesn't the KL penalty prevent mode collapse? deep

Reverse KL $\KL(\pi\|\piref)$ is cheap to satisfy by dropping mass: collapsing onto $y_0$ costs $\log(1/\piref(y_0))$, a few nats for a common output. Mass-covering would need the forward KL. In addition, (i) policy-gradient minimizes reverse KL to the target, which is mode-seeking; (ii) preference data with typicality bias adds $\alpha\log\piref$ to the reward, which sharpens the reference to the power $1+\alpha/\beta$; and (iii) per-prompt scoring never penalizes repeating yourself across samples. Kirk et al. even found that raising the KL coefficient did not increase per-input diversity.

Explain the reward ∝ √KL relation, and how you would use it in a project. deep

Along the tilt path, ΔR ≈ λσ² and KL ≈ λ²σ²/2, so ΔR ≈ √(2σ²KL): the slope is set by the spread of rewards under the initial policy, and the relation is exact for Gaussian rewards. Uses: forecast the KL needed for a target reward gain (doubling reward needs ~4× KL); compare runs or model sizes at equal KL rather than equal steps; detect over-optimization as the point where held-out-judge reward bends below the line while the training RM stays on it; set the KL target for an adaptive controller. Caveat: PPO's path is not exactly the tilt path, and the relation breaks where the RM is unreliable.

KL in the reward vs KL in the loss: what's the difference, and which estimator would you use? deep

KL in the reward adds the detached per-token log-ratio (k1) to the reward and credits it through advantages. On-policy, that gives the correct reverse-KL gradient. KL in the loss backpropagates through an estimator; GRPO uses k3 = ρ − 1 − log ρ, which is an unbiased, non-negative value estimate, but its gradient is only a first-order approximation of the reverse-KL gradient (Liu et al. 2025); on-policy its expected gradient is exactly that of the forward KL $\KL(\piref\|\pi)$. k2 = ½(log ρ)² as a loss is gradient-equivalent to k1-in-reward on-policy. With PPO epochs or async off-policy samples, any "as loss" form also needs importance weighting. Choice: k1-in-reward for PPO-RLHF; if you want the KL in the loss, k2. Log k3 for monitoring, since it is non-negative and low-variance.

Your RLHF run's RM score climbs steadily, but human evals are flat after step 2k. How would you debug it? design

(1) Plot RM reward and a held-out judge (second RM trained on disjoint data, or fresh human labels) against √KL. Divergence means over-optimization. (2) Look for cheap features: length, list formatting, hedging, agreement with the user, refusal rate. Regress RM score on them. (3) Inspect the top-scoring samples by hand. Rare high-reward modes are where hacks live. (4) Check for distribution shift: label a few hundred late-training samples and measure RM accuracy there. (5) Check the KL estimator and the reference (a reset reference can hide cumulative drift). (6) Check for sign and masking bugs (Ziegler's flipped reward). Fixes in order: stop earlier / lower the KL target, refresh the RM on current samples, add length or other bias controls, use an ensemble or a larger RM.

Why is online (on-policy, refreshed-RM) RLHF better than offline? Give two distinct mechanisms. core

(1) RM coverage: the RM is accurate only near its training distribution. As the policy moves, it reaches regions the RM never saw, and errors there are amplified exponentially by the tilt. Refreshing with comparisons on current samples fixes the map where the policy actually is (Christiano 2017, Ziegler 2019, HH-RLHF's high-score tail, Llama 2). (2) On-policy learning signal: even with a fixed RM, training on the policy's own samples gives feedback on what it actually generates. Tang et al. 2024 show the online/offline gap is not explained by data coverage or quality, and that offline methods learn to discriminate better than they learn to generate.

In RL-CAI, why soft labels, and why clamp chain-of-thought probabilities to 40–60%? core

Soft labels carry the feedback model's uncertainty. Pretrained LMs' multiple-choice probabilities are reasonably calibrated, so training the PM toward them avoids treating coin-flip judgments as certain; the paper reports "much better results than hard labels". With chain-of-thought, the model commits to an answer and the probabilities collapse to near 0 or 1, which turns soft labels into overconfident hard ones. The PM then becomes extreme and the policy learns extreme behavior. Clamping to [0.4, 0.6] keeps the direction of the judgment and discards the false confidence; [0.2, 0.8] helped less.

The HH paper found helpfulness and harmlessness in tension. How did CAI change that? core

In HH-RLHF the cheapest harmless response was an evasive refusal, partly because red-team data labeled the more harmful response and never demonstrated good refusals. Optimizing a mixed PM gave evasive policies. CAI changed two things. SL-CAI's revisions put engaged, explained refusals into the policy's distribution, a better candidate that moves the frontier rather than moving along it. And the AI feedback was guided by principles that also penalize preachiness. Result: RL-CAI was more harmless at a given helpfulness (CAI Fig. 2) and "virtually never evasive". It also needed fixes for its own failure mode, boilerplate moralizing.

What's the alignment tax, and what are three ways to reduce it? core

Capability regressions after alignment training on tasks outside the reward's scope (InstructGPT: SQuAD, DROP, HellaSwag, WMT Fr→En). Mitigations: (1) mix pretraining gradients into PPO (PPO-ptx, γ = 27.8); (2) average weights between the pre- and post-RLHF models, or per-layer averaging (Lin et al.); (3) scale. HH-RLHF found a tax at small sizes and a bonus at 13B and 52B. Also: tighter KL budgets, and including capability data in the RL prompt mix.

Derive what typicality bias in the reward does to the optimal policy. deep

With $r=r^\star+\alpha\log\piref$: $\pi^*\propto\piref\exp((r^\star+\alpha\log\piref)/\beta)=\piref^{1+\alpha/\beta}e^{r^\star/\beta}$. That is the reference at inverse temperature $\gamma=1+\alpha/\beta$, before any quality signal. Zhang et al.'s HelpSteer estimate (α̂ ≈ 0.6) is positive, but it is measured on average per-token log-likelihood; on whole-sequence log-probabilities the coefficient is roughly α̂/T, so do not quote γ ≈ 7 as a measured number. Increasing β reduces γ but also weakens the real signal $r^\star/\beta$. You cannot fix a biased reward with the KL knob alone; you need to remove the bias from the data or the RM.

How would you test whether a change to the constitution improved the model? design

Pre-register target behaviors and guard behaviors (capabilities, over-refusal, sycophancy). Train matched pairs that differ only in the constitution, with multiple seeds, since RL variance is large. Evaluate with (a) human raters blind to condition, (b) held-out judges that were not used in training (the policy will have optimized against the training judge), and (c) distribution-shifted tests, especially agentic ones, given Anthropic's findings that chat-only data under-covers them. Report effect sizes with CIs (Ch. 09). Check that behavior changes on cases the edited principle addresses and stays the same elsewhere. Also run automated audits for new failure modes, such as boilerplate and preachiness.

Is RLAIF a solution to scalable oversight? What are its limits? research

It solves the cost and consistency problem: Lee et al. found AI labels matched human labels for summarization and dialogue, and RLAIF produced a higher harmless rate. It does not solve the capability problem. The labeler must judge at least as well as the humans it replaces, and when policy and labeler are similar models their errors correlate, so the policy can find the blind spots both share. Known labeler biases: position, self-preference, length, typicality. Research directions include ensembles of diverse judges, debate- or critique-assisted human evaluation, measuring judge–policy error correlation, and checking AI labels against interpretability-based or verifiable signals where possible.

RLHF degraded calibration. What would you try? research

Baselines: temperature scaling of answer probabilities (Kadavath: T = 2.5 largely fixed it), and weight averaging toward the base model. Training-time options: add a proper scoring rule (Brier or log score) on verbalized or answer-token confidence for verifiable questions; include "I'm not sure" responses in preference data with labels that reward appropriate uncertainty; penalize confidence-accuracy gaps measured on held-out factual sets during RL. Measure ECE before and after on the GPT-4-style MMLU setup, and check that the fix survives later RL stages.

Reference resets (Elastic Reset, ProRL, iterated rounds): what do they buy and what do they cost? research

They buy optimization headroom. A fixed reference makes the KL term grow until it dominates and freezes learning; resetting keeps the per-phase penalty meaningful. Elastic Reset and WARP also report better reward-vs-drift trade-offs by averaging. Cost: the total drift from the original SFT model is no longer bounded by β, so the "stay where the RM is valid" guarantee becomes "stay near where you were recently", and RM errors can accumulate across resets. Mitigations: refresh the RM at each reset, track KL to the original model as a diagnostic, and keep held-out judges fixed across phases.

Closed-form optimum of E[r] − β·KL(π‖πref)
π* = πref·exp(r/β)/Z(x); J* = β log Z.
InstructGPT's three stages and data sizes
SFT (~13k prompts) → 6B RM (~33k prompts, K=4–9 rankings) → PPO (~31k prompts), β = 0.02, PPO-ptx γ = 27.8.
HH-RLHF's √KL finding
Reward is approximately linear in √KL(π‖π₀) for much of training; doubling reward costs ~4× KL.
Why √KL, in one line
Along the tilt: ΔR ≈ λσ², KL ≈ λ²σ²/2 ⇒ ΔR ≈ √(2σ²·KL).
Gao et al.: what does the KL penalty do?
It doesn't improve the gold-reward-vs-KL frontier; it makes training converge earlier, like early stopping.
KL cost of collapsing onto y₀
log(1/πref(y₀)): finite and often small. Reverse KL forbids invention, not abandonment.
Typicality bias effect
r = r* + α log πref ⇒ π* ∝ πref^(1+α/β) e^(r*/β). HelpSteer: α̂ ≈ 0.57–0.65, but on per-token average log-likelihood, so the sign is robust, the magnitude is not.
GPT-4 calibration numbers
MMLU subset ECE: 0.007 pre-trained → 0.074 after post-training (Fig. 8).
k1, k2, k3
With ρ = πref/π: k1 = −log ρ (unbiased, noisy); k2 = ½(log ρ)² (biased, low variance); k3 = ρ − 1 − log ρ (unbiased, ≥ 0).
SL-CAI in one line
Helpful-only model answers red-team prompts → critique and revise against randomly sampled principles (×4) → SFT a pretrained model on the revisions + helpful data.
RL-CAI labels
Feedback LM picks (A)/(B) under one sampled principle; normalized probs = soft label; CoT probs clamped to 40–60%. Helpfulness labels stay human.
RLAIF vs RLHF (Lee et al.)
Win rates vs SFT 71/73% (summ.), 63/64% (dialogue); harmless rate 88% RLAIF vs 76% RLHF.
Claude's 2026 constitution: priority order
Broadly safe → broadly ethical → compliant with Anthropic's guidelines → genuinely helpful; plus a few hard constraints.
Ziegler's sign-flip bug
Reward and KL signs flipped → fluent, "maximally bad output"; the authors were asleep, nobody stopped the run.

§12Read next

Training language models to follow instructions with human feedback
Ouyang et al. · 2022 · NeurIPS
The canonical SFT → RM → PPO recipe, PPO-ptx and the alignment tax, with full data and hyperparameter details.
InstructGPTPPO
Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback
Bai et al. · 2022 · Anthropic
Helpful/harmless tension, iterated online RLHF, reward ∝ √KL, PM robustness and calibration.
HH-RLHFAnthropic
Constitutional AI: Harmlessness from AI Feedback
Bai et al. · 2022 · Anthropic
Critique → revision → SFT, then RL from AI preference labels guided by 16 principles; harmless without being evasive.
CAIRLAIF
RL with KL penalties is better viewed as Bayesian inference
Korbak, Perez, Buckley · 2022 · Findings of EMNLP
KL-regularized RL as variational inference toward π_ref·e^{r/β}; why plain RL collapses.
theoryKL
Open Problems and Fundamental Limitations of Reinforcement Learning from Human Feedback
Casper et al. · 2023
The taxonomy of tractable vs fundamental problems in feedback, reward models and policies.
critiquesurvey
Deep reinforcement learning from human preferences
Christiano et al. · 2017 · NeurIPS
Bradley-Terry reward learning from clip comparisons; why feedback must be online.
origins
Fine-Tuning Language Models from Human Preferences
Ziegler et al. · 2019
First LM RLHF; the KL-shaped reward and adaptive KL controller; smart copiers; the sign-flip bug.
originsKL
Learning to summarize from human feedback
Stiennon et al. · 2020 · NeurIPS
RLHF beats human reference summaries; first clear evidence of RM over-optimization.
summarization
Scaling Laws for Reward Model Overoptimization
Gao, Schulman, Hilton · 2022 · ICML 2023
Gold reward vs √KL functional forms; in their setup the KL penalty acts like early stopping.
Goodhartscaling
Red Teaming Language Models to Reduce Harms: Methods, Scaling Behaviors, and Lessons Learned
Ganguli et al. · 2022 · Anthropic
38,961 attacks; RLHF models get harder to red team with scale, other model types stay flat.
red teamingdata
RLAIF vs. RLHF: Scaling Reinforcement Learning from Human Feedback with AI Feedback
Lee et al. · 2023 · ICML 2024
Controlled comparison: AI labels match human labels on helpfulness and beat them on harmlessness.
RLAIF
Collective Constitutional AI: Aligning a Language Model with Public Input
Huang et al. · 2024 · FAccT
A publicly sourced constitution yields lower bias at equal capability.
constitutionpluralism
Specific versus General Principles for Constitutional AI
Kundu et al. · 2023 · Anthropic
"Do what's best for humanity" alone generalizes surprisingly well in the largest models.
constitution
Understanding the Effects of RLHF on LLM Generalisation and Diversity
Kirk et al. · 2023 · ICLR 2024
RLHF generalizes better OOD but cuts per-input diversity; raising the KL coefficient didn't help.
diversity
Verbalized Sampling: How to Mitigate Mode Collapse and Unlock LLM Diversity
Zhang et al. · 2025
Human raters favor typical text (α̂ > 0 on HelpSteer), which sharpens π_ref to the power 1+α/β; verbalized sampling is a prompting fix.
mode collapse
Rethinking KL Regularization in RLHF: From Value Estimation to Gradient Optimization
Liu et al. · 2025
k1-in-reward vs k2/k3-as-loss, through their gradients; GRPO's k3 is a biased approximation.
KLimplementation
Towards Understanding Sycophancy in Language Models
Sharma et al. · 2023 · Anthropic
Human preference data rewards agreement; optimizing PMs can trade truth for sycophancy.
sycophancy
Language Models Learn to Mislead Humans via RLHF
Wen et al. · 2024
RLHF raised evaluator false-positive rates (+24.1% QuALITY, +18.3% APPS) without improving correctness.
oversight
Natural Emergent Misalignment from Reward Hacking in Production RL
MacDiarmid et al. · 2025 · Anthropic
Reward hacking generalizes to broad misalignment; chat-only RLHF safety training doesn't transfer to agentic tasks.
reward hackingAnthropic
Teaching Claude Why
Kutasov, Jermyn et al. · 2026 · Anthropic Alignment Science Blog
Explaining reasons (constitution-guided data) generalizes far better than demonstrations alone.
constitutionAnthropic
Claude's new constitution
Anthropic · 2026
The long-form, reason-giving constitution and how it is used to generate training data.
constitutionAnthropic