Trust-Region Policy Optimization

Imagine training a robot arm with policy gradients. One unlucky update — a slightly too-large step — makes the policy suddenly output torques. This flings the arm off the table. The policy never recovers. The new bad policy generates the very data used to compute the next gradient. This is the central fragility of naive policy gradient methods. There is no built-in limit on how far a single update can move the policy. In reinforcement learning, unlike supervised learning, a bad step corrupts the data-generating process itself. Trust-Region Policy Optimization (TRPO) attacks this problem directly. It asks a precise question: how large a step can we take in policy-parameter space? This must still guarantee that the true expected return does not decrease. The answer comes from a theorem that bounds the gap. This gap is between a cheaply computable surrogate objective and the true objective. It is expressed in terms of a KL-divergence penalty. TRPO turns this theorem into a practical algorithm. It maximizes the surrogate subject to a bound on the average KL-divergence between old and new policies. This is solved approximately each iteration using conjugate gradients and a natural-gradient direction. TRPO matters because it was the first policy-gradient method to combine strong empirical performance with a genuine guarantee. This performance was on high-dimensional continuous-control and Atari benchmarks. The guarantee was a non-heuristic monotonic-improvement guarantee. It made policy optimization reliable enough to train locomotion policies, robotic manipulation, and game-playing agents. This happened without constant divergence and re-tuning. Its core idea — constrain policy updates to a "trust region" in distribution space rather than parameter space — reshaped how the field thinks about step-size control in RL. This article builds the theory from the Policy Parameterization and Objectives and The Advantage Function. It proceeds up through the surrogate objective, the monotonic-improvement bound, and the practical constrained-optimization algorithm. It also covers its complexity and correctness. It closes by tracing the direct line from TRPO to its simplified successor, Proximal Policy Optimization.

Key takeaways
  • TRPO maximizes a surrogate objective — expected advantage under the new policy but sampled from the old policy — while bounding the KL-divergence between the two.
  • A theorem bounds the true performance difference between policies by the surrogate objective minus a term proportional to the maximum KL-divergence, giving a monotonic-improvement guarantee.
  • In practice, average KL is bounded (a trust region) instead of max KL, and the constrained problem is solved via a linear approximation of the objective and a quadratic approximation of the constraint.
  • The step direction is the natural gradient, computed efficiently with conjugate gradients using Fisher-vector products, avoiding ever forming the full Fisher information matrix.
  • A line search on the true constraint and surrogate objective corrects for the approximation error, preserving the improvement guarantee in practice.
  • TRPO's ideas — surrogate objective, trust region, natural gradient — directly motivate Proximal Policy Optimization, which approximates the same goal with first-order methods.
The core insight

TRPO improves a policy by maximizing an easy-to-estimate surrogate objective subject to a constraint that the policy not move too far in distribution — a trust region — which provably bounds how much true performance can drop.

The idea

Let πθ\pi_\theta denote a stochastic policy with parameters θ\theta, and let η(π)=Eτ∼π[∑t=0∞γtrt]\eta(\pi) = \mathbb{E}_{\tau \sim \pi}\left[\sum_{t=0}^{\infty} \gamma^t r_t\right] be its expected discounted return. Given a current policy πθold\pi_{\theta_{\mathrm{old}}}, a classical identity (used throughout policy-based methods) expresses the performance of any other policy π\pi in terms of the advantage function Aπold(s,a)A_{\pi_{\mathrm{old}}}(s,a) of the old policy:

η(π)=η(πold)+Es∼ρπ, a∼π[Aπold(s,a)]\eta(\pi) = \eta(\pi_{\mathrm{old}}) + \mathbb{E}_{s \sim \rho_\pi,\, a \sim \pi}\left[A_{\pi_{\mathrm{old}}}(s,a)\right]

