Section 11

Reward models

Bradley–Terry and what an RM really learns

Statistical foundation: Bradley & Terry, Rank Analysis of Incomplete Block Designs: I. The Method of Paired Comparisons (Biometrika, 1952)

Step 2 of the RLHF recipe asks for something that sounds almost paradoxical: turn a pile of human “this beats that” judgments into a function that can score any response with a single number, including responses no human ever ranked. That function is the reward modelreward model (RM)A model trained from human preference data to output a scalar score for how good a response is. Stands in for a human judge so RL can query reward millions of times.See in glossary →, and this chapter is about what it is, how it’s trained, and (just as important) what it secretly is and isn’t.

What a reward model is in practice

A reward model is commonly a language-model backbone with a scalar head: a final output layer which outputs a single number. The backbone may be initialized from a pre-trained or SFT checkpoint; the usual language-model vocabulary head is replaced or bypassed for scoring. A linear head maps a sequence representation (often the hidden state at the final response token) to one number, the reward rθ(x,y)r_\theta(x, y) for response yy given prompt xx.

Starting from a capable language model is useful because the reward model needs to interpret the prompt and response. The scalar head is normally initialized afresh, while the backbone is then fine-tuned as well; implementations differ in whether they start from a base or SFT checkpoint.

The Bradley–Terry model: from scores to preferences

Here’s the central problem. Our data is comparisons (ywy_w beat yly_l) but we want to output a scalar score. We need a bridge that says: given two scores, what’s the probability a human prefers one over the other? The Bradley–TerryBradley–Terry modelA simple rule for turning "A beats B" comparisons into a single score per item: the bigger an item's score over another, the more likely it wins. A reward model produces exactly such a score.See in glossary → model, from 1952, is exactly that bridge.

It says the probability that the winner is preferred to the loser is the softmaxsoftmaxFunction that turns any vector into a probability distribution (positive, sums to 1) by exponentiating and normalizing.See in glossary → (here in its two-item form, the logistic sigmoidsigmoidThe logistic function σ(z)=1/(1+e⁻ᶻ), which squashes any real score into a probability between 0 and 1. Turns a linear model into a binary classifier.See in glossary → σ\sigma) of the difference in their scores:

P(ywyl)=σ(r(yw)r(yl))=11+e(r(yw)r(yl))P(y_w \succ y_l) = \sigma\big(r(y_w) - r(y_l)\big) = \frac{1}{1 + e^{-(r(y_w) - r(y_l))}}

First, the notation: P(ywyl)P(y_w \succ y_l) reads “the probability that ywy_w is preferred to yly_l”. The \succ symbol is the standard preference-ordering symbol (a curly “greater than”: preferred to, rather than numerically bigger than), and the subscripts follow the dataset convention from above: ww for the winning response, ll for the losing one.

Read it intuitively. If the two scores are equal, the difference is zero and σ(0)=0.5\sigma(0) = 0.5, a coin flip, as it should be. As the winner’s score pulls ahead, the difference grows positive and the probability climbs toward 1. The model is a smooth, probabilistic statement that bigger score means more likely to be preferred, with the gap controlling how confident the preference is.

The logistic sigmoid, up close

Since σ\sigma carries the whole bridge, it’s worth pausing on what this function actually is. The logistic sigmoid is

σ(z)=11+ez,\sigma(z) = \frac{1}{1 + e^{-z}},

a machine that takes any real number (a score gap of 3-3, 0.20.2, +40+40, anything) and squashes it into a probability strictly between 0 and 1. Plotted, it’s an S-shaped curve: near-zero on the far left, climbing steeply through σ(0)=0.5\sigma(0) = 0.5 in the middle, then flattening out near 1 on the far right. Four of its properties do all the work in this chapter:

  • It’s monotonic. A bigger input always means a bigger output, so “higher reward gap” always translates to “more likely to be preferred”, never the reverse. That is the minimum sanity requirement for a preference model.
  • It’s symmetric around the midpoint: σ(z)=1σ(z)\sigma(-z) = 1 - \sigma(z). Swap winner and loser and the probability flips to its complement, so P(ywyl)+P(ylyw)=1P(y_w \succ y_l) + P(y_l \succ y_w) = 1 automatically. The two possible outcomes always account for all the probability, with no extra bookkeeping.
  • It saturates. Once the gap is large (around z>4|z| > 4, where σ(z)\sigma(z) passes 0.980.98), pushing it further barely changes the probability. A reward model that scores the winner miles above the loser gets almost no additional credit over one that scores it comfortably above: the loss cares about getting the order right with a decent margin, not about inflating the gap forever.
  • Its inverse is the log-oddslogit / scoreThe raw, unbounded linear output (w·x + b) before it is squashed by a sigmoid or softmax into a probability.See in glossary →. If p=σ(z)p = \sigma(z), then z=logp1pz = \log\frac{p}{1-p}. So the score gap isn’t just some number that happens to produce a probability: it is the log-odds of the preference. A gap of 00 means even odds, a gap of about 2.22.2 means 9-to-1, a gap of 4.64.6 means 99-to-1. This gives reward-model score differences concrete meaning: units of log-odds of winning a human comparison.

