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

Generalized advantage estimation (GAE)

Also called: GAE, GAE(λ), lambda-return advantage

Generalized advantage estimation computes advantages as an exponentially weighted sum of TD errors, trading bias for variance with a single parameter λ.

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.

Sources

  1. John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, Pieter Abbeel. High-Dimensional Continuous Control Using Generalized Advantage Estimation, 2015. arxiv.org

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.