where ρπ(s)=∑tγtP(st=s∣π)\rho_\pi(s) = \sum_t \gamma^t P(s_t = s \mid \pi) is the discounted state-visitation distribution under π\pi. This identity is exact but useless computationally, because it requires sampling states from the new policy π\pi, which we have not yet computed. TRPO's first move is to replace ρπ\rho_\pi with ρπold\rho_{\pi_{\mathrm{old}}}, giving the surrogate objective:

Lπold(π)=η(πold)+Es∼ρπold, a∼π[Aπold(s,a)]L_{\pi_{\mathrm{old}}}(\pi) = \eta(\pi_{\mathrm{old}}) + \mathbb{E}_{s \sim \rho_{\pi_{\mathrm{old}}},\, a \sim \pi}\left[A_{\pi_{\mathrm{old}}}(s,a)\right]

This substitution is exactly what makes the objective usable: it can be estimated from trajectories generated by the old policy, using The Advantage Function estimates already computed, and (with an importance-sampling ratio over actions) differentiated with respect to θ\theta. The substitution is also the source of error — for policies that are far from πold\pi_{\mathrm{old}}, ρπ\rho_\pi and ρπold\rho_{\pi_{\mathrm{old}}} diverge, and LL no longer tracks η\eta faithfully. The key theoretical contribution of TRPO is a bound quantifying exactly how much LL can diverge from η\eta, expressed via a KL-divergence penalty between πold\pi_{\mathrm{old}} and π\pi. This transforms an intuitive idea — "don't move the policy too far" — into a precise, provable stopping condition. The practical algorithm then solves, at each iteration,

max⁡θ  Lθold(θ)subject toD‾KL(θold,θ)≤δ\max_\theta \; L_{\theta_{\mathrm{old}}}(\theta) \quad \text{subject to} \quad \overline{D}_{\mathrm{KL}}(\theta_{\mathrm{old}}, \theta) \le \delta

where D‾KL\overline{D}_{\mathrm{KL}} is the KL-divergence averaged over states visited by πθold\pi_{\theta_{\mathrm{old}}}, and δ\delta is a trust-region radius. This is a trust-region method in the classical optimization sense: instead of trusting a linear/quadratic local model everywhere, we only trust it within a region — here, a region in policy-distribution space rather than raw parameter space, which matters because a small parameter change can produce an enormous change in action probabilities (or vice versa).

How it works

The monotonic-improvement bound

Define DKLmax⁡(πold,π)=max⁡sDKL(πold(⋅∣s) ∥ π(⋅∣s))D_{\mathrm{KL}}^{\max}(\pi_{\mathrm{old}}, \pi) = \max_s D_{\mathrm{KL}}\big(\pi_{\mathrm{old}}(\cdot\mid s) \,\|\, \pi(\cdot\mid s)\big). The central theorem states that for α=DKLmax⁡(πold,π)\alpha = D_{\mathrm{KL}}^{\max}(\pi_{\mathrm{old}}, \pi) and a constant ϵ=max⁡s,a∣Aπold(s,a)∣\epsilon = \max_{s,a} |A_{\pi_{\mathrm{old}}}(s,a)|,

η(π)≥Lπold(π)−C DKLmax⁡(πold,π),C=4ϵγ(1−γ)2\eta(\pi) \ge L_{\pi_{\mathrm{old}}}(\pi) - C \, D_{\mathrm{KL}}^{\max}(\pi_{\mathrm{old}}, \pi), \qquad C = \frac{4\epsilon\gamma}{(1-\gamma)^2}

This says: the true return of the new policy is at least the surrogate value minus a penalty that grows with how far, in the worst-case state, the new policy has drifted from the old one. Two immediate corollaries follow. First, at π=πold\pi = \pi_{\mathrm{old}}, both sides equal η(πold)\eta(\pi_{\mathrm{old}}) and the KL term is zero, so the bound is tight at the current policy — there is no slack to exploit trivially. Second, define

M(π)=Lπold(π)−C DKLmax⁡(πold,π).M(\pi) = L_{\pi_{\mathrm{old}}}(\pi) - C\, D_{\mathrm{KL}}^{\max}(\pi_{\mathrm{old}}, \pi).

