TL;DR
The advantage of an action is how much better it is than the policy's usual choice in the same state. Formally, it is the action value minus the state value: . A positive advantage means the action beats the average, and a negative one means it falls short. Because the average is subtracted out, the advantage tells a learner which actions to reinforce without the large, shared offset that makes raw returns noisy.
Where you'll see it: as the learning signal in policy-gradient and actor-critic methods, inside PPO, and in the dueling network architecture that splits a Q-value into a state part and an advantage part.
Intuition
Grading against the usual move
A chess player judges a candidate move by comparing it with what they would normally play in that position. A move that is slightly weaker than the best line is a small slip; a move that drops the queen is a large one. The overall quality of the position is shared by every move the player might choose, so it says little about which move to pick. What matters is how far each move sits from the baseline.
The value function supplies the baseline. In state , is the expected return when the policy keeps playing, so it is the average over the actions the policy would take. is the expected return when the agent takes first. The gap between them is the advantage. An action with above is better than usual here, and an action with below is worse.
Why bother with the gap? Imagine a game where every state comes with a large, positive background reward. Raw returns are big whatever you do, and a learner that reinforces each action in proportion to its raw return pushes up every action in that state. The signal that separates good choices from bad ones is buried under the common offset. Subtracting the state value removes the offset, so the update only responds to how much each action differs from the average.
flowchart TD S["state s"] --> P["policy picks an action a"] S --> V["V(s): average over the policy's actions"] P --> Q["Q(s, a): return if a is taken first"] Q --> A["A(s, a) = Q - V: gap from the average"] V --> A
The math
Definition
For a policy , the advantage of action in state is
where and are the action-value and state-value functions from the value function lesson.
The average advantage is zero
Average the advantage over the policy's own choices in a state. Using the identity from the value-function lesson:
The second term uses the fact that the policy's probabilities sum to one. So the advantages of a state, weighted by how often the policy picks each action, always cancel. Some actions have positive advantage and some negative, and they balance.
Advantage as a one-step surprise
The Bellman expectation equation gives as one reward plus the discounted value of the next state:
Subtracting gives the advantage as the expected one-step surprise:
The quantity inside the expectation is the TD error,
Given one observed transition, is a single-sample estimate of . It is the quantity that temporal-difference learning computes at every step. When is exact, the TD error is an unbiased estimate of the advantage. When is only approximate, it carries that approximation's error.
Policy gradient with a baseline
The policy gradient for a stochastic policy is
Now subtract any function that does not depend on the action. The expectation does not change, because for each state
The steps are:
- Use to turn the weighted sum into a plain sum of gradients.
- Pull out , which does not depend on .
- The probabilities sum to one, so their gradient is zero.
Choose . The gradient becomes
The expected gradient is the same, but the samples are usually much less noisy, because the advantage is near zero for actions that are close to average.
Estimating it in practice
The true is unknown, so the advantage has to be estimated from data. There are three common routes.
- Monte Carlo: , using the full sampled return. It is unbiased when is any fixed function, but its variance grows with the episode length.
- One-step TD: . It has low variance, but it is biased whenever is wrong, and the error in feeds straight into the estimate.
- Generalized advantage estimation (GAE): an exponentially weighted sum of TD errors,
With this is the one-step TD estimate. With it telescopes into the Monte Carlo estimate . Values between them trade bias for variance, and GAE is the standard choice for policy-gradient training.
Worked examples
A state has two actions. The policy picks left with probability and right with probability . The action values are and .
- State value: .
- Advantage of left: .
- Advantage of right: .
- Check the zero average: .
Interpretation: left is a little better than the policy's usual choice, so it deserves a small push upward. Right is clearly worse. The policy takes right only a quarter of the time, but when it does, the advantage is three times larger in magnitude, so the update still carries a strong correction.
Take , , and suppose the agent took its action, received reward , and landed in a state with .
- Bootstrapped target: .
- TD error: .
- Interpretation: the step went better than the value function expected, so this sample says the action's advantage is about .
Change one number. If the reward is and the next state has , then the target is and . The same action now looks worse than expected.
A trajectory has rewards , , , and the episode ends after step 3. Values are , , , and at the terminal state. Use and .
- TD errors: , , and .
- Work backwards with . The last advantage is .
- .
- .
- Compare with the extremes at . One-step TD gives . Monte Carlo gives . The GAE value sits between them, as should.
Interpretation: the first step looks clearly better than the value function predicted, and the estimate uses the later steps as well, but discounts them.
Tradeoffs and failure modes
Advantages are the right signal whenever you train a policy and have a value estimate. They are not free, though. The table below sorts the common situations.
| Situation | What goes wrong | Better choice |
|---|---|---|
| Raw returns as the learning signal | Large common offset per state, high variance | Subtract a baseline, usually |
| Long episodes with sparse reward | Monte Carlo advantage has huge variance | GAE with below 1 |
| Poor value estimate | One-step TD inherits the bias | Larger or more steps before bootstrapping |
| Small discrete action set you can enumerate | Policy gradient is more machinery than you need | Learn directly, as in [[q-learning |
| Action the policy almost never takes | Its advantage estimate rests on very few samples | Accept the noise, or explore more |
Two failure modes come up often in practice. First, advantages are usually normalised across a batch (zero mean, unit variance) before the update. That keeps step sizes stable, but it throws away information about how big the advantages are in one state compared with another. Second, an advantage is defined relative to the current policy. As the policy changes, the advantages it implies change too, which is part of why PPO limits how far one update may move the policy.
History
Advantage-style learning predates deep reinforcement learning. In the early 1990s, Leemon Baird proposed advantage updating, which stores the advantage of each action directly so that learning stays stable when the time step is short. The idea was not widely used at the time, while most work centred on value tables and Q-learning.
It came back in two strands in the mid-2010s. John Schulman and colleagues introduced generalized advantage estimation in 2015, showing that the exponentially weighted sum of TD errors gave a strong trade-off between bias and variance for policy gradients. Ziyu Wang and colleagues introduced the dueling network in 2016, which writes as a state value plus an advantage and learns both parts. Both ideas spread quickly, and the advantage became the default signal in actor-critic methods such as A2C and PPO.
Check yourself
QuestionWhat is the advantage of action in state under policy , in words and in a formula?Show answer
It is how much better taking first is than the policy's average behaviour from : . Positive means better than usual, negative means worse.
QuestionA state has . The agent takes an action, receives reward , and lands in a state with . With , what is the one-step TD error?Show answer
The bootstrapped target is . The TD error is . This single sample says the action was worse than the value function expected.
QuestionWhy does subtracting from the policy gradient leave its expected value unchanged?Show answer
Because for each state, . The baseline term is a constant in and it multiplies a gradient that sums to zero over the actions, so it vanishes in expectation. It can still change the variance of the samples, which is the reason to use it.
QuestionA game has a state where every action leads to the same reward and the same next state. What is the advantage of each action there, and what does that imply for learning?Show answer
Every action has the same , which equals because the policy's average over identical values is that value. So each advantage is zero. The state gives no learning signal about which action is better, and training effort is better spent on states where the actions actually differ.
QuestionIn a game where the value function is only roughly right, why might a one-step TD advantage estimate be worse than a multi-step GAE estimate, even though it has lower variance?Show answer
The one-step estimate uses , so any error in enters the estimate directly, and it cannot correct that error. GAE with above zero adds several later rewards before it relies on , so the bootstrapped part matters less. The cost is more variance, so sets a trade-off, not a free improvement.