Skip to main content

Chapter 12. Reward Models and Preference Learning for Evaluation

Suppose Harbor & Pine’s team compares two answers to the same support request: one is concise and correct, while the other is longer and sounds reassuring but includes an unsupported promise. If a reward model consistently prefers the longer answer, tuning the agent against its score may produce more detail without producing better help. A rising score alone cannot tell the team whether users value the extra explanation or the evaluator has learned a shortcut.

Preference data can turn comparisons into a learned evaluator, which can then support candidate selection, model training, and offline comparison. This chapter follows that path through Bradley–Terry and Elo before examining what happens when optimization encounters the evaluator’s blind spots. Before a reward model influences training or release, independent, human-reviewed holdouts and high-risk slices become especially important; otherwise, the team may only learn how effectively the agent satisfies its own proxy.

The numerical examples in this chapter are synthetic. They illustrate calculations and failure modes, not the performance of a deployed agent or a real reviewer population.

12.1 From Evaluation Scores to Reward Models

A comparison gives the team more information than a bare statement that one answer “looks good”: it records which of two candidates a reviewer preferred for the same input. If many such choices favor answers supported by the relevant policy, a model can learn a signal associated with that preference. What it learns, however, depends on the cases, reviewers, and criteria behind the comparisons, so the resulting score is not a direct observation of universal quality.

Definition 13.1 (Reward model). A reward model is a function \(\hat{R}: \mathcal{X} \times \mathcal{Y} \to \mathbb{R}\) that predicts the quality of an agent’s output \(y\) given input \(x\). It is trained on preference data: tuples \((x, y_w, y_l)\) where \(y_w\) is preferred over \(y_l\) by a human or oracle.

The Bradley–Terry model. A common preference model represents each response with a latent reward \(r(x, y)\), then turns the difference between two rewards into a predicted probability that one response will be preferred:

\[P(y_w \succ y_l \mid x) = \frac{\exp(r(x, y_w))}{\exp(r(x, y_w)) + \exp(r(x, y_l))} = \sigma\big(r(x, y_w) - r(x, y_l)\big),\]

where \(\sigma(z) = 1/(1 + e^{-z})\) is the logistic function. Equal rewards imply a predicted probability of one half, while a larger reward difference makes the first response more likely to win under the model. The observed preference supplies a training label, not a guarantee that every reviewer would make the same choice.

Maximum likelihood estimation. Given \(N\) preference pairs, the log-likelihood is:

\[\mathcal{L}(\theta) = \sum_{i=1}^{N} \log \sigma\big(r_\theta(x_i, y_{w,i}) - r_\theta(x_i, y_{l,i})\big),\]

where \(r_\theta\) is a parameterized reward model (e.g., a small transformer or MLP on top of an LLM embedding). Gradient ascent on \(\mathcal{L}\) trains it to assign higher relative scores to the observed winners, although those relative scores still need evaluation on comparisons the model did not see during training.

For a numerical check, suppose two responses have rewards 1.2 and 0.8. The model predicts \(P(y_1\succ y_2)=\sigma(1.2-0.8)=1/(1+e^{-0.4})\approx0.599\). The predicted 0.599 is modest evidence in favor of the first response according to the fitted model, but it does not establish that 59.9% of the deployment population would prefer that response. That interpretation requires representative, independently reviewed comparisons and calibration.

12.2 Elo, TrueSkill, and Agent Ranking

When the question shifts from comparing two responses to comparing several agents, pairwise results can be combined into a ranking. Although that ranking can prioritize follow-up, a numerical difference is not automatically meaningful: its interpretation depends on uncertainty and the mix of tasks each agent faced.

Elo rating. Elo keeps a running rating \(R_a\) for each agent. When \(a\) is compared with \(b\), its rating changes according to the observed result and the result expected under the current ratings:

\[R_a \leftarrow R_a + K(S_a - E_a), \qquad E_a = \frac{1}{1 + 10^{(R_b - R_a)/400}},\]

where \(S_a = 1\) if \(a\) wins, \(0.5\) for a tie, \(0\) if \(a\) loses, and \(K\) is the step size (typically 16–32). An unexpected win produces a larger update than a result already considered likely. The step size, comparison schedule, and task mix therefore affect the resulting table.

TrueSkill for agents. TrueSkill models each agent’s skill as a Gaussian \(\mathcal{N}(\mu_a, \sigma_a^2)\) and updates both mean and uncertainty after each comparison. Although the uncertainty can inform which comparisons to collect next, the basic rating is not automatically a separate estimate for each task slice. To investigate underrepresented slices, design slice-specific comparisons and use an appropriate model or report their results separately.