Training the reward model

Now training is a one-liner. We have a labeled preference (x,yw,yl)(x, y_w, y_l): we observed the human prefer ywy_w. The Bradley–Terry model gives us the probability our reward function assigns to that observation. We just maximize that probability, which is the same as minimizing its negative log, a maximum-likelihood fit. For a single example:

L(θ)=logσ(rθ(x,yw)rθ(x,yl))\mathcal{L}(\theta) = -\log \sigma\big(r_\theta(x, y_w) - r_\theta(x, y_l)\big)

This is the entire reward-model objective. It is exactly a binary cross-entropycross-entropy lossA classification loss that penalizes the model according to the negative log-probability it assigned to the correct answer.See in glossary → loss on the preference label, and it does precisely what you’d want: it pushes the score of the chosen response up and the score of the rejected response down, until the gap between them is large enough that σ\sigma of the difference is close to 1. Average it over your whole dataset of triples, run gradient descent, and you have a reward model.

What the reward model actually learns, and a subtlety

It’s tempting to think the reward model learns “the quality” of a response in some absolute sense. It doesn’t. Look again at the loss: only the difference rθ(x,yw)rθ(x,yl)r_\theta(x, y_w) - r_\theta(x, y_l) ever appears. If you added the same constant to every score the model produces, every difference (and therefore every preference probability and the entire loss) would be completely unchanged.

This means the reward model is only identified up to an additive function of the prompt: adding the same c(x)c(x) to every candidate response for prompt xx leaves every within-prompt comparison unchanged. Its absolute scale and offset are therefore not directly identified by pairwise data; relative scores for comparable candidates are what the loss constrains. Implementations may normalize or calibrate scores for optimization, but that is an additional convention rather than information recovered from Bradley–Terry labels.

And what the model has actually learned is a proxy for human judgment: a compression of thousands of human “this beats that” clicks into a function that generalizes to new responses. It is not truth, not a ground-truth quality oracle; it’s a learned approximation, and a flawed one. That flaw is not a footnote. Optimizing too hard against an imperfect proxy is reward hackingreward hackingWhen a policy finds ways to score high on the reward model without actually being better — exploiting quirks of an imperfect proxy. A central danger of RL post-training.See in glossary →, the failure mode that gets its own chapter (19), and measuring how good a reward model even is launched a benchmark, RewardBenchRewardBenchA standard benchmark for evaluating reward models across chat, safety, and reasoning, making reward-model quality measurable and comparable.See in glossary →, that we cover in chapter 31.

Try it

The widget below makes Bradley–Terry tangible. Set an underlying score for each of two responses and watch how the preference probability P(AB)=σ(sAsB)P(A \succ B) = \sigma(s_A - s_B) responds. Notice the two facts from above: equal scores give exactly 0.5, and only the gap between the scores matters. Shift both by the same amount and the probability doesn’t budge.

Bradley–Terry: scores to preferences
A reward model gives each response a hidden scalar score. The chance a human prefers one over the other is the logistic of the score gap.
Response A · underlying score sA = 1.20
Response B · underlying score sB = -0.40
−30+3
P(A ≻ B) = σ(sA − sB)
−60+6
score gap sA − sB = 1.60
P(A beats B)
83.2%
P(B beats A) = 16.8%
A reward model turns pairwise human preferences into scalar scores via exactly this Bradley–Terry / logistic relationship. Pressing Train on "A > B" applies one gradient step of the loss −log σ(sA − sB): it nudges sA up and sB down, and the step shrinks as the model already becomes confident that A wins.

Where this is going

We now have a learned, automatic stand-in for human preference: a scalar reward we can query on any response. Chapter 12 asks what happens when even the comparisons feeding this model come from an AI rather than a human: the move to RLAIF and Constitutional AI. After that, Section 4 finally opens the other black box from the recipe: the reinforcement learning that turns this reward signal into an improved policy.