Write PPO's clipped surrogate objective. With , evaluate the per-sample objective, and say whether it has a non-zero gradient, when (a) , ; (b) , ; (c) , . What is the clipping for?
Reinforcement learning, Policy gradients
Level L3 Intermediate. Length Medium. Nature Th+Mat Both.
What's being asked
Whether you understand that the clip gives a pessimistic objective that removes the incentive to move the policy too far in one update, and can evaluate it case by case.
Key idea
with . The min takes the more pessimistic of the two terms, so moving the ratio past the band earns nothing, while changes that make the objective worse are always penalised.
Steps
- Define the ratio : how much more (or less) likely the new policy makes the action than the old one. Define the advantage : how much better the action was than average in that state, estimated for example with GAE (generalised advantage estimation). At , and the gradient equals the ordinary policy gradient.
- Case (a): . The clipped term is active and constant in , so the gradient is zero: no further push to raise an already boosted good action.
- Case (b): . Clipped again, zero gradient: the bad action is already less likely enough.
- Case (c): . The unclipped term is active, so the gradient still pushes down: the update can always undo a step that made a bad action more likely.
- Purpose: it approximates the trust region of TRPO (trust region policy optimisation), which limits the KL divergence between old and new policies, with a first-order method, so you can run several epochs of minibatch SGD on the same batch without the policy collapsing.
Common mistakes
- Saying the ratio itself is clipped to . The ratio can leave the band; the objective just stops rewarding it.
- Forgetting the min, which is what makes the objective a lower bound on the unclipped surrogate.
- Treating clipping as a hard KL guarantee. The KL can still grow, which is why implementations monitor it and stop early.
How long your answer should be
The formula plus a three-row table of cases; 3–4 minutes.
Last checked on 4 December 2026.
Read this
Previous in Reinforcement learning: In the cliff-walking gridworld (reward per step, for stepping off the cliff), an -greedy SARSA agent learns a safe path away from the edge, while Q-learning learns the path along the edge yet earns less reward per episode during training. Why?
Next in Reinforcement learning: An MDP has two states X and Y and . In X, action gives reward and moves to Y, while action gives reward and stays in X. In Y, action gives reward and moves to X, while action gives reward and stays in Y. Run policy iteration from the policy " in X, in Y". What are the evaluation and improvement steps, and what are the optimal policy and values?