Contents · Reinforcement Learning Theory
Part 0 · MDPs
Part 1 · Bellman & Value Iteration
Part 2 · Policy Gradients
Part 3 · Trust Regions
- Natural Gradient, TRPO, and PPO
Part 4 · Actor-Critic
Part 3 · Trust Regions
Natural Gradient, TRPO, and PPO
Policy gradients tell you which way to nudge the parameters , but not how that nudge is measured. Plain gradient ascent moves in the direction of steepest increase under Euclidean distance in , a choice that has nothing to do with the policy the parameters encode. The natural gradient replaces that arbitrary ruler with one built from the policy itself, and TRPO and PPO are two ways of taking a controlled step under it.
Steepest ascent depends on the metric
The gradient is not "the" steepest direction: it is the steepest direction only if you agree to measure step size by . Formally,
so the answer is welded to the Euclidean norm on parameters. That norm is not intrinsic. Rescale one logit, or reparameterize the network, and changes meaning while the policy does not. Two parameter vectors a fixed Euclidean distance apart can encode nearly identical policies in one region and wildly different ones in another. Steepest ascent under such a ruler zigzags and crawls, exactly the pathology of an ill-conditioned problem.
The Fisher metric and the natural gradient
The fix is to measure distance between and by how different the distributions are, using the KL divergence. To second order,
where is the Fisher information matrix, the expected outer product of the score.1 It is the local metric that KL induces on parameter space. Asking for steepest ascent under this metric,
gives the natural gradient . Because KL between distributions does not depend on how those distributions are coordinatized, transforms so that is invariant to reparameterization: it points at the same policy change no matter how you labelled . That is the property vanilla gradient ascent lacks. A KL trust region of radius is the ellipse , and the natural gradient is the direction that climbs fastest inside it.
Worked example: a 3-action softmax
Take a softmax policy over three actions with logits ; the third logit is pinned at , so has two free components. Then and the objective is the expected immediate reward . Two derivatives are all we need. The softmax score is , which gives
and the Fisher on the free coordinates is the restricted covariance of the score,
Evaluate at , so , with rewards and . The vanilla gradient is
The Fisher and its inverse are
so the natural gradient is
The two point about apart. The reward favors action 1 and is indifferent between actions 2 and 3, so the honest move raises alone and keeps : that is exactly . The vanilla gradient instead pushes down as well, distorting the policy in a direction the rewards never asked for. Rescaling by removes that distortion.
J(θ) over the free logits (drag θ)
- π
- (0.33, 0.33, 0.33)
- J(θ)
- 0.667
- ∇J
- (0.44, -0.22)
- F⁻¹∇J
- (2.00, 0.00)
- angle ∠(∇J, F⁻¹∇J)
- 26.6°
- TRPO dθ*
- (1.34, 0.00)
Red is ∇J, green is F⁻¹∇J (drawn to a shared scale). The amber ellipse is the KL ball; the green dot is the TRPO step on its boundary.
TRPO: the largest step in the KL ball
Trust Region Policy Optimization makes this a full update rule. It maximizes the surrogate advantage subject to a hard KL constraint,
Linearizing and using the quadratic KL model turns this into s.t. , whose solution is the natural-gradient step scaled to sit on the trust-region boundary,2
Continuing the example with : here , so the step length is and
landing exactly on the KL ellipse, as the demo's green dot shows. TRPO backtracks along this direction until the true KL constraint and a surrogate-improvement check both hold, which is what earns its monotonic-improvement guarantee. The price is : forming or even applying the Fisher inverse (via conjugate gradients on Fisher-vector products) is the expensive part.
PPO: clipping instead of a trust region
Proximal Policy Optimization keeps the trust-region intent but drops the machinery.3 Let be the likelihood ratio. PPO maximizes a clipped surrogate,
When an update would move outside , the clip flattens the objective there so its gradient vanishes and the incentive to keep moving disappears. This caps the per-sample policy change directly on the ratio, a crude stand-in for the KL ball, using only first-order gradients and no at all. PPO gives up TRPO's formal guarantee and its exact geometry, and in exchange runs with ordinary minibatch SGD, which is why it became the default.
Footnotes
-
Kakade, A Natural Policy Gradient (2001). ↩
-
Schulman et al., Trust Region Policy Optimization (2015). ↩
-
Schulman et al., Proximal Policy Optimization Algorithms (2017). ↩