Then M(πold)=η(πold)M(\pi_{\mathrm{old}}) = \eta(\pi_{\mathrm{old}}) and η(π)≥M(π)\eta(\pi) \ge M(\pi) for all π\pi. Any policy update that increases MM therefore cannot decrease η\eta:

η(πk+1)≥M(πk+1)≥M(πk)=η(πk)\eta(\pi_{k+1}) \ge M(\pi_{k+1}) \ge M(\pi_k) = \eta(\pi_k)

This is a minorization-maximization (MM) algorithm: MM is a lower bound (a minorant) on η\eta that touches η\eta at the current point, and maximizing MM each iteration guarantees the true objective is non-decreasing. This is the same template that underlies expectation-maximization algorithms, and it is what gives TRPO its name: theoretically maximizing MM instead of LL alone yields guaranteed monotonic improvement.

From theory to practice

Maximizing M(π)M(\pi) directly is impractical: the penalty coefficient CC is enormous in typical problems (because γ\gamma close to 11 makes (1−γ)2(1-\gamma)^2 tiny), producing minuscule, glacially slow steps. TRPO makes two practical relaxations: 1. Replace the max-KL penalty with a hard constraint on the average KL-divergence, D‾KLρold(θold,θ)≤δ\overline{D}_{\mathrm{KL}}^{\rho_{\mathrm{old}}}(\theta_{\mathrm{old}}, \theta) \le \delta, chosen empirically (e.g., δ≈0.01\delta \approx 0.01) rather than derived from CC. 2. Solve the constrained problem approximately using local Taylor expansions: linearize the objective, quadratically approximate the constraint. Writing g=∇θLθold(θ)∣θoldg = \nabla_\theta L_{\theta_{\mathrm{old}}}(\theta)\big|_{\theta_{\mathrm{old}}} for the policy gradient and FF for the Fisher information matrix of the policy (the Hessian of the KL constraint at θold\theta_{\mathrm{old}}), the local problem becomes

max⁡θ  g⊤(θ−θold)s.t.12(θ−θold)⊤F(θ−θold)≤δ\max_\theta \; g^\top (\theta - \theta_{\mathrm{old}}) \quad \text{s.t.} \quad \tfrac12 (\theta-\theta_{\mathrm{old}})^\top F (\theta - \theta_{\mathrm{old}}) \le \delta

whose solution (via Lagrange multipliers) is the natural gradient direction

θ−θold=2δg⊤F−1g  F−1g\theta - \theta_{\mathrm{old}} = \sqrt{\frac{2\delta}{g^\top F^{-1} g}} \; F^{-1} g

