TL;DR
Schulman and colleagues (2015) prove that a particular surrogate objective never decreases the true expected return when a policy is updated, provided the update is small enough in a measure of distance between policies. They then turn that proof into a practical algorithm, TRPO, which limits each update by an average KL divergence and solves the resulting problem with conjugate gradient and a line search. The method learned walking, swimming and hopping controllers from scratch, and it played Atari games from raw pixels with little per-task tuning.
Builds on: Policy Gradient, Advantage Function, Kullback–Leibler Divergence · Leads to: Trust Region Policy Optimization (TRPO), Proximal Policy Optimization (PPO)
Why it mattered
Robot and game controllers. TRPO was one of the first policy-search methods to learn gaits for simulated swimmers, hoppers and walkers with general neural network policies and simple rewards. Earlier locomotion work relied on hand-built controllers that encoded balance and stepping.
Training large policies. The paper's policy for Atari had about 33,500 parameters, trained from images. Gradient-free methods such as the cross-entropy method scale poorly with the number of parameters, so a gradient method with stable steps was needed.
The base of later methods. Proximal policy optimization, published in 2017 by the same first author, replaces the hard KL constraint with a simpler clipped objective. Later policy-gradient methods that limit how far each update moves build on the same trust-region idea.
The problem
Policy gradient methods estimate how the expected return changes when the policy parameters change, then take a step uphill. A step that is too large can break the estimate. The gradient is only accurate near the current policy, so a step that looks good on the sampled data can move the policy into a region where the data no longer says anything, and performance can collapse.
Choosing the step size by hand is fragile. The paper frames the question differently: what is the largest update that is guaranteed to help? A trust region is the set of policies close enough to the current one that the model of the return can be trusted. Its size is set by a limit on how far the action probabilities may change. To answer the question, the authors need a surrogate objective, a function of the new policy that matches the true return to first order at the current policy, plus a penalty that accounts for how far the policy has moved.
How it works
The method is a loop with a fixed structure. The theory and the practice are linked by a sequence of approximations that the paper states explicitly.
- Collect trajectories with the current policy, and estimate the advantage of each state-action pair.
- Form the surrogate objective. It measures how much a new policy would improve the expected return, using samples from the old policy and an importance weight (Importance Sampling).
- Form the constraint. It limits the average KL divergence between the old and new action distributions over the visited states.
- Solve the constrained problem approximately. Compute the search direction with conjugate gradient, using only products with the Fisher matrix, then take the largest step along it that keeps the constraint and improves the surrogate, found by a line search.
- Set the new parameters and repeat.
flowchart LR A["Sample trajectories with the current policy"] --> B["Estimate advantages"] B --> C["Surrogate objective: expected gain under the new policy"] B --> D["Average KL between old and new policy"] C --> E["Conjugate gradient for the direction"] D --> E E --> F["Line search keeps KL under delta and improves the surrogate"] F --> A
Now trace one update on a single state with two actions, to see the surrogate and the constraint at work. The old policy chooses the two actions with probabilities . Their advantages are and , so the first action is better than average.
- The old surrogate is . Check: the old policy gains nothing over itself, as it should.
- Try a new policy . The surrogate is , which is an improvement. Its KL divergence from the old policy is .
- With a constraint , this step is infeasible, because is larger than . Check: the constraint is an upper bound, and the step is too far.
- Try a smaller move, . The surrogate is . The KL is , just below . Check: the step is feasible and still gives a real gain.
- Interpret. The line search in TRPO does this shrinking automatically. It keeps the largest step that satisfies the constraint and still improves the surrogate, so the update uses as much of the trust region as the data allows.
The math
Let be a stochastic policy with parameters , and let be its expected discounted reward, defined over a Markov Decision Process with discount . The advantage measures how much better action is than the policy's average at state .
For the old policy and a candidate policy , the local approximation is , where is the discounted visitation frequency of states under . It matches to first order at .
Step 1 in symbols: the exact improvement identity
For any two policies,
The improvement is a weighted sum of advantages, with weights from the new policy's visitation. This is exact, but the visitation depends on the new policy, so the identity is hard to optimise directly.
Step 2 in symbols: the approximation and the bound
The surrogate replaces by . Its gap from the truth is controlled by the largest distance between the two policies. The paper's Theorem 1 gives
Here is the total variation distance between two action distributions, and takes the worst case over states. Using the inequality , the bound becomes with .
Step 3 in symbols: the monotonic algorithm
Maximising the right-hand side at each iteration gives a sequence with . The paper calls this a minorisation-maximisation procedure: each step maximises a simple lower bound on the true return, which touches the true return at the current policy. The penalty coefficient from the theory is large, which forces tiny steps, so the practical algorithm replaces the penalty with a hard constraint.
Step 4 in symbols: the trust region problem
The practical problem is
where is the average KL over visited states. The paper argues that the maximum KL constraint at every state is impractical, so it uses the average.
Step 5 in symbols: sample estimates
The surrogate is estimated with importance sampling from trajectories of the old policy. For a state and actions sampled from ,
The paper's single-path method uses sampled trajectories, and its vine method branches from a set of states.
Step 6 in symbols: the approximate solve
Write for the gradient of the surrogate and for the Fisher information matrix, the Hessian of the average KL at . The search direction is , found by conjugate gradient, which needs only products . The step size is the largest value that keeps , followed by a line search that checks the surrogate actually improved.
Results
Locomotion. On three simulated robots (a swimmer, a hopper and a walker), the paper reports that both single-path TRPO and vine TRPO learned to move, and that a natural gradient method with a fixed penalty did worse on the harder hopper and walker tasks. The paper reads this as evidence that a KL constraint is a more robust way to choose step sizes than a fixed penalty.
Constraint versus penalty. The authors also compare with a maximum-KL constraint on the cart-pole problem. It learned more slowly than the average-KL version, but it confirmed that the average is a reasonable approximation.
Atari from pixels. On several Atari games, TRPO used a convolutional network and raw screens as input. Table 1 of the paper compares its scores with human players and earlier methods. TRPO was competitive on some games and clearly behind on others, so the table should be read game by game rather than as a single win. Check the table itself for the exact scores and run counts.
Limits. The paper shows the approach on simulated robots and on Atari. It does not address real robots, partial observability, or recurrent policies, and it names them as future work. The vine method needs the simulator to reset to arbitrary states, which a real system often cannot do. The constraint is an average over visited states, so the paper's guarantee is an approximation to the bound, not the bound itself. The theory assumes exact advantages, so errors in estimating them are not covered by the guarantee.
Reading guide
- Section 1. The motivation: why gradient methods should beat random search on control. Needs Policy Gradient and Reinforcement Learning.
- Section 2. The preliminaries: value functions, advantage, and the improvement identity. Needs Markov Decision Process, Value Function, Advantage Function and Discounted Return. Read this section carefully, since every later step uses it.
- Section 3. The monotonic improvement theorem, the bound, and Algorithm 1. Needs Kullback–Leibler Divergence and Importance Sampling. The proofs are in Appendices A and B.
- Section 4. From the theory to a constraint on average KL. Needs Lagrange Multipliers for the constrained form.
- Section 5. Sample estimation: single path, vine, and the importance-sampled surrogate. Needs Bellman Equation for the values.
- Section 6. The practical algorithm, conjugate gradient, and the Fisher-vector product. Needs Conjugate Gradient and Fisher Information. Appendix C has the algorithm in detail.
- Section 7. Connections with the natural gradient and standard policy gradient. Needs Generalized Advantage Estimation (GAE) only for later context.
- Section 8. Experiments. Read Figure 4 and Table 1 with the setup in Appendix E.
Check yourself
QuestionRecall: what does the surrogate objective approximate, and at which policy is the approximation exact?Show answer
It approximates the true expected return by replacing the new policy's state visitation with the old policy's. It matches exactly at , and to first order in the parameters near it, so small steps that improve the surrogate also improve the return.
QuestionComputation: a state has two actions with advantages and . The old policy is and the new policy is . What is the surrogate value, and how does it compare with the value 0 at the old policy?Show answer
The surrogate is . At the old policy it is . The new policy gains on the surrogate, so the surrogate says the step is an improvement.
QuestionWhy: explain why the paper uses a hard KL constraint rather than the theoretical penalty with its large coefficient.Show answer
The theory's penalty coefficient is large, because is a worst-case advantage and is near 1. A penalty that large forces very small steps, so learning would be slow. A hard constraint on the average KL lets the step use the whole trust region, and the authors found that it made steadier progress than a fixed penalty.
QuestionApplied: you apply TRPO to a robot, and the vine method is not allowed, because the robot cannot be reset to arbitrary states. What is left, and what does the paper say about its cost?Show answer
Use the single-path method, which needs only trajectories sampled by the policy itself and no resets to arbitrary states. The vine method's better use of each sample depends on those resets, so without them, expect the single-path estimate to need more data for the same progress.