# High-Dimensional Continuous Control Using Generalized Advantage Estimation

Generalized advantage estimation lowers variance in continuous control policy gradients

John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, Pieter Abbeel · arXiv · 2015-6-8

- **Problem** Policy gradient estimates from sampled returns have high variance, so they need many samples. Value-function baselines cut that variance but add bias.
- **Method** Generalized advantage estimation (GAE) takes an exponentially weighted sum of TD residuals from a learned value function, with γ and λ setting the bias.
- **Results** The estimator learned running gaits for bipedal and quadrupedal simulated robots, with neural policies mapping raw kinematics to joint torques.

## Why policy gradients need lower variance

Policy gradient methods raise expected reward by climbing a sampled estimate of its gradient. The estimate built from full returns is noisy, and its variance grows with the time horizon, because the effect of one action gets mixed up with the effects of all the actions before and after it. Actor-critic methods replace the empirical return with a learned value function.

This lowers the variance of the estimate but adds bias.

The design that follows therefore accepts a controlled amount of bias in exchange for a large drop in variance.

## The undiscounted setting and the advantage target

The problem is posed without a discount: the initial state is drawn from a distribution, trajectories follow the policy and the dynamics until a terminal state, and the goal is the expected total reward, which is assumed finite for all policies. A discounted objective can be written as an undiscounted one by folding the discount into a time-dependent reward, so the discount is free to serve as a tuning parameter rather than part of the objective.

The policy gradient can be written as a sum of score-function terms, each weighted by a quantity Ψt. Several choices of Ψt are possible, including total reward, reward-to-go, a baselined reward-to-go, state-action values, the advantage function and the one-step TD residual. The advantage function Aπ(st,at) = Qπ(st,at) − Vπ(st) measures whether an action is better or worse than the policy's default behavior.

Weighting each score term by it means the update raises the probability of an action only when its advantage is positive. The advantage is rarely known in practice, so it has to be estimated, and the choice of estimator is where the bias-variance tradeoff enters.

A parameter γ downweights rewards from delayed effects. It is used here as a variance-reduction knob inside an undiscounted problem, not as a change of objective. The discounted advantage Aπ,γ is defined from discounted value and action-value functions. The discounted policy gradient gγ is the expectation of the sum of Aπ,γ times the score function, and the paper's estimators aim to produce noisy but usable estimates of this quantity.

An advantage estimate is called γ-just when, substituted for Aπ,γ in the gradient, it gives the same expectation as the discounted gradient. The condition is stated as an equality of expectations over trajectories. A sufficient condition is that the estimate splits into a term Qt that is an unbiased estimate of the discounted Q-function and a term bt that depends only on the history before at.

The bt term then drops out in expectation, which is the content of the proposition in the paper.

## Building the estimator from TD residuals

Given an approximate value function V, the TD residual is defined as δVt = rt + γV(st+1) − V(st). It is a one-step estimate of the advantage of at, and it is γ-just only when V equals the discounted value function Vπ,γ. With the correct value function the residual is an unbiased estimate of Aπ,γ, and with an inaccurate value function the policy gradient built from it is biased.

Summing k consecutive residuals telescopes into a k-step return minus the baseline V(st). Taking k to infinity gives the empirical discounted return minus V(st). Smaller k relies more on the value function, which introduces bias, while larger k leans on sampled rewards, which raises variance. The authors note that the bias generally shrinks as k grows, because the bootstrapped term γkV(st+k) is discounted more heavily.

The generalized advantage estimator takes an exponentially weighted average of these k-step estimators with weight λ. Collecting terms gives a discounted sum of residuals with factor γλ per step: the sum of (γλ) raised to l times δV at t plus l, for l from 0 to infinity. The construction is closely analogous to TD(λ), except that TD(λ) estimates the value function while this estimator targets the advantage function.

Setting λ = 0 gives the one-step residual, which is the lowest-variance choice and the most biased one. Setting λ = 1 gives the sum of discounted rewards minus V(st), which is γ-just for any V but has high variance. Between these ends, λ trades bias against variance when the value function is inaccurate. The γ parameter also changes the value function's scale and introduces bias regardless of V's accuracy, while λ introduces bias only when V is inaccurate.

The authors find the best λ is much lower than the best γ.

Plugging the estimator into the policy gradient gives a biased estimate of gγ in which each score term is multiplied by the sum over l of (γλ) raised to l times δV at t plus l. The equality holds exactly when λ = 1.

## Reading the estimator as reward shaping