Forming and inverting FF explicitly is infeasible for networks with thousands to millions of parameters (O(n3)O(n^3) for a naive inverse, O(n2)O(n^2) just to store FF). TRPO instead computes the step direction x≈F−1gx \approx F^{-1}g using the conjugate gradient (CG) method, which only needs the ability to compute Fisher-vector products FvF v for arbitrary vectors vv — computable in O(n)O(n) time via automatic differentiation (a Pearlmutter-style Hessian-vector-product trick applied to the KL divergence), without ever materializing FF. Because the linear/quadratic approximations are only locally valid, the raw natural-gradient step can violate the true KL constraint or even decrease the true surrogate objective. TRPO corrects this with a backtracking line search: it tries the full step, and if either the KL constraint is violated or the surrogate objective did not improve, it shrinks the step geometrically until both conditions hold. ``` PSEUDOCODE — Trust-Region Policy Optimization (single iteration) Inputs: current policy parameters θ_old, trust-region size δ, CG iterations K, backtracking coefficient α ∈ (0,1), max backtracking steps L 1. Collect a batch of trajectories using π_θold, interacting with the environment 2. Estimate advantages Â(s,a) for all visited (s,a) # e.g., via GAE, using a value baseline 3. Form the surrogate objective estimate: L(θ) = (1/N) Σ_i [ π_θ(a_i | s_i) / π_θold(a_i | s_i) ] Â_i 4. Compute policy gradient g = ∇_θ L(θ) at θ = θ_old 5. Use Conjugate Gradient to approximately solve F x = g (so x ≈ F⁻¹ g) without forming F explicitly: function Fisher_vector_product(v): kl = mean_s KL[ π_θold(·|s) ‖ π_θ(·|s) ] # evaluated at θ = θ_old grad_kl = ∇_θ kl gv = grad_kl · v # scalar return ∇_θ (gv) # this equals F v (+ damping·v) x ← ConjugateGradient(Fisher_vector_product, g, iterations=K) 6. Compute the maximal step length under the quadratic KL model: β ← sqrt( 2δ / (xᵀ F x) ) # xᵀFx estimated via one more Fisher-vector product full_step ← β x 7. Backtracking line search (ensures true improvement + true constraint satisfaction): for j = 0, 1, ..., L-1: θ_new ← θ_old + α^j full_step if KL(θ_old, θ_new) ≤ δ and L(θ_new) ≥ L(θ_old) and L(θ_new) is finite: accept θ_new; break if no step accepted after L tries: θ_new ← θ_old # reject the update this iteration 8. (Separately) Fit the value function baseline V_φ by regression on observed returns Output: θ ← θ_new ``` The CG solve in step 5 finds xx minimizing 12x⊤Fx−g⊤x\tfrac12 x^\top F x - g^\top x, which is mathematically equivalent to solving Fx=gFx = g; running K≪nK \ll n iterations (typically K≈10K \approx 10–2020) gives a good approximate direction far cheaper than exact inversion. The line search in step 7 is essential: it is what upgrades an approximate* natural-gradient step into one that verifiably respects the trust-region constraint and improves the surrogate, restoring the guarantees that the Taylor approximations alone would forfeit.

Figure
TRPO's iteration loop: from trajectories to a verified trust-region step
Sample trajectories with π_θold Estimate advantages Â(s,a) via baseline Surrogate objective L(θ) = E[ratio · Â] Policy gradient g g = ∇θ L(θ) Conjugate Gradient solves F x ≈ g using Fisher-vector products Natural-gradient step β·x, scaled to satisfy KL ≤ δ quadratically Backtracking line search shrink step until true KL≤δ and true L improves Accept θ_new η(π_new) ≥ η(π_old) (guaranteed, approx.) next iteration, θ_old ← θ_new Trust region in distribution space, not parameter space π_old accepted step rejected: KL too large

Complexity & correctness

Per-iteration time complexity. Let nn be the number of policy parameters and NN the number of sampled transitions per batch. Sampling trajectories and computing advantages costs O(N)O(N) forward/backward passes through the policy and value networks. Each Fisher-vector product costs two backpropagation passes through the policy network, O(n)O(n) (proportional to network size, same order as an ordinary gradient computation), and CG runs for KK iterations, giving O(Kn)O(Kn) for the search-direction computation — versus O(n3)O(n^3) for naive exact Fisher-matrix inversion and O(n2)O(n^2) just to store FF. Since KK is a small constant (commonly 10–20) independent of nn, TRPO's per-iteration cost is effectively linear in the number of parameters, the same asymptotic order as a plain policy-gradient step, at the price of a constant-factor overhead of roughly 2K+O(1)2K{+}O(1) backward passes plus the line search's extra forward evaluations (each cheap, O(N)O(N), since it only re-evaluates the objective and KL, not full gradients).

Space complexity is O(n+N)O(n + N): parameters, their gradients, and CG's working vectors (O(n)O(n)), plus the stored batch of transitions (O(N)O(N)). No O(n2)O(n^2) matrix is ever stored, which is what makes TRPO usable for policies with millions of parameters.

