Section 15

Value & advantage

The critic, and 'better than expected' as a signal

The baseline from the last chapter graded every response against one number: the batch’s typical reward. But “typical” depends on where you’re standing. A model asked what is two plus two almost always scores high; asked to prove a theorem, it might struggle.

Judging both against the same average punishes every honest attempt at the hard prompts and celebrates every lazy answer to the easy ones.

So a far better baseline is state-dependent: the reward we expect from this particular starting point. This chapter builds that idea into the three quantities at the heart of modern policy optimization (value, Q, and advantage), and they are all, at bottom, one intuition: surprise.

The value function: what do I usually earn from this state?

The expected reward from a given starting point has a name, the value functionvalue functionThe expected return from a given state under the current policy. A learned value function (the critic) provides a baseline that reduces the variance of policy-gradient updates.See in glossary →:

V(s)=Eyπθ[rstate s]V(s) = \mathbb{E}_{y \sim \pi_\theta}\big[\, r \mid \text{state } s \,\big]

Read aloud: VV of a state ss (this prompt, these tokens so far) is the reward the current policy expects to earn from here on out, averaged over everything it might do next. A strong prompt where the model usually does well has a high VV; a hard one where it might struggle has a low VV.

We don’t know VV, so we learn it with a criticcriticA model trained to predict the value function. PPO uses an actor (the policy) and a critic; GRPO drops the critic and uses a group average instead.See in glossary →. The critic can be a separate model, or a value head sharing some parameters with the policy, trained by regression to predict returns: plain supervised learning riding alongside the RL. The policy (the “actor”actorThe model itself, in its acting role: during a rollout it proposes next-token predictions and we sample from them to build the response. It's called the actor to contrast with the critic, which judges the actions instead of taking them.See in glossary →) proposes; the critic estimates expected return. This actor–critic pattern is common in PPOPPOProximal Policy Optimization (Schulman, 2017) — nudges the policy toward higher reward in small, clipped steps with a KL leash to a reference model. The RLHF workhorse: stable, simple, widely used.See in glossary →, though implementations differ.

Advantage: the surprise score

Now grade a specific action against that expectation. Let Q(s,a)Q(s,a) be the expected reward of taking action aa in state ss and then continuing as usual. The advantageadvantageHow much better an action was than the baseline expectation: A = reward − value. Positive advantage pushes an action’s probability up, negative pushes it down.See in glossary → is the gap:

A(s,a)=Q(s,a)V(s)A(s, a) = Q(s, a) - V(s)

In words: how much better is this specific action than what I typically manage from this state? A positive advantage is a pleasant surprise: do more of that. A negative advantage is a disappointment: do less. Zero means “exactly as expected,” and expected behavior needs no correction.

Play with what that means in practice:

Advantage explorer
Pick a prompt, then a response. The advantage A = Q − V scores the response against what this prompt usually earns, not against zero.
“What is 2 + 2?” — the policy almost always nails this
expected V(s)
8
Sampled response — click one
Surprise meter
Pick a response above.
Try the Q = 6 response on the Easy prompt and then on the Hard prompt. Same score, opposite lessons: 6 − 8 = −2 (worse than this prompt deserves) versus 6 − 2 = +4 (a genuine win). That is everything the advantage adds over the raw reward: it grades on a curve set by the state.

The point to carry away from the widget: the same score is good news on a hard prompt and bad news on an easy one. Advantage grades on a curve set by the state, which is exactly the adaptive baseline we were missing.

The modern policy gradient

Swap the advantage in for the raw reward and you get the update used, in one form or another, by essentially every RL method later in this explainer:

θJ=E[A(s,a)θlogπθ(as)]\nabla_\theta J = \mathbb{E}\big[\, A(s, a) \, \nabla_\theta \log \pi_\theta(a \mid s) \,\big]

This is the exact same shape as the policy gradient from chapter 13 (average, over sampled actions, of each action’s “make-it-more-likely” direction) with one swap: the scalar weight is now the advantage A(s,a)A(s,a) instead of the raw reward. That single change is the whole point. An action that beat the state’s average (A>0A > 0) gets pushed up; one that fell short (A<0A < 0) gets pushed down; and an action that was merely typical (A0A \approx 0) is left almost untouched instead of being yanked around by the reward’s size.

For a terminal reward with a learned baseline, this is just Ar(y)V(s)A \approx r(y) - V(s): reward minus the critic’s prediction. The advantage is the cleaned-up, centered learning signal: the variance-inflating level of the reward subtracted away, leaving only the informative part.

One problem left

We’ve defined the learning signal we want, but defining it isn’t computing it. In practice the advantage must be estimated from a handful of noisy rollouts and an imperfect critic, and how you blend those two flawed sources is a genuine dial with “trust what happened” at one end and “trust the critic” at the other. That dial is Generalized Advantage Estimation, the next chapter.