Answers · How models work
How do human pairwise comparisons turn into a reward function?
In shortHuman 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.
Fit a scoring function so that, for two responses to the same prompt, the one people preferred gets the larger score. The comparison is not used as a score directly: it constrains only the difference between two scores, and those constraints train the scoring function.
- the chance a rater prefers the first response to the second
- the logistic curve, turning an unbounded gap into a probability
- the gap between the two fitted scores, the only thing a comparison can inform
The bridge is an assumption: a single underlying score exists, and a person's choice is a noisy readout of the gap between two scores. The logistic curve maps any real gap to a probability. A gap of 0 gives 0.5, a positive gap gives more than 0.5, and a negative gap gives less than 0.5. Fitting chooses to make the observed choices likely. If a rater prefers to , the loss pushes above ; if the rater prefers , it pushes the other way. The push is largest when the model is uncertain, near a gap of 0, and shrinks once the model already predicts the comparison with near certainty.
For one comparison, write the gap as . The model assigns the preferred response probability . If , then , so the probability is and the loss is . If the same pair were ordered the other way, so , then , the probability is , and the loss is . The wrong ordering is charged more, and that difference is what moves the scores.
At , , so the first derivative is and the second is . A gradient step raises the preferred response's score and lowers the other's by the same amount. The scoring function is therefore trained on differences, not on an absolute scale.
Only gaps are identified
Add 10 to every score and nothing in the fit changes, because . The logistic probability is unchanged. The fitted reward has no zero point and no natural units, so it cannot be compared across runs without care. This is also why a baseline is not optional in the policy gradient: the absolute level of the score carries no information, only its variation across responses does.
Where the natural guess fails
The natural guess is that once has been fitted, it is a reward function and can be optimised as hard as you like. That guess fails because is accurate only near the responses it was trained on, which look like the starting model's outputs. Far away it is extrapolation. An optimiser does not seek helpful answers; it seeks high scores, and the highest scores in a large response space are disproportionately where the fit is mistaken. A reward model can be 90% accurate on held-out comparisons and still be useless as an optimisation target, because held-out comparisons are drawn from the same narrow distribution. The visible failures are answers that hedge every sentence, restate the question, copy whatever tone the comparisons rewarded, and commit to nothing.
| fitted score | divergence from the star | quality judged by people | |
|---|---|---|---|
| a direct answer with one | 1.2 | 0.5 | 8.0 |
| a long hedge that commit | 4.8 | 0.3 | 2.0 |
The tether
The objective therefore does not use alone. It charges the policy for moving away from the model it started from, so the fitted score is worth believing only inside a region.
- the model training started from, held fixed for the whole run
- how dearly distance is charged, the one knob trading reward against drift
- how much likelier this response became, which is the divergence charged per token
Suppose , so the new policy makes the response times likelier. With the penalty is ; a fitted score of 4.0 becomes . With the penalty is and the same response becomes . The tether does not change the fitted score; it changes how much score is worth paying for in drift.
Where the tether stops helping
If is close to zero the charge is negligible, the policy runs to the fit's errors, and measured reward can rise while human quality falls. If is too large, every response is charged so heavily that the policy barely moves and the fitted reward is never exploited. The tether also assumes the starting model is a sensible anchor: if it is already far from acceptable, the penalty protects the wrong region. And the logistic assumption itself is only an assumption. Human preferences are not always consistent with one underlying score, so some of what learns is noise from those inconsistencies, not a stable quality signal.
Worth keeping
- A comparison tells you which of two responses is preferred; it never gives an absolute score.
- A reward fitted from comparisons is reliable only near the responses it was trained on, so optimising it hard can reward answers that are worse by human judgement.
- Penalising divergence from the starting model keeps the policy where the fitted reward still means something.
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.
- What is the KL penalty against the original policy actually protecting against?It 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.
- 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.
- 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.