Correctness argument (why monotonic improvement holds). The proof rests on three pieces fitting together: 1. Exact identity. The performance-difference identity η(π)=η(πold)+Es∼ρπ,a∼π[Aπold(s,a)]\eta(\pi) = \eta(\pi_{\mathrm{old}}) + \mathbb{E}_{s\sim\rho_\pi, a\sim\pi}[A_{\pi_{\mathrm{old}}}(s,a)] is an algebraic consequence of telescoping the discounted-return difference over time steps and using the definition of the advantage function; it holds for any two policies, with no approximation. 2. Bounding the distribution-shift error. Swapping ρπ\rho_\pi for ρold\rho_{\mathrm{old}} introduces an error bounded by a total-variation argument: the difference in expected advantage under the two state distributions is controlled by how much probability mass shifts between them, which itself is bounded by the (max) KL-divergence between the policies via Pinsker's-inequality-type reasoning, propagated through the discounted horizon. This chain of bounds yields exactly the constant C=4ϵγ/(1−γ)2C = 4\epsilon\gamma/(1-\gamma)^2 in the theorem, showing the surrogate-true gap is controlled — not merely correlated — by KL-divergence. 3. MM argument. Given the bound η(π)≥M(π):=Lold(π)−C DKLmax⁡(old,π)\eta(\pi) \ge M(\pi) := L_{\mathrm{old}}(\pi) - C\,D_{\mathrm{KL}}^{\max}(\mathrm{old}, \pi) with equality at π=πold\pi = \pi_{\mathrm{old}}, any π\pi with M(π)≥M(πold)=η(πold)M(\pi) \ge M(\pi_{\mathrm{old}}) = \eta(\pi_{\mathrm{old}}) satisfies η(π)≥η(πold)\eta(\pi) \ge \eta(\pi_{\mathrm{old}}). This is the textbook argument for MM (minorize-maximize) algorithms: improving a global lower bound that touches the objective at the current point cannot decrease the true objective.

Honesty about the practical algorithm's guarantees. The theorem uses DKLmax⁡D_{\mathrm{KL}}^{\max} and a specific, typically very conservative constant CC; the practical algorithm uses an average-KL constraint with an empirically chosen δ\delta, and solves the constrained problem only approximately via linearization plus CG plus line search. Strictly speaking, this means the textbook monotonic-improvement guarantee is not exactly preserved by the implemented algorithm — it is a well-motivated approximation. What is preserved, mechanically, by the line search is a weaker but still meaningful guarantee: each accepted step provably satisfies the average-KL constraint and provably does not decrease the estimated surrogate objective on the current batch. Empirically this tracks true performance closely when δ\delta is small and batches are large enough to keep the advantage/objective estimates low-variance, but it is a heuristic bridge, not a formally airtight guarantee, over the sampling noise and the max-vs-average KL substitution.

Worked example

Consider a small discrete-action policy πθ\pi_\theta with two scalar parameters θ=(θ1,θ2)\theta = (\theta_1, \theta_2), controlling action logits in a 2-state, 2-action toy MDP. Suppose one iteration collects N=4N=4 transitions and computes the following (illustrative, hand-computable) quantities at θold=(0.0,0.0)\theta_{\mathrm{old}} = (0.0, 0.0):

Samplessaaπold(a∣s)\pi_{\mathrm{old}}(a\mid s)A^(s,a)\hat A(s,a)
1s1s_1a1a_10.5+1.2
2s1s_1a2a_20.5−0.4
3s2s_2a1a_10.5+0.3
4s2s_2a2a_20.5+0.9

Suppose the policy gradient at θold\theta_{\mathrm{old}} works out to g=(0.55,0.20)g = (0.55, 0.20) (obtained by differentiating the importance-weighted surrogate, which at θ=θold\theta = \theta_{\mathrm{old}} reduces to the ordinary score-function policy gradient weighted by A^\hat A), and suppose the Fisher information matrix — here small enough to write explicitly for illustration, though TRPO would never form it this way at scale — is