Reward shaping replaces the reward with r + γΦ(s') − Φ(s) for an arbitrary state function Φ. The advantage Aπ,γ of any policy is left unchanged by this transformation. Ng et al. showed that shaping leaves the policy gradient and optimal policy unchanged for the discounted reward sum. This paper uses the same transformation for a different goal: the undiscounted sum of rewards, with γ acting as a variance parameter.

When Φ is set to the approximate value function V, the shaped reward becomes the Bellman residual, which is the TD residual from the previous section. The γλ-discounted sum of these shaped rewards is then exactly the generalized advantage estimator. The response function χ(l; st, at) measures the expected reward l steps later given at, minus the expected reward given only st.

The advantage is the sum over l of γ to the l times χ, so the response function splits the advantage across time.

Long-range dependence between actions and rewards appears as nonzero response at large l, and discounting by γ ignores the terms beyond roughly 1 over (1 − γ) steps. The error of this approximation is small when the response decays quickly.

## Fitting the value function under a trust region

The simplest way to fit a nonlinear value function is nonlinear regression onto discounted sums of rewards from each timestep in a batch. This is the Monte Carlo, or TD(1), target. The authors use a trust region when fitting, so that the new value function does not move far from the one used to collect the batch.

The trust region is set from σ2, the mean squared error of the old value function on the batch. The constraint bounds the mean squared change in predictions, scaled by σ2, by a threshold ε. The authors note that this constraint is equivalent to bounding the average KL divergence between the old and new value functions, when each treats the value output as the mean of a Gaussian with variance σ2.

The constrained problem is solved approximately as a quadratic program in which the Hessian approximation H is the average outer product of value-function gradients. H is the Gauss-Newton approximation, and up to a factor of σ2 it is the Fisher information matrix. Conjugate gradient needs only matrix-vector products with H to compute the step direction.

The step is then rescaled so that the quadratic form on the step equals ε, which is the same procedure used for the policy.

## Policy update and the training loop

The policy is updated with trust region policy optimization. Each iteration maximizes a surrogate objective built from the probability ratio and the advantage estimates, subject to an average KL divergence constraint between the old and new policies. The approximate solution linearizes the objective and quadraticizes the constraint, which gives a step proportional to the inverse Fisher matrix times the policy gradient.

This step direction matches the natural policy gradient, but the step size and the numerical procedure are different.

The experiments keep this TRPO update fixed and vary only the γ and λ parameters of the estimator, so that effects can be attributed to the estimator. Each iteration simulates the current policy until N timesteps are collected, computes the TD residuals with the current value function, forms the advantage estimates from their discounted sums, performs the TRPO policy update, and then fits the value function.

The policy update uses the value function from before the value update, not the one afterwards. The authors argue that updating the value function first would add bias, and in the extreme case of an overfit value function the residuals become zero and the gradient vanishes.

## Tasks, networks and simulation settings

The experiments cover cart-pole balancing and three 3D robot tasks: biped locomotion, quadruped locomotion and getting the biped up from lying on its back.

The reward for biped locomotion is forward velocity minus small penalties on joint torques and impact forces, plus a constant 0.2. The quadruped reward has the same structure with different weights and a constant 0.05, and the standing task penalizes the squared deviation of head height from 1.5 along with a torque penalty. Results are reported as cost, the negative reward, which is minimized.

The No VF condition uses a time-dependent baseline averaged over the batch rather than a state value function.

## Cart-pole sweep over γ and λ

Results are averaged over 21 experiments with different random seeds. The best results come at intermediate values, with γ in \[0.96, 0.99\] and λ in \[0.92, 0.99\]. The learning curves at γ = 0.99 show the fastest policy improvement for λ in \[0.92, 0.98\], compared with λ = 1.0, λ = 0 and the No VF baseline. The authors also report performance after 20 iterations across the γ and λ grid, and state that the best results lie at intermediate values of both.

## Biped, quadruped and standing results

After 1000 iterations the learned gait is fast, smooth and stable. Converting the batch and timestep settings gives about 5.8 days of real time for this run, which the authors take as evidence that a real robot could plausibly run the same learning procedure.

The quadruped and standing comparisons use 5 trials per condition, with γ fixed at 0.995 for locomotion and varying λ over 0 and 0.96, plus a condition with no value function. For quadruped locomotion the best results come from a value function with λ = 0.96. For 3D standing, the value function always helped, and λ = 0.96 and λ = 1 gave roughly the same results.

## Compatible features and Q-function critics

Compatible features are the policy score functions, and they span the subspace of advantage functions on which the policy gradient depends. That theory says nothing about exploiting temporal structure to estimate the advantage better, so it is largely separate from this paper's approach. Projecting an empirical advantage onto the compatible features by least squares gives the natural policy gradient, and any advantage estimator, including the ones derived here, can be substituted into that projection.

The estimator here interpolates smoothly between a high-bias choice at λ = 0 and a low-bias choice at λ = 1, while a parameterized Q-function fixes the estimator to a high-bias form. The authors found the bias of the one-step estimate prohibitively large and expect a Q-based advantage to face similar difficulty.

## Limitations and open questions

The one-step estimate with λ = 0 is reported to have excessive bias and poor performance in the authors' experiments, although related methods that differentiate with respect to a continuous action can work when tuned.

Choosing γ and λ adaptively or automatically is left as future work, and so is the relation between value function estimation error and policy gradient estimation error. The main experimental validation is restricted to simulated robotic locomotion, and the authors describe an intermediate λ in \[0.9, 0.99\] as usually best within that domain.

For 3D standing up the text gives γ = 0.995, while the Figure 4 legend lists γ = 0.99 for the same task, so the γ used for that comparison is not settled by the paper.

## Paper info

- **Authors**: John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, Pieter Abbeel
- **Venue**: arXiv · Preprint
- **First published**: 2015-6-8
- **Added**: 2026-11-6
- **Updated**: 2018-10-20
- **Version**: v6
- **arXiv**: 1506.02438
- **Category**: cs.LG · cs.RO · eess.SY
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1506.02438v6) · [PDF ↗](https://arxiv.org/pdf/1506.02438v6)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, Pieter Abbeel (2015). High-Dimensional Continuous Control Using Generalized Advantage Estimation. arXiv:1506.02438v6. https://arxiv.org/abs/1506.02438v6

**BibTeX**

```
@misc{schulman2015high,
  title = {{High-Dimensional Continuous Control Using Generalized Advantage Estimation}},
  author = {John Schulman and Philipp Moritz and Sergey Levine and Michael Jordan and Pieter Abbeel},
  year = {2015},
  eprint = {1506.02438},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1506.02438v6}
}
```

## Other paper commentary

- [Hindsight Experience Replay](https://refivu.com/en/papers/582040c2-0070-4d83-904a-97d112d29239-hindsight-experience-replay.md)
- [QT-Opt: Scalable Deep Reinforcement Learning for Vision-Based Robotic Manipulation](https://refivu.com/en/papers/7cb7d7d4-7a03-4f1d-bbc0-2ddaf1103d5a-qt-opt-scalable-deep-reinforcement-learning-for-vision.md)
- [Learning Agile Soccer Skills for a Bipedal Robot with Deep Reinforcement Learning](https://refivu.com/en/papers/3ef41329-5e9b-477a-9ece-c7d4b12b603d-learning-agile-soccer-skills-for-a-bipedal-robot.md)
- [Real-World Humanoid Locomotion with Reinforcement Learning](https://refivu.com/en/papers/8e42e14f-83b7-4879-ab8c-1bd8a7bcea8a-real-world-humanoid-locomotion-with-reinforcement-learning.md)
- [Precise and Dexterous Robotic Manipulation via Human-in-the-Loop Reinforcement Learning](https://refivu.com/en/papers/f8ac2bf8-18ae-41b1-9229-515501c8d0d8-precise-and-dexterous-robotic-manipulation-via-human-in.md)
- [Embodied Intelligence via Learning and Evolution](https://refivu.com/en/papers/35077a07-2c81-4b05-87d4-0a4c83ef04af-embodied-intelligence-via-learning-and-evolution.md)
- [Generative Modeling by Estimating Gradients of the Data Distribution](https://refivu.com/en/papers/f3ef856d-6161-4eaa-b2c9-6a0c3f1ff432-generative-modeling-by-estimating-gradients-of-the-data.md)
- [Universal Language Model Fine-tuning for Text Classification](https://refivu.com/en/papers/f2470a4a-1c9b-423c-8757-ba73cfe37b54-universal-language-model-fine-tuning-for-text-classification.md)
- [Glow: Generative Flow with Invertible 1x1 Convolutions](https://refivu.com/en/papers/fb9c5b80-a221-4385-8910-2ae4413b604b-glow-generative-flow-with-invertible-1x1-convolutions.md)
- [Rainbow: Combining Improvements in Deep Reinforcement Learning](https://refivu.com/en/papers/b98e78e1-7a51-4f55-b8c6-f920fb30d547-rainbow-combining-improvements-in-deep-reinforcement.md)
- [Improved Techniques for Training GANs](https://refivu.com/en/papers/fa2b409d-90c8-47af-916c-aa43ebfdf357-improved-techniques-for-training-gans.md)
- [Variational Inference with Normalizing Flows](https://refivu.com/en/papers/681d4ceb-2dde-4627-a4ad-6ee307d4d2ec-variational-inference-with-normalizing-flows.md)

## Terms in this paper

- [reinforcement learning](https://refivu.com/en/terms/6c51042515d2-reinforcement-learning)
- [KL divergence](https://refivu.com/en/terms/5f1dbea73907-kl-divergence)
- [policy gradient](https://refivu.com/en/terms/abaf88e7ce4d-policy-gradient)
- [advantage function](https://refivu.com/en/terms/451ef9a0779f-advantage-function)
- [Fisher information matrix](https://refivu.com/en/terms/805248ff459f-fisher-information-matrix)
- [trust region policy optimization](https://refivu.com/en/terms/a8b2d22d89a8-trust-region-policy-optimization)
- [Reward shaping](https://refivu.com/en/terms/30df18a15870-reward-shaping)
- [Actor-critic methods](https://refivu.com/en/terms/dde6bcb442fc-actor-critic-methods)
- [conjugate gradient](https://refivu.com/en/terms/2af2b695ddd3-conjugate-gradient)
- [cost](https://refivu.com/en/terms/b30259aec73d-cost)
- [natural policy gradient](https://refivu.com/en/terms/9baf1b6e45c5-natural-policy-gradient)
- [TD(λ)](https://refivu.com/en/terms/44d411d8e78d-td)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/95183c94-f386-4a6d-8fda-f7e55021273b-high-dimensional-continuous-control-using-generalized)
