Reward Model and KL Objective

The reward model converts pairwise judgments into a scalar scoring function rθ(x,y)r_\theta(x,y). Given a prompt and two responses, it should assign the chosen response a higher score than the rejected one.

The common Bradley-Terry form turns a reward difference into a probability:

P(A≻B∣x)=σ(β(rθ(x,A)−rθ(x,B)))P(A\succ B\mid x)=\sigma\left(\beta(r_\theta(x,A)-r_\theta(x,B))\right)

This gives us a scalar reward model. The margin rθ(x,A)−rθ(x,B)r_\theta(x,A)-r_\theta(x,B) matters more than the absolute score, and β\beta controls how sharply the model separates winners from losers.

Reward model math

Tune the Bradley-Terry scoreboard

Move the reward scores and temperature. The preference probability depends on the difference, not the absolute score level.

1.20
0.10
1.40
P(A≻B∣x)=σ(1.4(1.2−0.1))=0.82P(A \succ B \mid x)=\sigma(1.4(1.2-0.1))=0.82

Delta r

1.10

P(A wins)

82%

loss if A chosen

0.19

Adding the same constant to both rewards changes neither the margin nor the predicted preference.

Once r^θ\hat r_\theta exists, policy optimization tries to maximize predicted human reward. But in RLHF we also want the model to stay near behavior we already trust. That gives the KL-regularized objective:

J(ϕ)=Ex,y∼πϕ[r^θ(x,y)−λDKL(πϕ(⋅∣x) ∥ πref(⋅∣x))]J(\phi)=\mathbb{E}_{x,y\sim\pi_\phi}\left[\hat r_\theta(x,y)-\lambda D_{KL}\left(\pi_\phi(\cdot\mid x)\,\Vert\,\pi_{ref}(\cdot\mid x)\right)\right]

The reward term pulls toward human-preferred behavior. The KL term limits drift from the reference policy. The coefficient λ\lambda controls the strength of the leash.

KL-regularized objective

What RLHF wants to optimize

The policy should increase learned reward without drifting too far from a trusted reference model.

=[-(||)]

KL divergence

Measures how far the current policy's output distribution moves from the reference policy for the same prompt.

Target distance

Kappa sets the desired KL distance.

DKL(πφ || πref) ≈ κ

Adaptive KL control targets a desired distance: if KL rises above kappa, raise lambda; if KL falls below kappa, lower lambda.

Adaptive λ\lambda

Most RLHF systems monitor a target KL distance κ\kappa. If observed KL rises above κ\kappa, raise λ\lambda so the reference pulls harder. If observed KL stays far below κ\kappa, lower λ\lambda so the policy can learn more from reward.

In short: r^θ\hat r_\theta pulls toward better answers, while KL keeps the new policy from drifting too far too fast.

ℹ

Shift Invariance

If the same constant is added to both reward scores, the margin stays the same. Pairwise reward modeling learns relative preference, not an absolute moral meter.

⚠

Confidence Needs Calibration

A reward model that predicts 99%99\% preference on ambiguous near ties is overconfident. Calibration checks whether predicted probabilities match observed rater frequencies, which matters when uncertainty should trigger more labels or human review.

Checkpoint

In P(A≻B)=σ(β(rA−rB))P(A\succ B)=\sigma(\beta(r_A-r_B)), what directly controls whether A is predicted to win?