F=(1.00.10.10.5)F = \begin{pmatrix} 1.0 & 0.1 \\ 0.1 & 0.5 \end{pmatrix}

Step — natural gradient via CG. Instead of inverting FF, TRPO's conjugate-gradient routine solves Fx=gFx = g iteratively. Starting from x0=0x_0 = 0, residual r0=gr_0 = g, direction p0=r0p_0 = r_0:

  • Iteration 1: α0=r0⊤r0p0⊤Fp0=0.552+0.202(0.55,0.20)F(0.55,0.20)⊤=0.34250.55(0.55+0.02)+0.20(0.055+0.10)≈0.34250.344≈0.996\alpha_0 = \frac{r_0^\top r_0}{p_0^\top F p_0} = \frac{0.55^2+0.20^2}{(0.55,0.20)F(0.55,0.20)^\top} = \frac{0.3425}{0.55(0.55{+}0.02){+}0.20(0.055{+}0.10)} \approx \frac{0.3425}{0.344} \approx 0.996

giving x1≈(0.548,0.199)x_1 \approx (0.548, 0.199), quite close to the true F−1gF^{-1}g already after one step (since FF is close to diagonal here). Continuing CG for a second iteration would essentially converge to the exact solution

x⋆=F−1g≈(0.551,0.290).x^\star = F^{-1} g \approx (0.551, 0.290).

Step — step-size scaling. With trust-region radius δ=0.01\delta = 0.01, compute x⊤Fx≈0.551(0.551+0.029)+0.290(0.055+0.145)≈0.550x^\top F x \approx 0.551(0.551{+}0.029) + 0.290(0.055{+}0.145) \approx 0.550. Then

β=2δ/(x⊤Fx)=0.02/0.550≈0.191\beta = \sqrt{2\delta / (x^\top F x)} = \sqrt{0.02/0.550} \approx 0.191

so the proposed full step is Δθ=β x⋆≈(0.105,0.055)\Delta\theta = \beta\, x^\star \approx (0.105, 0.055).

Step — line search. TRPO evaluates θnew=θold+Δθ=(0.105,0.055)\theta_{\mathrm{new}} = \theta_{\mathrm{old}} + \Delta\theta = (0.105, 0.055): it recomputes the exact average KL divergence between πθold\pi_{\theta_{\mathrm{old}}} and πθnew\pi_{\theta_{\mathrm{new}}} over the sampled states (not the quadratic approximation) and the exact surrogate objective L(θnew)L(\theta_{\mathrm{new}}). Suppose this full step yields D‾KL=0.013>δ\overline{D}_{\mathrm{KL}} = 0.013 > \delta — the quadratic model under-estimated the true divergence, a common occurrence for larger steps. TRPO backtracks: it tries 0.5×Δθ=(0.053,0.028)0.5 \times \Delta\theta = (0.053, 0.028), recomputes KL and LL; suppose now D‾KL=0.006≤δ\overline{D}_{\mathrm{KL}} = 0.006 \le \delta and L(θnew)=0.31>L(θold)=0.28L(\theta_{\mathrm{new}}) = 0.31 > L(\theta_{\mathrm{old}}) = 0.28. Both conditions hold, so this half-step is accepted as θnew\theta_{\mathrm{new}}. This trace illustrates the two-layer safety net explicitly: the quadratic KL model determines an initial candidate step, and the exact KL and objective, checked in the line search, are what actually gate acceptance — protecting against the inevitable mismatch between the local quadratic approximation and the true, nonlinear KL-divergence surface.

Common pitfalls & traps

