Every derivation of TRPO reaches the same step and handles it the same way. You want to know how much better a new policy is than the old one, the honest expression involves the new policy's state distribution, you cannot sample that without already having deployed the new policy — so you swap in the old one and write something like "assume the state distribution changes negligibly for small updates."
I took that at face value for a long time, and it bothered me, because the assumption is plainly false. Policies do not change state distributions negligibly. A small parameter change can route an agent down an entirely different branch of the environment. If the whole method rested on that being small, the method should not work as well as it does.
It does not rest on that. The swap is exact to first order, and the reason has nothing to do with the state distribution being stable — it is a property of the advantage function that makes the state-distribution term drop out no matter how violently it moves.
Where the expression comes from
The starting point is the performance difference lemma (Kakade & Langford, 2002). For any two policies,
Most write-ups quote this and move on, which is a shame, because the proof is three lines and it is the good kind of proof — the kind where the result stops being a fact you memorised.
Note the mismatch the lemma leaves behind, because it is the source of all the difficulty: the expectation is over , while the advantage function belongs to . We have data from and need an expectation over a policy we have not run.
The swap
Rewrite the lemma over the discounted state visitation measure , then replace with — the step in question — and use importance sampling on the action:
This is estimable from old data, which is the point. The question is what it cost.
Why the cost is second order
Claim. and .
The derivative of the state distribution is not small. It is annihilated — multiplied by a quantity that is identically zero at .
Two things I find worth keeping from this. First, the error from the swap is , not , which is the actual licence to take a small step and trust the surrogate — the entire foundation of trust-region methods, resting on a cancellation rather than on an empirical claim about environments.
Second, the proof requires the advantage function specifically. Run it with in place of and , so term survives and the swap really is a rough approximation. The usual story for subtracting a baseline is variance reduction. This is a second, structural reason, and I had never seen the two connected.
The bound nobody uses
First-order agreement says the error is second order but not how big the constant is. The monotonic improvement theorem supplies one: with ,
Maximise the right-hand side and cannot decrease. It is a genuine minorise-maximise guarantee, and it is unusable: at , . The step it sanctions is far too small to train with.
So TRPO keeps the shape and throws away the theorem. The KL penalty becomes a hard constraint with a hyperparameter, and the max over states becomes a mean because you cannot estimate a max over a continuous state space. Both moves void the guarantee. This seems worth saying plainly: the theory picks the shape of the algorithm — constrain a divergence between policies, not a distance between parameters — and then practice discards the constants. It is a derivation that earns its keep by ruling out alternatives, not by being followed.
One asymmetry that is not arbitrary
The remaining piece: TRPO expands the objective to first order and the KL constraint to second. That looks inconsistent until you check what the terms are. At the KL is zero and, because the score function has zero mean, its gradient is zero too. So a first-order expansion of the constraint gives — no constraint at all. The second-order term is the first one that exists:
where is the Fisher information matrix. The objective, by contrast, has a perfectly good non-zero gradient, and its Hessian would be a mess — it carries the advantage function as a weight, so it is not positive semi-definite and its estimate is far noisier than , which depends only on the policy. Hence the division of labour: the objective's first-order information picks the direction, the KL's second-order structure decides how far. Solving that QP gives the natural gradient , and PPO is what you get when you decide the whole apparatus is not worth it and clip the probability ratio instead — keeping the shape, dropping the guarantee, one more time.
What I am still unsure about
- How much of PPO's behaviour the trust-region story explains at all. Clipping bounds a per-sample ratio; it does not bound KL, and across several epochs on one batch the divergence can go wherever it likes. That implementations need KL early-stopping on top suggests the clip is doing something other than what the lineage says it does.
- Whether first-order agreement is the right thing to want. It licenses a small step. Modern RLHF takes large effective steps on enormous batches, where the second-order term is not obviously negligible.
- What the zero-mean cancellation looks like under GRPO, where the advantage is a group-normalised reward rather than . Group normalisation makes it zero-mean within a group by construction, which looks like it should preserve the argument — but "zero-mean over sampled completions" and "zero-mean under the policy at every state" are not the same statement, and I have not worked out whether the gap matters.