12.3 Reward Hacking in Evaluation

A ranking tells us which candidates the evaluation prefers, but it does not establish that the preference remains trustworthy once agents are trained or selected to maximize it. The length-biased support answer illustrates the risk: a feature correlated with a favorable label in the training data can become an easy target for optimization.

Definition 13.2 (Reward hacking). An agent or grader exploits the reward model’s blind spots to achieve a high score without improving true quality. Formally, the agent optimizes \(\hat{R}(x, y)\) rather than the true quality \(Q(x, y)\), and \(\hat{R} \neq Q\) in regions the agent discovers.

Example. A summarization agent rewarded for length may produce verbose summaries that score high on \(\hat{R}\) but are judged lower by humans. Similarly, a coding agent rewarded for passing a fixed set of unit tests may hardcode outputs for those particular cases. In each example, the measurable proxy improves while the broader quality it was intended to represent does not.

Detecting reward hacking. One diagnostic compares the reward model’s scores with an independently produced quality signal on a held-out set. The subtraction below is interpretable only if the two signals measure a comparable quantity on a meaningful common scale. Even then, an independent judge can share the reward model’s errors, so independence of the scoring process alone does not establish validity.

\[\text{Hacking gap} = \mathbb{E}_{(x,y) \sim \mathcal{D}_{\text{holdout}}}[\hat{R}(x, y) - \hat{Q}_{\text{holdout}}(x, y)].\]

An increasing positive gap is a warning that model scores are moving away from the independent quality signal, but it does not identify the cause on its own: incompatible scales, noisy labels, or a holdout that does not represent deployment can produce a similar pattern. Track the gap across training iterations, inspect paired errors and slices, and investigate those alternatives before calling it reward hacking.

Worked example: ranking update and holdout gap

