Reward Models · Chapter 11
The implicit reward model: a reward hidden in the policy
1. A reward inside the policy
Classical RLHF learns a reward, then optimises a policy against it. DPO skips the first stage.
Explicit reward model
Train \(r_\phi(x,y)\) on preference pairs with the Bradley-Terry loss. Then run PPO on the policy, using \(r_\phi\) as the reward.
pairs → r_φ → PPO → π
Implicit reward model
Train the policy directly on the same pairs. The reward is never a separate network; it is a function of the policy's own probabilities.
pairs → π
This is not a heuristic shortcut. Under the same assumptions as classical RLHF, the two routes target the same optimal policy. Sections 3 to 6 show why.
2. Definition
Let \(\pi_\theta\) be the policy being trained and \(\pi_{\text{ref}}\) a frozen reference model, usually the supervised fine-tuned model that training starts from. Fix a scale \(\beta>0\).
The implicit reward of a response \(y\) to a prompt \(x\) is
The reward is positive when the trained policy has made \(y\) more likely than the reference did, negative when it has made \(y\) less likely, and zero before training starts, when \(\pi_\theta=\pi_{\text{ref}}\). It measures how far training moved the probability of \(y\), not how probable \(y\) is.
For example, with \(\beta=0.1\), a response whose log-ratio is \(2\) gets \(\hat r=0.2\), and one whose log-ratio is \(0.5\) gets \(\hat r=0.05\). The first is preferred.
3. The KL-regularised objective
Start from the objective that PPO-based RLHF optimises. Given a reward \(r(x,y)\), maximise expected reward while staying close to the reference model:
The KL term stops the policy from drifting into text the reward model has never seen and can be fooled by. Larger \(\beta\) means a tighter leash. The objective splits over prompts, so from here on we fix one prompt \(x\).
4. The optimal policy has a closed form
Define the normaliser and a candidate policy:
Write the KL as an expectation and collect terms. Since \(r=\beta\log\big(\pi^*Z/\pi_{\text{ref}}\big)\) by Equation (2),
The last term does not depend on \(\pi\). The KL term is never negative and is zero only when \(\pi=\pi^*\).
For a fixed reward \(r\) and \(\beta>0\), the unique maximiser of Equation (1) is \(\pi^*(y\mid x)\propto\pi_{\text{ref}}(y\mid x)\,e^{r(x,y)/\beta}\). The optimal policy reweights the reference model, raising each response by a factor that grows exponentially with its reward.
This closed form is of no direct use for sampling: \(Z(x)\) sums over every possible response, which is astronomically many sequences. Its value is what it says about the relation between \(r\) and \(\pi^*\).
5. Inverting: the reward in terms of the policy
Take logs in Equation (2) and solve for \(r\):
Read in this direction, the equation says that a policy determines a reward. Any policy \(\pi_\theta\) is the optimal policy of Equation (1) for the reward \(\beta\log(\pi_\theta/\pi_{\text{ref}})+\beta\log Z(x)\). The first term is the implicit reward of Definition 11.1. The second is a problem: it is intractable.
6. Why \(Z(x)\) cancels
Preference data only ever compares two responses to the same prompt. Under the Bradley-Terry model of the scalar chapter, the probability of a preference depends only on the reward difference. Substitute Equation (4) for both rewards:
The two copies of \(\beta\log Z(x)\) are equal, because both responses share the prompt \(x\), and they subtract to zero. What remains involves only the policy and the reference, both of which we can evaluate.
In the scalar chapter we saw that adding a constant to both rewards leaves the Bradley-Terry probability unchanged. Here the constant is \(\beta\log Z(x)\), different for each prompt but shared by the two responses in a pair. The shift invariance that made scalar rewards "relative, not absolute" is exactly what makes DPO possible.
7. The DPO loss
Replace the unknown \(\pi^*\) in Equation (5) by the trainable \(\pi_\theta\) and take the negative log-likelihood of the observed preferences. Writing \(\hat r_w=\hat r_\theta(x,y_w)\) and \(\hat r_l=\hat r_\theta(x,y_l)\):
This is the Bradley-Terry loss of the scalar chapter, with the reward network replaced by the implicit reward. Fitting a reward model and fitting the policy have become the same act.
With the numbers from Section 2, \(\hat r_w=0.2\) and \(\hat r_l=0.05\): the margin is \(0.15\), \(\sigma(0.15)\approx0.537\), and the loss is about \(0.621\), only a little below the starting value \(\log 2\approx0.693\).
8. The gradient and its weight
Use \(\frac{d}{dz}\big[-\log\sigma(z)\big]=-\sigma(-z)\), and note that \(\pi_{\text{ref}}\) is frozen, so \(\nabla_\theta\hat r=\beta\nabla_\theta\log\pi_\theta\):
The bracket is the direction: make the winner more likely and the loser less likely. The weight sets the step size. It is the probability the implicit reward model currently assigns to the wrong ordering.
| Margin \(\hat r_w-\hat r_l\) | Weight \(\sigma(\hat r_l-\hat r_w)\) | Loss | Reading |
|---|---|---|---|
| \(-2\) | 0.881 | 2.127 | Wrong and confident: large update |
| \(0\) | 0.500 | 0.693 | Undecided |
| \(0.15\) | 0.463 | 0.621 | Barely right |
| \(3\) | 0.047 | 0.049 | Already right: almost ignored |
Without the weight, every pair would push equally hard, and pairs that are already separated would keep being pushed apart. The weight concentrates learning on the pairs the model still gets wrong.
9. Using a DPO policy as a reward model
Once trained, \(\pi_\theta\) and \(\pi_{\text{ref}}\) together form a reward model. To pick the best of \(n\) candidate responses, score each by its implicit reward:
Scoring costs two forward passes per response, one through each model, and no generation. Benchmarks of reward models such as RewardBench evaluate DPO-trained models in exactly this way, next to explicit classifiers.
Two cautions carry over from Section 6. The score is defined only up to the per-prompt constant \(\beta\log Z(x)\), so comparing implicit rewards across different prompts is not meaningful. And the score is a sum over tokens, so responses of very different lengths can differ in score partly because of length.
10. Token-level rewards and implicit PRMs
A language model factorises over tokens, so the log-ratio does too. For a response \(y=(y_1,\ldots,y_T)\):
Each term is a per-token credit: how much training raised or lowered the probability of that token in its context. Summing up to position \(t\) gives a running total for the prefix,
where \(t_k\) is the last token of reasoning step \(k\) and \(\rho_k\) is the reward of that step. This is an implicit PRM: step-level rewards with no step-level labels. The model is trained only on whole-response signals, either preference pairs with Equation (6) or outcome labels \(o\in\{0,1\}\) with a cross-entropy loss on the implicit reward:
The step reward \(\rho_k=q_{t_k}-q_{t_{k-1}}\) has the same shape as the progress reward \(V(z_t)-V(z_{t-1})\) of the value model chapter, and it telescopes in the same way: the step rewards add up to the whole-response reward \(q_T\). The value model needed rollouts to get its targets; the implicit PRM gets its per-step signal from the parameterisation alone.
11. Weaknesses
- Needs the reference model. Every score needs \(\pi_{\text{ref}}\) as well as \(\pi_\theta\): two models in memory, or cached reference log-probabilities for fixed data.
- Offline data only. The pairs were usually sampled from another model. The policy never sees its own outputs judged, unlike PPO. Iterative or online DPO samples fresh pairs from the current policy and labels them with a judge to close this gap.
- Poor calibration off-distribution. The implicit reward is shaped only on the training pairs. On responses unlike them, the log-ratio reflects whatever incidental drift fine-tuning caused, and can rank such responses badly.
- Overfitting to confident labels. If a pair is always preferred, the Bradley-Terry optimum wants an infinite margin. The loss keeps pushing the log-ratios apart, and the KL leash of Equation (1) is never enforced directly.
- Both likelihoods can fall. The loss depends only on the margin, so it can be lowered by making both responses less likely, as long as the loser falls faster (see the note below).
Start with both log-ratios at 0, so the loss is \(\log2\approx0.693\). After some training, the winner's log-ratio is \(-1\) and the loser's is \(-3\). With \(\beta=0.1\), \(\hat r_w=-0.1\), \(\hat r_l=-0.3\), the margin is \(0.2\), and the loss is \(-\log\sigma(0.2)\approx0.598\). The loss went down, yet the preferred response is now \(e^{-1}\approx0.37\) times as likely as under the reference. The probability mass went to responses that appear in neither column of the data.
12. Laboratory: implicit rewards and the DPO weight
Set the log-ratios \(\log(\pi_\theta/\pi_{\text{ref}})\) of the winner and the loser, and the scale \(\beta\). The lab computes the implicit rewards, the margin, the Bradley-Terry probability, the DPO loss, and the gradient weight \(\sigma(\hat r_l-\hat r_w)\).
DPO on one pair
\(\mathcal L=-\log\sigma(\hat r_w-\hat r_l)\)Computation
Start from "Section 2" and slide the loser's log-ratio above the winner's: the weight climbs toward 1. Then try "Both fall": the loss is below \(\log 2\) even though the winner is less likely than under the reference. Changing \(\beta\) rescales every reward and so changes how quickly the weight saturates.
13. Worked example, step by step
For one prompt, the policy and the reference give these sequence log-probabilities: \(\log\pi_\theta(y_w)=-42.0\), \(\log\pi_{\text{ref}}(y_w)=-45.0\), \(\log\pi_\theta(y_l)=-40.0\), \(\log\pi_{\text{ref}}(y_l)=-38.0\). Take \(\beta=0.1\). Compute the implicit rewards, the loss and the gradient weight.
- Log-ratios: winner \(-42.0-(-45.0)=+3.0\); loser \(-40.0-(-38.0)=-2.0\).
- Implicit rewards: \(\hat r_w=0.1\times3.0=0.30\), \(\hat r_l=0.1\times(-2.0)=-0.20\).
- Margin: \(0.30-(-0.20)=0.50\). Probability: \(\sigma(0.5)\approx0.622\).
- Loss: \(-\log 0.622\approx0.474\).
- Gradient weight: \(\sigma(-0.5)\approx0.378\). The update is \(\beta\times0.378\approx0.038\) times \(\nabla\log\pi_\theta(y_w)-\nabla\log\pi_\theta(y_l)\).
- Note: the policy gives the loser the higher raw likelihood (\(-40\) vs \(-42\)), yet the loser has the lower reward. The implicit reward measures the change from the reference, not the likelihood itself.
14. What comes next
So far every reward model, explicit or implicit, has scored responses for an average user. The next chapter conditions the reward on who is asking, or on a stated preference, so that the same response can earn different rewards in different contexts.
The optimal KL-regularised policy determines its reward up to a per-prompt constant. Bradley-Terry only sees reward differences within a prompt, so the constant cancels, and training the policy on preferences is training a reward model.
See also
- Rafailov et al., 2023, Direct Preference Optimization: your language model is secretly a reward model.
- Rafailov et al., 2024, from \(r\) to \(Q^*\): your language model is secretly a Q-function (token-level view of DPO).
- Azar et al., 2023, a general theoretical paradigm to understand learning from human preferences (IPO, overfitting with deterministic preferences).
- Lambert et al., 2024, RewardBench: evaluating reward models, including DPO models scored by implicit reward.
- Yuan et al., 2024, free process rewards without process labels (implicit PRM).
- Cui et al., 2025, process reinforcement through implicit rewards (PRIME).
- The scalar chapter for Bradley-Terry, and the RL notes on PPO.
Previous
← Critique-then-Score
Next chapter
Conditional reward model
One reward model, different preferences for different users.