Advantage Function

Definition

The advantage function answers the single most important question in policy-gradient RL: was action better or worse than the policy’s average behavior in state ? It is the action-value minus the state-value, a re-centered signal whose sign says “do more / do less” and whose expectation under is zero. It is the ideal weight in the policy gradient and the target that GAE estimates.

Key math

Centered by construction — subtracting (a state-only baseline) recenters :

This zero-mean property is exactly why using as a baseline is unbiased (it contributes ) while cutting variance. In the PG theorem the advantage is the lowest-variance choice of weight:

Estimated in practice via the TD error () or its -weighted sum. Advantages are usually normalized (zero mean, unit variance) per batch before the actor update.

Why it matters

For LLMs the reward is a single sequence-level scalar (a reward-model or verifier score), so the entire credit-assignment problem is: how do we distribute that one number across all the token-actions that produced it? The advantage is the answer — per-token tell the model which tokens to uplift or suppress. In RLHF-PPO it is computed by GAE over token-level rewards; in GRPO it is estimated group-relatively, , with no critic at all.

Taught in

See also