Modelresearch
Preference reward model
Also called Bradley-Terry reward model.
A network that scores a response so that the chance one response is preferred to another is the sigmoid of the score difference.
A preference reward model is a network that maps a prompt and a response to one real number, the reward. It is trained on human comparisons: a person sees two responses to the same prompt and picks one. The model assumes that the chance that is picked over is , with . This is the paired comparison model of Bradley and Terry (1952), which has no page of its own here. The reward model is one part of reinforcement learning from human feedback (RLHF), the pipeline that first fits this model and then tunes a policy against it with PPO. Direct preference optimization (DPO) fits the same Bradley-Terry likelihood, but its reward is implicit in the policy, so it trains no separate reward model. Instruction tuning is supervised fine-tuning on written demonstrations and uses no comparisons at all.
The machine
Shapes. The prompt and the response are joined into one sequence of tokens from a vocabulary of size . The backbone is a pretrained transformer of width , often the model after supervised fine-tuning. Ouyang et al. (Section 3.5) start from that model and remove the final unembedding layer, a matrix. In its place goes a head with a weight vector of size and a bias .
- The input is token ids. The embedding gives an matrix.
- The transformer layers give the hidden states , also .
- A common design reads the final hidden state of the last token, a vector of size , and returns , one number.
So the head adds parameters, and the model costs the same as one forward pass of the backbone.
The likelihood. Bradley and Terry give each item a strength and set . With this is
The loss of one comparison is the negative log likelihood, , the logistic loss of the score difference. Its derivatives are
and backpropagation carries them into the network. For example, and give , a loss of and a derivative of with respect to . Equal rewards give the loss .
Rankings of K responses. Ouyang et al. (Section 3.5) show a labeler between and responses to rank. A ranking gives comparisons. All comparisons of one prompt go into one batch element, with the loss
This needs one forward pass for each of the responses instead of two for each of the pairs. For responses ranked in order with rewards , the six pair losses average to .
Only differences count. Add any to every reward of a prompt and every probability stays the same. So the data fix the reward of one prompt only up to a constant. Ouyang et al. (Section 3.5) add a bias so that the labeler demonstrations get a mean score of 0 before reinforcement learning.
What it counts
The size of a task is , the number of comparisons, , the number of responses for one prompt, , the number of tokens of a sequence, and , the width. One forward pass of the backbone on tokens costs per layer, as on the transformer page. The head and the loss add per response and per pair.
The quantities that people measure are these.
- Pairwise accuracy. The share of held-out comparisons in which . People do not agree with each other on every pair, so this accuracy has a ceiling well under 1.
- Log loss. The mean of on held-out pairs. It also checks that the predicted probabilities are calibrated, not only that the order is right.
A small example with a table of rewards. Take one prompt and three responses A, B and C with free rewards, no network. The data are 13 comparisons: A beat B 3 times and lost once, B beat C 3 times and lost once, and A beat C 4 times and lost once. The maximum likelihood rewards, scaled so that they sum to 0, are . At the maximum, the number of wins of each response equals the sum of its predicted win probabilities over its comparisons: 7 for A, 4 for B and 2 for C. The fitted model gives , against an observed share of 0.75, and , against 0.8. A single strength for each response cannot match all three shares. The negative log likelihood falls from at equal rewards to . Hunter's MM update (Hunter 2004), which multiplies each strength by the ratio of its wins to its expected wins in a form that never decreases the likelihood, finds these values. It is a relative of the expectation-maximization algorithm.
Relation to other models
- Logistic regression. If the reward is linear in a fixed feature vector, , the loss is logistic regression on the difference with the label 1 and no intercept. A preference reward model replaces with a transformer whose weights are also trained.
- Learning to rank. RankNet scores documents for a query with a network and trains on pairs with the same pairwise logistic loss. A reward model is a pairwise model of learning to rank whose query is a prompt and whose documents are responses.
- DPO. DPO uses the reward of a policy and a frozen reference , and puts it into the same Bradley-Terry loss.
- Inverse reinforcement learning. Inverse reinforcement learning recovers a reward function from what an expert does. A preference reward model recovers it from what a person says about two outcomes. In the language setting, the episode is one prompt and one response, and the reward comes only at the end.
- Kemeny rank aggregation. Kemeny rank aggregation also turns many pairwise preferences into one order, but it finds the order with the fewest disagreements and has no probabilities.
- Ratings on a scale. A mean opinion score asks people for an absolute rating. A comparison asks only which of two is better, which needs no shared scale between people.
Known results in the model
- Theorem (a convex loss for a linear reward). Hypotheses: the reward is linear in fixed features, . Then is convex in and is linear in , so the loss is convex in . For a transformer the loss is not convex in the weights, and training finds a local solution. This is the standard argument for logistic regression.
- Theorem (existence and uniqueness, Zermelo 1929 and Ford 1957). Hypotheses: the table model with one free reward per item, and a directed graph with an edge from to when beat at least once. Then the maximum likelihood rewards exist and are unique up to an additive constant if and only if the graph is strongly connected. If some item never lost, its reward goes to infinity. Hunter (2004) states the condition and proves that the MM update converges under it.
- Theorem (the model is transitive). Hypotheses: preferences follow the Bradley-Terry model. If and , then , so , because is increasing. So the model cannot fit a cycle. Example: if A beats B, B beats C and C beats A, each 9 times out of 10, the maximum likelihood rewards are all equal and the model predicts 0.5 for every pair, although each observed share is 0.9.
- Measurement (people disagree). Ouyang et al. (Section 3.4) report that training labelers agree with each other on of comparisons and held-out labelers on . In Section 4.1 they split the labelers into 5 groups and trained reward models on 4 of them. The accuracy on the held-out group was , against on the training groups.
- Measurement (correlated pairs overfit). Ouyang et al. (Section 3.5) found that if the comparisons of a prompt are shuffled into one data set as separate examples, one pass over the data overfits the reward model. Putting them into one batch element fixed this. They trained for a single epoch, because more epochs overfit (Appendix C.2).
- Measurement (size and stability). Ouyang et al. used a 6B reward model for policies of all sizes. A 175B reward model could reach a lower validation loss, but its training was less stable and it was more expensive as the value function of PPO (Appendix C.2).
- Measurement (overoptimization). Gao, Schulman and Hilton (2022) labeled data with a 6B gold reward model, trained proxy reward models of 3M to 3B parameters on it, and optimized a 1.2B policy against the proxy. With , the gold score fit for best-of-n sampling and for reinforcement learning (Section 1). Both rise and then fall: pushing too hard on the proxy lowers the true score. With 90,000 comparisons, the coefficients changed smoothly with the size of the proxy model (Section 3.2). This is a fit to one synthetic setup, not a law for all reward models.
References
- Bradley and Terry 1952, the paired comparison model, with the probability that i beats j equal to the ratio of the strength of i to the sum of the two strengths
- Paul Christiano, Jan Leike, Tom B. Brown, Miljan Martic, Shane Legg and Dario Amodei, Deep reinforcement learning from human preferences, 2017, Section 2.2 (fitting the reward function to comparisons of trajectory segments with the Bradley-Terry model)
- Nisan Stiennon, Long Ouyang, Jeff Wu and others, Learning to summarize from human feedback, NeurIPS 2020, Section 3.4 (the reward model, a language model with a scalar head trained on pairs of summaries)
- Long Ouyang, Jeff Wu, Xu Jiang and others, Training language models to follow instructions with human feedback, NeurIPS 2022, Section 3.5 (the reward model, equation 1, the K-way ranking loss and the normalization by a bias), Section 3.4 (agreement between labelers), Section 4.1 (accuracy on held-out labelers), Appendix C.2 (the 6B reward model and its training)
- Leo Gao, John Schulman and Jacob Hilton, Scaling laws for reward model overoptimization, 2022, Section 1 (the functional forms of the gold score in the square root of the KL divergence), Section 2.1 (the synthetic setup with a 6B gold reward model), Section 3.2 (scaling with the size of the reward model), Section 3.6 (the effect of the KL penalty)
- Hunter 2004, the MM update for the Bradley-Terry maximum likelihood estimate, and the condition of Zermelo and Ford for existence and uniqueness
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 6TWK9K Edit this page History Report an error Markdown