Answers · How models work
What is the KL penalty against the original policy actually protecting against?
In shortIt stops the policy from chasing high scores in parts of the answer space where the fitted reward is only guessing, by charging it for moving away from the model it started from.
It protects against the policy moving into responses where the fitted reward is extrapolating, not against the fitted reward being wrong in general. The penalty makes every departure from the starting model pay, so a response has to earn more fitted reward than the charge for becoming likelier than it was.
Take . A response with probability under that the policy lifts to has log ratio . The charge is . If the fitted reward for that response is , the net reward is , so the policy still moves. At the charge is and the net is , so that response is no longer worth it. The break-even is .
| beta | charge | net reward | does it move? |
|---|---|---|---|
| 0 | 0.000 | 3.000 | yes |
| 1 | 0.693 | 2.307 | yes |
| 2 | 1.386 | 1.614 | yes |
| 5 | 3.465 | -0.465 | no |
The natural guess
The natural guess is that the term keeps the policy close to where it started, full stop, or that it regularises the learned reward. Keeping close is the mechanism, not the purpose: if the reward were true, moving away would be exactly what you want, and the term would only cost you reward. It does not regularise the learned reward either. The fitted reward is held fixed; the charge is on the policy's departure, not on the reward model's parameters. Nor does it stop reward hacking in the abstract: it prices exploits by how much drift they require. An exploit already available at the starting model costs nothing to reach.
The charge accumulates over tokens. If a ten-token response has every token's probability doubled, the log ratio is , so at the charge is . A fitted reward would need to exceed just to break even. In one sample the term is just the log ratio; in expectation it is the KL divergence. That is why is the one dial: it sets the exchange rate between fitted reward and distance from the starting model.
Where it stops protecting
The protection is only as good as the region it enforces. If is zero, there is no charge and the optimiser runs to the fit's mistakes. If is small relative to the reward scale, the break-even log ratio is large, and a response only needs a modest fitted reward advantage to justify substantial drift. If is too large, the charge exceeds every available reward gain and the policy does not move. If the fitted reward is already wrong near the starting model, the tether holds the policy to a bad target. And if the starting model has a high-probability hedge that the reward model likes, the penalty does not remove it, because staying there costs nothing.
What is protected
What is being protected is the meaning of the fitted score, not the quality of the answer directly. The reward model was fitted on responses like the starting model's, so its ranking is informative there and arbitrary outside. The KL term converts 'do not leave that region' from a hard constraint into a price, and the policy leaves only when the fitted reward says the outside is better by more than the price. That is the whole protection: it makes the optimiser pay for the extrapolation it is about to trust.
Worth keeping
- The KL penalty is a price on policy drift, not a correction to the reward model.
- A fitted reward is trustworthy near the responses it was trained on and unreliable elsewhere, so the penalty keeps optimisation inside that trustworthy region.
- Set the price too low and the optimiser exploits the fit; set it too high and the policy does not move.
Where this goes next
This question is one step of Learning From Reward, a course that works through its subject from the beginning. The page that teaches this part of it is When the Reward Is Itself Learned, and it reads the whole way through whether or not you have an account.
What an account changes is the practice: problems standing under every idea, marked with a reason rather than a tick, in a copy of the course that is yours.
Read that pageThe whole courseOther questions people ask about this
- Why is the REINFORCE gradient so noisy even though it is unbiased?Because unbiased only fixes the average, while one noisy return is multiplied by every action's score, so the estimate's spread grows with episode length and reward scale.
- Why does the value of a state have to satisfy a recursive equation with the next state's value?A state's value equals the reward from the next step plus the discounted value of wherever that step lands, because every possible future divides that way and averaging over the first step leaves exactly the next state's value.
- Why does PPO clip the probability ratio?PPO clips the probability ratio so the objective stops rewarding a policy for pushing an action further in the direction it already favours, while still penalising pushes the wrong way.
- How do human pairwise comparisons turn into a reward function?Human pairwise preferences become a reward by fitting a scoring model so that preferred responses score higher, then using that score with a penalty for drifting from the starting model.
- Why does the model get stuck repeating the same sentence over and over?The model is not stuck in a memory loop: once it has written a phrase, that phrase is in its context and makes writing it again more likely, so a decoder that always picks the top word cannot leave.
- Why does diffusion add Gaussian noise instead of any random corruption?Diffusion adds Gaussian noise because Gaussian errors combine exactly: each step keeps the spread fixed and gives a closed-form noisy picture at any later step, which makes the reverse step learnable.