PitfallWhy it happensConsequence
Forming FF explicitly for large networksTempting for small toy examples (as above)O(n2)O(n^2) memory, O(n3)O(n^3) inversion — infeasible for deep networks
Skipping the line searchAssuming the quadratic-model step size already satisfies the constraintQuadratic approximation underestimates true KL for larger steps; accepted steps can silently blow past δ\delta and destabilize the policy
Confusing average KL constraint with the theorem's max-KL boundThe two look interchangeableThe monotonic-improvement theorem uses max-KL; the practical algorithm uses average-KL — a real gap, not just a naming detail
Using stale/high-variance advantage estimatesSmall batch sizes, no proper baselineSurrogate objective becomes a noisy estimate of LL, so "improvement" in LL may not reflect true η\eta improvement
Treating the importance ratio πθ/πθold\pi_\theta/\pi_{\theta_{\mathrm{old}}} as valid far from θold\theta_{\mathrm{old}}Ignoring that the surrogate derivation assumes π≈πold\pi \approx \pi_{\mathrm{old}}Large steps make the surrogate objective's own gradient estimate unreliable, independent of the KL constraint
Reusing old trajectories across many CG/line-search evaluations without re-samplingTrying to save computeEach iteration's guarantees are with respect to the sampled state distribution; overusing stale data mismatches the on-policy assumption underlying the derivation

Pioneers & history

TRPO was introduced by John Schulman and collaborators at UC Berkeley (advised by Pieter Abbeel), building on decades-earlier ideas about natural gradients in the parameter space of probability distributions, conservative policy iteration, and trust-region methods from classical numerical optimization.

Origins · 1 minJohn Schulman and how this was discovered
JS
John Schulman
1988– · Berkeley AI Research; later OpenAI cofounder

John Schulman led the development of TRPO as part of his PhD work on scalable, stable policy-gradient methods for high-dimensional continuous control and robotics. He went on to co-develop Proximal Policy Optimization, which simplified TRPO's constrained optimization into an unconstrained objective with a clipped surrogate, trading some of TRPO's theoretical machinery for dramatically simpler implementation and comparable empirical performance. His work bridged rigorous performance-bound theory and practical large-scale deep reinforcement learning systems, later including RLHF pipelines for large language models.

History
2002
— Sham Kakade and John Langford propose Conservative Policy Iteration, an early monotonic-improvement scheme using mixture policies.
1998
— Shun-ichi Amari formalizes the natural gradient for statistical parameter spaces, later foundational to TRPO's step direction.
2015
— Schulman, Levine, Moritz, Jordan, and Abbeel publish Trust Region Policy Optimization, with the surrogate-objective bound and the conjugate-gradient/line-search algorithm.
2016–2017
— TRPO becomes a standard baseline for continuous-control benchmarks (MuJoCo) and large-scale Atari policy-gradient experiments.
2017
— Schulman et al. introduce Proximal Policy Optimization, replacing TRPO's constrained optimization with a clipped first-order surrogate objective.

Where this matters

TRPO's direct descendants are ubiquitous in modern deep reinforcement learning. Proximal Policy Optimization, which simplifies TRPO's machinery into a first-order clipped objective, became the default policy-optimization algorithm behind many robotics locomotion controllers, game-playing agents, and — notably — the reinforcement-learning-from-human-feedback (RLHF) stage used to align large language models, where a KL-constrained-style objective against a reference policy is central for exactly the same reason TRPO cares about it: preventing a single bad update from catastrophically shifting model behavior. Natural-gradient and Fisher-vector-product techniques developed for TRPO's conjugate-gradient solver also influenced later second-order and preconditioned optimization methods in deep learning more broadly. Trust-region reasoning — bound the divergence between successive policies, not just the parameter step — remains the conceptual backbone for stable policy improvement across continuous-control robotics, autonomous-vehicle planning research, and multi-agent training pipelines that require careful control over policy drift.

Ask the tutor: How does the clipped surrogate objective in Proximal Policy Optimization approximate the same trust-region guarantee without conjugate gradients or a line search?

Why can't TRPO just use a small, fixed learning rate on the policy gradient instead of a trust region?

