Nathan Lambert
Post-training course. Chapter 15.
The RL step maximizes reward from the reward model minus a penalty for drifting from the reference model.
This lecture is about that penalty – and what happens with and without it.

Same RL loop, different reward source: a verification function instead of a reward model.
Reasoning models (before tool use) often dropped the KL penalty to enhance learning.
With the emergence of large-scale tool-use, regularization is coming back into vogue – but aimed at drift from the sampling distribution, not a KL penalty to a reference model (more on this at the end of the lecture).

How we control optimization pressures on models explicitly.
How the math of the optimizers we use changes the shapes of the models.
Slides – yes, these are the real slides, in a slide.
The canonical LLM reward function:
Sampling from P turns the definition into an expectation:
# sample from the policy
tokens = model.generate(inputs)
# score sampled tokens under both models
logprobs = log_softmax(model.forward(tokens).logits)
ref_logprobs = log_softmax(ref_model.forward(tokens).logits)
# log-probs of the tokens actually generated
token_lp = gather(logprobs, tokens)
ref_token_lp = gather(ref_logprobs, tokens)
# sequence-level difference approximates KL
kl_approx = token_lp.sum(-1) - ref_token_lp.sum(-1)

An OLMo-2-7B GRPO run, RL directly on the base model (R1-Zero-style, no SFT), from open-instruct (public W&B logs): over ~1M episodes the verifiable reward climbs while the logged KL to the reference rises and then wanders. This run has β = 0. This is a healthy shape.
The first RLHF-on-LMs paper did not fix β. It picked a target KL and let a controller chase it:
The first RLHF-on-LMs paper did not fix β. It picked a target KL and let a controller chase it:
Read the code: the original controller (lm-human-preferences, 2019) · TRL’s AdaptiveKLController (v0.11.4 – deleted in the modern rewrite) · open-instruct today: a static beta = 0.05, applied directly in the loss.
We started with a penalty on the RL setup: a term added to the reward, with a coefficient you tune (or control).
This next part is about the shape of RL optimization and how it relates to KL as well. It comes down to “which direction of KL” – that is set by where the samples come from:
Start from the KL-regularized objective (the one our RL trainers optimize):
Dividing by -\beta and normalizing turns the objective into a single KL – minimized exactly when \pi equals the optimal policy \pi_\star. Lecture 6 walked this same path (the starting point of DPO):
Read \pi_\star as the reward-tilted reference (AI suggested name, I couldn’t come up with something better): take \pi_{\text{ref}} and multiply each completion’s probability by \exp(r/\beta), then renormalize (that is all Z(x) does). The “tilt” shifts probability mass toward high-reward completions while staying inside the reference’s support – large \beta tilts barely at all, small \beta concentrates on the highest-reward completions.
Now expand the reverse KL to \pi_\star, substituting \log \pi_\star = \log \pi_{\text{ref}} - \log Z(x) + \tfrac{1}{\beta} r(x,y):
With the penalty included, RL doesn’t just use a reverse KL – the whole objective is one, pointed at the reward-tilted reference policy.
Now the comparison point. SFT trains on a fixed dataset – the samples come from the data distribution, call it \pi_{\mathcal{D}}, which makes it the other KL direction:
Same gradients, same minimum: minimizing the SFT loss is minimizing forward KL to the data distribution.
This is very reminiscent of Lecture 7 (on-policy distillation), with both directions of KL at play. Post-training math repeats itself:
Forward KL – supervised fine-tuning (aka standard KL):
Samples come from the target (a fixed dataset).
Mass-covering: wherever the target has mass and \pi_\theta \to 0, the loss blows up – the model must spread to cover everything.
Reverse KL – reinforcement learning:
Samples come from the policy itself.
Mode-seeking: only penalized where it places mass, so it concentrates on high-reward modes.
The distillation version, verbatim from Lecture 7 – teacher \pi_T in place of the target. Sampling completions from the student is what puts \pi_\theta on the left of the KL:
Offline KD / SFT (forward KL) – the expectation is over the teacher, z \sim \pi_T (off-policy: a fixed teacher dataset):
Mass-covering – weighted by teacher mass: wherever the teacher has mass and \pi_\theta \to 0, the log-ratio blows up, so the student must cover everything the teacher might say.
On-policy distillation (reverse KL) – the expectation is over the student, z \sim \pi_\theta (on-policy: you sample the model you’re training):
Mode-seeking – weighted by the student’s own mass: penalized only where it puts probability the teacher dislikes, so it collapses onto the teacher’s modes. Lecture 7 deferred why reverse KL is better to this lecture.
Controlled study: post-train on one task, evaluate under a rule shift (i.e., small modifications of the problem to test out-of-distribution) (Chu et al., 2025).
On V-IRL, RL improves out-of-distribution accuracy 80.8% → 91.8%. SFT collapses it 80.8% → 1.3% – destroying spatial reasoning the base model already had.
RL-based post-training carries implicit regularization from its on-policy structure alone. SFT is more brittle.
Paper: arxiv.org/abs/2501.17161
The naive read: forward KL is mass-covering, so SFT should preserve every mode – while mode-seeking RL should collapse onto one and forget the rest.
Is this correct?
That intuition assumes a unimodal policy – LLMs are multimodal. Paper: arxiv.org/abs/2510.18874

“Among the many high-reward solutions for a new task, on-policy methods such as RL are inherently biased toward solutions that remain closer to the original policy in KL divergence.”

Most of these are scaffolding: added to stabilize one setup, simplified away in the next model generation.
Tool use is changing what regularization has to do. In agentic recipes, the KL-to-reference penalty is disappearing:
DPPO (Divergence Proximal Policy Optimization) masks tokens by a directly estimated divergence between the rollout and training policies (binary Total Variation), instead of PPO’s per-token ratio clip (Qi et al., 2026).
The per-token ratio is a noisy one-sample estimate of that divergence. GLM’s IcePop (GLM-5 Team et al., 2026) and Kimi’s log-ratio interval (Moonshot AI, 2026) do the same job: gradients masked, not clipped.
This is where the eye of regularization is today – algorithmic updates rather than KL penalties.

Verifiable rewards are much less prone to overoptimization than reward models! Hence, regularization is changing and the KL penalty is playing a smaller role.
Questions / discussion are encouraged!
If you have a second to subscribe and/or share my content with a friend, it helps massively on getting the word out.
Contact: [email protected]
Newsletter: interconnects.ai
rlhfbook.com