AI Glossary / Reinforcement learning and robotics / Advanced
Trust region policy optimization
Definition
Trust region policy optimization, or TRPO, is a policy-gradient reinforcement-learning method that seeks an improved policy while limiting how much its action distribution changes. It optimizes a surrogate objective subject to a Kullback - Leibler divergence constraint. The practical algorithm uses sampled data and approximate optimization, motivated by theoretical policy-improvement bounds rather than inheriting an unconditional improvement guarantee for every update.
What it means
A policy update can look promising on data from the old policy yet perform poorly after changing the states the agent visits. TRPO addresses that problem by controlling policy change, keeping the new policy within a region where the old-policy data remain more informative.
The trust region is measured in behavior distributions, not simply by the size of the parameter vector change. A small change in neural-network weights can have a large behavioral effect, while a larger parameter movement may barely alter action probabilities.
TRPO is commonly used with freshly collected on-policy trajectories. The probability ratio inside its surrogate is used to compare nearby policies on those samples; its presence does not make arbitrary old replay data automatically suitable for standard TRPO.
How it works
Collect trajectories with the current policy and estimate advantages: how much better or worse an action appears than the policy's state value. Form a surrogate by multiplying those advantages by the new action probability divided by the old action probability, then averaging over old-policy samples.
In reward-maximizing notation, seek a larger surrogate while constraining the average KL divergence from the old action distribution to the new one. The original theoretical bound involves a worst-state divergence, whereas the practical method uses an average over sampled states.
Approximate the objective locally with a linear expression and the KL constraint with a quadratic expression. Conjugate-gradient calculations can obtain a direction without constructing a dense curvature matrix. A backtracking line search checks candidate steps against the sampled objective and constraint.
The advantage estimates, finite sample, average constraint and approximate solver all matter. A practical step that passes these checks can still reduce true return. The original paper explicitly distinguishes its theoretical scheme from the approximations used to build the scalable algorithm.
Three practical examples
1. A simulated locomotion policy improves its action distribution while limiting abrupt changes that could invalidate the current batch's estimates.
2. An evaluation team compares a proposed update's surrogate gain with its measured KL change before accepting a step.
3. A researcher checks whether rare states experience large policy changes despite a modest average KL divergence.
Think of it this way
Think of revising a familiar route using a map whose local details are reliable. You can confidently explore nearby changes, but a dramatic rerouting may invalidate the assumptions behind your estimate. TRPO formalizes one notion of staying nearby: similarity between old and new action distributions. This does not mean the route is physically close or free of hazards.
Worked example
Consider an original one-state, one-step decision problem. Action A earns reward 2 and action B earns reward 0. The old policy chooses each with probability 0.5, so its expected reward is 1. Its exact advantages are +1 for A and -1 for B.
Candidate C assigns probabilities 0.55 and 0.45. Its old-policy surrogate is 0.5 times (0.55/0.5) times 1 plus 0.5 times (0.45/0.5) times -1, or 0.10. Its expected reward is 1.10.
Using natural logarithms, KL(old||C) is 0.5 log(0.5/0.55) plus 0.5 log(0.5/0.45), approximately 0.005025. It satisfies a KL budget of 0.01.
Candidate D assigns probabilities 0.6 and 0.4. Its surrogate gain is 0.20 and expected reward is 1.20, but KL(old||D) is approximately 0.020411. It exceeds the budget, despite the greater gain in this simple example.
This illustrates a feasibility check, not a full TRPO solve: C is not asserted to maximize the objective within the budget. Because the episode has only one state and exact rewards, the surrogate gain equals true improvement here. In a sequential problem, changed state visitation and estimated advantages break that simple equality.
The direction of KL is part of the specification. Reversing old and new generally changes its value. Neither calculation can be replaced by the absolute difference between the two scalar action probabilities without changing the constraint.
Illustrative case study
In a fictional project, Northbank Simulation trains a resource-allocation policy. A large update improves the sampled surrogate but violates the chosen KL budget. The line search reduces the step until the implemented acceptance conditions are met.
The researchers then evaluate the accepted policy on independent simulated episodes and inspect changes at rarely visited states. They distinguish accepted optimization steps from verified gains in operational outcomes.
The project illustrates controlled policy updating, not a reported deployment or proof that every accepted step improves performance. The team records failed line searches and evaluation variability alongside successful runs, helping reviewers understand when the trust-region procedure was inconclusive.
Common misconceptions and mistakes
Do not describe the practical average-KL constraint as a bound on every state's policy change. Do not interpret trust as a measure of human trustworthiness or safety. Do not confuse a small parameter step with a small distributional step.
Another mistake is claiming that TRPO clips action-probability ratios in the same way as PPO-Clip. TRPO's explicit constrained optimization and PPO's clipped surrogate are different mechanisms, even though they share related motivations.
Business use
TRPO can provide a useful reference when a team values controlled policy updates and can afford fresh trajectory collection and curvature-related computations. Evaluate interaction cost, optimization overhead, advantage quality and performance variability. Keep the KL budget, averaging distribution and acceptance criteria in the experiment record so a claimed stable update can be interpreted correctly.
People also ask
Does TRPO guarantee every practical update improves return?
No; sampled estimates and algorithmic approximations limit that claim.
Is KL a distance in the ordinary geometric sense?
It is a divergence and is generally asymmetric.
Why use a trust region?
It limits behavioral change while optimizing an objective estimated from the old policy's experience.
Check your understanding
Which candidate meets the example's 0.01 KL budget?
Answer: Candidate C.
Why is D rejected despite its higher return?
Answer: Its divergence exceeds the stated constraint.
Why does the example's surrogate equal actual improvement?
Answer: It is a single-state, one-step problem with exact advantages and no later visitation shift.
Related terms
- Policy gradient
- Advantage function
- Proximal policy optimization
- Conservative policy iteration
- Line search
- Natural policy gradient
- KL divergence
Learn next
Learn policy-gradient surrogates and KL divergence first. Then study local quadratic constraints, conjugate-gradient methods and the distinction between worst-state and average policy-change bounds. Compare TRPO with PPO only after identifying their different update rules.
More in Reinforcement learning and robotics
- Trajectory - In reinforcement learning, a trajectory is an ordered sequence of interactions between an agent and its environment.
- Tree selection policy - A tree selection policy is a rule for choosing which branch to follow while traversing a search tree.
- True online TD(lambda) - True online TD(lambda) is a temporal-difference prediction algorithm whose efficient backward-view updates exactly match a specified online forward view for...
- Twin delayed deep deterministic policy gradient
- UNCANNY VALLEY - The uncanny valley is a proposed pattern in people's responses to humanlike artificial characters or robots: increasing human resemblance may initially...
- V-trace - V-trace is an off-policy multi-step target construction for state-value learning, introduced with the IMPALA distributed actor-learner architecture.
Sources
Schulman, Levine, Moritz, Jordan and Abbeel, Trust Region Policy Optimization, ICML 2015, sections 3–6: https://proceedings.mlr.press/v37/schulman15.pdf. The paper uses cost-minimizing notation; this entry states the equivalent reward-maximizing interpretation. The one-step calculation and fictional case are original teaching examples.
Previous: Trust region Next: Trustworthiness