Suppose two agents begin at Elo ratings \(R_A=R_B=1500\). Because their ratings match, the model expects \(E_A=1/(1+10^{(1500-1500)/400})=0.5\). If the adjudicated result of one paired task is an \(A\) win and \(K=24\), then \(R_A'=1500+24(1-0.5)=1512\); the opponent’s rating decreases by 12 under the symmetric update. The comparison unit is one adjudicated task pair, and this single update is not a reliable ranking by itself.

Now consider a different question: does a reward model agree with an independent quality signal? On a separate four-case holdout, suppose normalized reward-model scores are \([0.9,0.8,0.7,0.9]\) and independently adjudicated quality scores are \([0,1,0,1]\), with the two scales defined to be comparable for this illustration. The mean score gap is \(0.825-0.5=0.325\) points. Four cases cannot provide a stable estimate, so inspect paired errors and use a representative holdout with uncertainty intervals before a training or release decision.

from math import exp

rating_a = rating_b = 1500.0
k = 24.0
expected_a = 1.0 / (1.0 + 10 ** ((rating_b - rating_a) / 400))
rating_a += k * (1.0 - expected_a)
rating_b -= k * (1.0 - expected_a)

reward_scores = [0.9, 0.8, 0.7, 0.9]
human_scores = [0.0, 1.0, 0.0, 1.0]
hacking_gap = sum(r - h for r, h in zip(reward_scores, human_scores)) / len(reward_scores)
bt_probability = 1.0 / (1.0 + exp(-0.4))
print(f"Bradley-Terry preference probability: {bt_probability:.3f}")
print(f"Elo after one A win: A={rating_a:.1f}, B={rating_b:.1f}")
print(f"holdout mean score gap: {hacking_gap:.3f} over {len(human_scores)} cases")
Bradley-Terry preference probability: 0.599
Elo after one A win: A=1512.0, B=1488.0
holdout mean score gap: 0.325 over 4 cases

The positive gap calls for investigation, but it does not prove that the agent deliberately gamed the evaluator, since scale mismatch, label noise, or an unrepresentative holdout can produce the same signal. Moreover, a mean gap can hide offsetting case-level errors. Examine the paired cases and slices, verify that scores share a meaningful scale, and expand the independently labeled holdout before using the reward model as a gate.

Worked example: fit a tiny preference model and inspect a stratified holdout

The preceding example starts with scores already in hand, but a preference signal must first be learned. To see where it comes from, we can fit a deliberately small model and examine how it behaves on different kinds of held-out pairs.

Let \(x\) be the difference in a prespecified evidence-support feature between candidates A and B, and fit the one-parameter Bradley–Terry model \(P(A\succ B)=\sigma(wx)\) by regularized binary cross-entropy. One training observation is one independently adjudicated pair. Although this scalar model makes the calculation visible, it is not a useful substitute for a text representation in a real system.

The separate 20-pair holdout has routine, ambiguous, and high-risk strata in a stated 60%/25%/15% mix. For each stratum, the mean score gap is the mean predicted probability that A wins minus the mean human label for an A win. Because the overall calculation pools all pairs, it weights the stratum gaps by their proportions in this holdout; if the evaluation deliberately oversamples a slice, a deployment estimate needs appropriate population weights.

from math import exp

train_x = [-2, -1, -1, 0, 0, 1, 1, 2, -2, 2, 0, 1]
train_y = [0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1]

def sigmoid(value):
    return 1.0 / (1.0 + exp(-value))

weight = 0.0
learning_rate = 0.20
regularization = 0.05
for _ in range(500):
    gradient = sum(
        (sigmoid(weight * x) - label) * x
        for x, label in zip(train_x, train_y)
    ) / len(train_x) + regularization * weight
    weight -= learning_rate * gradient

holdout = {
    "routine": ([-2, -1, 1, 2] * 3, [0, 0, 1, 1] * 3),
    "ambiguous": ([-1, 0, 0, 1, 1], [0, 1, 0, 1, 1]),
    "high-risk": ([-2, -1, 2], [0, 0, 0]),
}
all_probabilities = []
all_labels = []
print(f"fitted weight: {weight:.3f}")
for name, (features, labels) in holdout.items():
    probabilities = [sigmoid(weight * x) for x in features]
    accuracy = sum(
        (probability >= 0.5) == bool(label)
        for probability, label in zip(probabilities, labels)
    ) / len(labels)
    gap = sum(probabilities) / len(probabilities) - sum(labels) / len(labels)
    print(
        f"{name}: n={len(labels)}, accuracy={accuracy:.3f}, "
        f"mean score gap={gap:+.3f}"
    )
    all_probabilities.extend(probabilities)
    all_labels.extend(labels)

overall_gap = (
    sum(all_probabilities) / len(all_probabilities)
    - sum(all_labels) / len(all_labels)
)
print(
    f"holdout overall: n={len(all_labels)}, "
    f"accuracy={sum((p >= 0.5) == bool(y) for p, y in zip(all_probabilities, all_labels))/len(all_labels):.3f}, "
    f"mean score gap={overall_gap:+.3f}"
)
fitted weight: 0.911
routine: n=12, accuracy=1.000, mean score gap=+0.000
ambiguous: n=5, accuracy=0.800, mean score gap=-0.057
high-risk: n=3, accuracy=0.667, mean score gap=+0.429
holdout overall: n=20, accuracy=0.900, mean score gap=+0.050

Across the 20 holdout pairs, accuracy is 18/20 and the mean score gap is \(0.05\). Those overall numbers conceal a different result in the high-risk slice, where the gap is \(0.429\), although the slice contains only three pairs. Under an illustrative predeclared rule that limits the absolute slice gap to \(0.10\), the model fails. The high-risk estimate is highly uncertain and these synthetic results say nothing about a deployment, but the example gate calls for holding the decision while collecting more independently labeled high-risk pairs. Report the interval and sample size for each slice, and use the deployment mix when estimating an overall population gap from a risk-oversampled holdout.

12.4 Preference Data Collection for Eval

Collecting more labels raises a practical question: which pairs should reviewers see? One approach favors examples the current model finds difficult, although an informative training example is not necessarily representative of user traffic or consequential for safety. The sampling strategy therefore needs to reflect more than model uncertainty alone.

Active preference sampling. Not all pairs are equally informative. A common selection rule queries pairs where the reward model is most uncertain:

Let \(p=P(y_a \succ y_b\mid x)\). Binary predictive entropy \(H(p)=-p\log_2p-(1-p)\log_2(1-p)\) is highest at \(p=0.5\) and approaches zero as the preference becomes certain. Under the Bradley–Terry link above, that uncertainty corresponds to a small absolute reward difference. For \(p=0.5\), \(H=1\) bit; for \(p=0.95\), \(H\approx0.286\) bits.

from math import log2

def binary_entropy(p):
    if not 0.0 <= p <= 1.0:
        raise ValueError("p must be between 0 and 1")
    return 0.0 if p in (0.0, 1.0) else -p * log2(p) - (1 - p) * log2(1 - p)

for probability in (0.5, 0.95):
    print(f"p={probability:.2f}: entropy={binary_entropy(probability):.3f} bits")
p=0.50: entropy=1.000 bits
p=0.95: entropy=0.286 bits

The unit is one candidate pair; a mean uncertainty report divides by all eligible pairs scored. Entropy can prioritize review, but a near-tie may be genuinely ambiguous or low-impact. For that reason, keep representative random and high-risk sampling alongside uncertainty sampling, and account for the sampling design when making population estimates. Targeted high-risk cases can inform safety decisions without necessarily representing how often those cases occur.

Pairwise and pointwise labels serve different purposes. A 1–5 rating is relatively easy to collect, although reviewers may use the scale differently. Pairwise comparisons avoid asking reviewers to assign the same absolute score, but comparing every pair of \(N\) candidates can require \(O(N^2)\) comparisons; a sampled comparison design need not collect them all. Pairs are useful for ranking, while anchored pointwise labels can help when an absolute quality threshold matters. Neither approach eliminates the need for clear criteria and reviewer calibration.

12.5 Connecting Eval to Fine-Tuning and RL

The same learned score can influence an agent in different ways: a team might use it to select a candidate response, to supply a reward signal during training, or to score outputs offline. These workflows are related, but they make different demands on the evaluator and should not be treated as interchangeable.

Verifiers and reward models. In reinforcement learning with verifiable rewards (RLVR), the training reward comes from a verifier for a checkable criterion, such as a test against an authoritative result. A learned preference model may provide a separate reward signal, but a model’s preference score is not automatically a verifiable reward. Selecting the highest-scoring candidate and using it as a supervised fine-tuning target is another possible workflow; selection alone is not reinforcement learning.

For offline evaluation, a reward model can score agent outputs at scale, reducing the amount of human review needed for individual cases. Even so, it does not eliminate the need for independent human labels to qualify the judge, inspect errors, and validate decisions.

Distribution alignment. A reward model trained on preferences from one task mix may misrank outputs in another. Before using \(\hat{R}\) to steer training or make a release decision, test it on a domain-specific holdout and compare its errors with qualified human labels. The more strongly the agent is optimized against the score, the more important it becomes to check whether the score still tracks the intended quality.

12.6 Exercises

The exercises move from fitting and ranking to the question that opened the chapter: when a proxy improves, what independent evidence shows that the underlying quality improved too?

  1. (Conceptual) Given 1000 preference pairs, how would you estimate the Bradley–Terry reward model? What regularization would you use?
  2. (Hands-on) Implement Elo rating updates for 5 agents across 20 pairwise comparisons. Plot rating trajectories.
  3. (Conceptual) A reward model gives higher scores to longer responses. Is this reward hacking or a legitimate quality signal? How would you test?
  4. (Hands-on) Compute the hacking gap between a reward model and a holdout human judge on 200 examples whose scores measure a comparable quantity on a justified common scale. Interpret the sign and magnitude, and inspect cases whose errors cancel in the mean.
  5. (Discussion) In your domain, what preference data already exists (tickets, thumbs-up/down, escalations)? How would you convert it into pairwise comparisons?

12.7 Further Reading

These sources offer background on learning from human preferences and on the ranking methods used in the chapter:

  • Christiano et al., “Deep Reinforcement Learning from Human Preferences” [1].
  • Stiennon et al., “Learning to Summarize from Human Feedback” [2].
  • Bai et al., “Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback” [3].
  • Elo, “The Rating of Chessplayers, Past and Present” [4].
  • Herbrich et al., “TrueSkill: A Bayesian Skill Rating System” [5].
[1]
P. F. Christiano, J. Leike, T. B. Brown, M. Martic, S. Legg, and D. Amodei, “Deep reinforcement learning from human preferences,” in Advances in neural information processing systems (NeurIPS), 2017.
[2]
N. Stiennon, L. Ouyang, J. Wu, D. Ziegler, et al., “Learning to summarize with human feedback,” in Advances in neural information processing systems, 2020, pp. 3008–3021. Available: https://arxiv.org/abs/2009.01325
[3]
Y. Bai et al., “Training a helpful and harmless assistant with reinforcement learning from human feedback.” 2022. Available: https://arxiv.org/abs/2204.05862
[4]
A. E. Elo, The rating of chessplayers, past and present. Arco Publishing, 1978.
[5]
R. Herbrich, T. Minka, and T. Graepel, “TrueSkill: A bayesian skill rating system,” in Advances in neural information processing systems, 2007, pp. 569–576. Available: https://papers.nips.cc/paper_files/paper/2006/hash/f44ee263952e65b3610b8ba51229d1f9-Abstract.html