A fixed learning rate controls step size in raw parameter space, but the same parameter-space step can correspond to wildly different changes in the policy's action distribution, depending on the network's local sensitivity (curvature). A tiny parameter change near a near-deterministic policy can flip action probabilities dramatically, while a large change elsewhere barely affects behavior. TRPO's trust region instead bounds the KL-divergence — a direct measure of distributional change — making the step-size control invariant to reparameterization and directly tied to the quantity the monotonic-improvement theorem actually bounds.

What exactly is the "surrogate objective" and why is it safe to optimize with data from the old policy?

The surrogate objective Lπold(π)L_{\pi_{\mathrm{old}}}(\pi) equals the exact performance-difference identity, but with the new policy's state-visitation distribution swapped for the old policy's. This substitution lets it be estimated entirely from trajectories already collected under πold\pi_{\mathrm{old}}, using importance sampling only over the action distribution (not the states). It is "safe" only approximately: the monotonic-improvement theorem quantifies exactly how much error this substitution introduces, as a function of KL-divergence, which is why the KL constraint is necessary rather than optional.

How does TRPO relate to natural gradient descent?

The natural gradient rescales the ordinary policy gradient by the inverse Fisher information matrix, F−1gF^{-1}g, producing an update direction that accounts for the local curvature of the policy's distributional geometry rather than its raw parameterization. TRPO's local quadratic approximation to the KL-constrained problem yields exactly this direction, scaled to the largest step satisfying the quadratic KL budget. TRPO can be viewed as natural gradient descent with an adaptively chosen step size (via the trust-region radius) plus a line-search safety check against the exact, non-approximated constraint and objective.

Does TRPO guarantee improvement in practice, or only in theory?

The theorem guarantees improvement only under an idealized version of the algorithm — exact optimization subject to a max-KL bound with a specific (often very conservative) constant. The practical implementation uses an average-KL constraint, approximate optimization via linearization and conjugate gradients, and finite-sample estimates of the advantage and KL from a single batch. Empirically, updates are usually stable and close to monotonic when the KL threshold δ\delta is small and batches are large, but occasional performance dips can and do occur, especially under high-variance advantage estimates.

Why did the field largely move from TRPO to Proximal Policy Optimization?

TRPO requires computing Fisher-vector products, running conjugate gradients, and performing a line search every iteration — correct but complex to implement, tune, and combine with other network architectures (e.g., ones sharing parameters between policy and value heads). Proximal Policy Optimization replaces the hard KL constraint with a clipped surrogate objective optimizable via plain stochastic gradient ascent, discarding the second-order machinery while empirically achieving similar sample efficiency and stability. TRPO remains the theoretical anchor explaining why constraining policy updates works; PPO is the practical, first-order approximation of that same idea.

What is the role of the advantage function in TRPO, and does the choice of advantage estimator matter?

The surrogate objective is defined directly in terms of the advantage function of the current policy, following the same rationale used throughout The Advantage Function: it isolates the relative value of an action versus the policy's own baseline, reducing gradient variance compared to using raw returns. TRPO in practice pairs well with low-variance, low-bias advantage estimators (such as generalized advantage estimation); noisy advantage estimates directly translate into a noisy surrogate objective and gradient, undermining both the line search's correctness checks and the practical fidelity of the monotonic-improvement argument.

Is the Fisher information matrix in TRPO the same object used in classical statistics?

Yes conceptually: it is the Fisher information matrix of the policy distribution πθ(⋅∣s)\pi_\theta(\cdot\mid s) with respect to its parameters, averaged over states visited by the current policy. It equals the Hessian of the KL-divergence DKL(πθold∥πθ)D_{\mathrm{KL}}(\pi_{\theta_{\mathrm{old}}}\|\pi_\theta) with respect to θ\theta, evaluated at θ=θold\theta = \theta_{\mathrm{old}} — this is precisely why computing Fisher-vector products for TRPO's conjugate-gradient solver reduces to differentiating the KL-divergence twice via automatic differentiation, rather than requiring any specialized statistical machinery.

Before this

Where this leads