Explain how a reward model is trained from pairwise human preferences.
A reward model learns from chosen-vs-rejected pairs by pushing the preferred completion to a higher scalar score with a Bradley-Terry pairwise objective.
Imagine two essays on the same topic and a teacher says which one reads better. You do not get a perfect scorecard, only who won. After thousands of these mini face-offs, you can train a coach that predicts which essay humans would pick. That coach is the reward model. In RLHF, the model reads two candidate answers, gives each a score, and learns to rank the human-preferred one higher. Later, RLHF trains the policy model to produce answers that this coach tends to score well.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
A reward model reads a prompt and a response and outputs one number: how good the response is. People cannot give such numbers reliably, but they can say which of two responses is better. The Bradley-Terry model bridges the two. It treats each response as having a hidden score. The chance that one response beats another depends only on the difference between their scores.
Training then becomes logistic regression on pairs. For each comparison, the reward model scores the chosen and the rejected response, and the loss pushes the chosen score above the rejected one. The result is a scorer that RL, best-of-n sampling or data filtering can use.
The Bradley-Terry model turns scores into win probabilities
The Bradley-Terry model comes from 1952 work on paired comparisons, long before language models. Each item i has a strength. The probability that item i beats item j is its strength divided by the total strength of the pair. Writing strengths as exponentials of scores, e^{r_i}, gives a clean form:
Here x is the prompt, y_w is the preferred (winning) response, y_l is the rejected (losing) one, and σ is the logistic sigmoid.
Three properties follow from this form. Only the difference between scores matters, so adding the same constant to every score changes nothing. A difference of 0 means a coin flip, and each extra unit of difference moves the win probability along the sigmoid. The model is also transitive by construction: if A usually beats B and B usually beats C, then A has the higher score and usually beats C. Real human preferences are not always transitive, and the model cannot represent such cycles.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- InstructGPT trained a 6B reward model on rankings of 4 to 9 responses per prompt, with all pairs from a prompt in one batch element
- Llama 2 trained separate helpfulness and safety reward models with a margin term set by how strongly annotators preferred one response
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you detect length bias in a reward model before PPO?
Slice evaluation pairs by completion length and compare reward deltas to human preference consistency across bins.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Treating reward-model training as normal classification. That misses the ranking objective, which is built on score differences between paired completions.
60 second bullets to scan on the way to the call.
Bradley-Terry probability from score difference
Why pairwise labels are easier than absolute ratings
Primary sources. Browse if you want the original framing.
- Bradley and Terry, Rank Analysis of Incomplete Block Designs: I. The Method of Paired Comparisons
- Christiano et al., Deep reinforcement learning from human preferences
- Ouyang et al., Training language models to follow instructions with human feedback
- Touvron et al., Llama 2: Open Foundation and Fine-Tuned Chat Models
- Hugging Face TRL, RewardTrainer source
Same topic, related formats. Practice these next.