Evaluation lab · San Francisco · London · Zürich
Reinforced Labs Request a briefing
Glossary

Advantage function

Also called: advantage, A(s,a), A^π

The advantage function A(s,a) = Q(s,a) − V(s) measures how much better an action is than the policy's average action in that state.

The advantage function measures how much better taking action in state is than what the policy would do on average from . Positive advantage means the action beats the policy's typical behaviour; negative means it falls short.

Definition

where is the expected return after taking in and then following policy (the Q-function), and is the state value. A direct consequence is that the advantage averages to zero under the policy: .

Worked example

In some state a policy picks three actions with probabilities 0.5, 0.3 and 0.2, and their Q-values are 3, 5 and 10. The state value is . The advantages are , and . Their policy-weighted mean is , as it must be. A policy gradient step using these advantages makes the third action more likely, the first less likely, and leaves the second roughly where it is, even though all three have positive Q-values.

How it is estimated

The true advantage is unknown, so algorithms estimate it:

  • Monte Carlo: , unbiased if the value estimate is only used as a baseline, but high variance.
  • One-step TD: , the TD error, which is low variance but biased when is wrong.
  • GAE: an exponentially weighted mix of the two, controlled by .
  • Group-relative: for language models, the reward of one sample minus the mean reward of other samples for the same prompt, often divided by their standard deviation.

Advantage versus baseline

A baseline is a tool, a number you subtract; the advantage is the quantity you are trying to estimate when you subtract the best state-dependent baseline, the value function. Using as the baseline is close to, but not exactly, the variance-minimising choice.

Why it matters

Advantages are the signal that modern policy gradient methods, including actor-critic, PPO and GRPO, actually multiply into their updates. Most of the practical differences between these algorithms come down to how they estimate the advantage and how much bias they accept for lower variance.

Sources

  1. John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, Pieter Abbeel. High-Dimensional Continuous Control Using Generalized Advantage Estimation, 2015. arxiv.org
  2. Richard S. Sutton, Andrew G. Barto. Reinforcement Learning: An Introduction (2nd edition), 2018. incompleteideas.net

Know the number before you ship.

A 45-minute working session with an evaluation engineer. Bring one use case; leave with a threat model, a draft eval plan with sample sizes, and an honest read on where you stand.