Generalized advantage estimation (GAE) is a way to estimate the advantage function for policy gradient updates. It averages many n-step advantage estimates with exponentially decaying weights, so a single parameter slides between a low-variance, biased estimate and a high-variance, unbiased one.
Definition
With a learned value function , first compute the TD error at each step, . GAE then sums them:
where is the discount factor and controls how quickly distant TD errors are down-weighted. In code this is computed backwards over a trajectory with the recursion , resetting at episode ends.
The two extremes
- : , the one-step TD advantage. Low variance, but biased whenever is wrong.
- : , the Monte Carlo return minus a baseline. Unbiased with respect to value errors, but high variance.
Values around 0.9 to 0.97 are common. This mirrors TD() for value learning, applied to advantages.
Worked example
A trajectory has TD errors , , and then ends. With and , and
With the estimate would be just , ignoring the later evidence that things kept going somewhat better than the critic predicted.
In practice
GAE is the default advantage estimator inside PPO and many actor-critic implementations. Advantages are usually normalised per batch to zero mean and unit variance, and the value function is trained on the -return targets . Note that and play different roles: is part of the objective, while only changes how the gradient is estimated.
Why it matters
The quality of advantage estimates often matters more than the choice of policy optimiser. GAE gives a principled dial for the bias-variance trade-off and is the reason PPO-style training works reliably on long-horizon tasks. In RL for language models with a single reward at the end, a value head plus GAE is the standard PPO recipe, and its cost is what group-based methods such as GRPO try to avoid.
Related terms
- Advantage function
- TD error
- Actor-critic
- PPO (Proximal Policy Optimization)
- Discount factor
- Temporal-difference learning
Sources
- John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, Pieter Abbeel. High-Dimensional Continuous Control Using Generalized Advantage Estimation, 2015. arxiv.org