liveBook · Manning

Chapter 5: Reward modeling

What you will learn in chapter 5 of Reinforcement Learning from Human Feedback

This introduction explains why reward models make human preferences usable for RLHF optimization and how a learned reward model supplies the agent’s learning signal.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction explains why reward models make human preferences usable for RLHF optimization and how a learned reward model supplies the agent’s learning signal.

Key terms: reward models, human preferences, proxy objectives, reward model, learning signal, scalar value of reward, Bradley–Terry reward model, pairwise preference relation

5.1 Training a Bradley–Terry reward model

This section explains how a Bradley–Terry reward model turns pairwise preferences into scalar scores and a training loss.

Key terms: Bradley–Terry (BT) model, latent strength, scores, sigmoid, reward model, scalar score, linear head, prompt–completion pair, chosen, rejected

5.2 Implementation example

This section shows how a reward model scores chosen and rejected prompt–completion pairs and turns a language model’s hidden state into a scalar reward.

Key terms: inputs_chosen, inputs_rejected, data loader, inference pipeline, causal language model, attention_mask, output_hidden_states, last non-padding token, linear head, scalar reward

5.3 Reward model variants

This section introduces reward model variants as an under-explored area with no settled best practice for modifying the traditional loss.

Key terms: reward modeling, traditional reward modeling loss, best practice

5.3.1 Preference margin loss

This subsection explains how preference-strength information can be retained in reward-model training instead of reducing ratings to a chosen–rejected pair.

Key terms: Likert Scale, chosen and rejected completions, preference margin, m(y_c, y_r)

5.3.2 Balancing multiple comparisons per prompt

Explains why pairwise comparisons from the same prompt are grouped and averaged when training a reward model.

Key terms: pairwise comparisons, reward model, training batch, grouped update

5.3.3 K-wise loss function

This subsection introduces a K-wise reward-model loss that uses rankings of multiple actions and relates it to pairwise Bradley–Terry modeling.

Key terms: K-wise loss function, Plackett–Luce model, permutation, BT model

5.4 Outcome reward models

This section explains how outcome reward models learn to predict whether a completion’s final answer is correct, and distinguishes them from pairwise Bradley–Terry reward models.

Key terms: ORM head, per-token, binary cross-entropy, mask, completion tokens, Bradley–Terry, BT model, chosen-rejected, contrastive, sequence-level loss, outcome reward model

5.5 Process reward models

This section explains how process reward models score individual reasoning steps and how step labels are used in training.

Key terms: process reward models, PRMs, reasoning step, process supervision, per-step cross-entropy loss, annotated steps, predicted probability, step boundaries, incorrect, neutral

5.6 Comparing reward model types (and value functions)

This section compares reward model types, focusing on how outcome reward models differ from value functions despite similar outputs, and where the boundaries between model types blur.

Key terms: ORM, value function, offline labels, on-policy rollouts, advantages, discount factor, remaining-sum, PRM, per reasoning-step label

5.6.1 Inference across reward model types

This section compares what four model types take as input, what they output, and how their scores are used at inference time or during RL training.

Key terms: Bradley–Terry RM, scalar, terminal reward, best-of-N sampling, Outcome RM, Process RM, per-token probabilities, step boundaries, aggregation, value function

5.7 Generative reward modeling (a.k.a. LLM-as-a-judge)

This section explains how language models can judge pairs of completions, why post-training recipes use them, and how they compare with reward models.

Key terms: LLM-as-a-judge, preference data, completions, generative reward models, RMs, post-training recipes, sampling temperature, variance of ratings

5.8 Further reading

This section points readers to reward-model benchmarks and training research while explaining how reward-model evaluation has broadened.

Key terms: RewardBench, RMs, LLM-as-a-judge

5.9 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 4: Instruction fine-tuning Chapter 6: Reinforcement learning →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.