A reward model learns a score from comparisons of answers. This schematic shows the output layer and the loss; its training panel adjusts two independent scores, rather than training a language model.
1 · the head swap
last hidden state h
word head → P(next token)
score head → 1 number
The pretrained LLM ends in a vocabulary head: |V| bars, one probability per token. Click to replace it.
2 · train on one preference pair
prompt x
"How much garlic for one pizza?"L = −log σ(r_w − r_l)
Here the two scores are independent variables, so each update raises r_w and lowers r_l. A real reward model shares weights across answers; an update need not improve every pair.
3 · use it — best-of-N sampling
These four illustrative scores show the best-of-N rule: keep the highest-scored candidate. The widget does not generate or evaluate real answers.
The whole trick: turn a judgment (which is better) into a number (a reward) you can optimise.