Write PPO's clipped surrogate objective. With ϵ=0.2, evaluate the per-sample objective, and say whether it has a non-zero gradient, when (a) A=+1, r=1.5; (b) A=−1, r=0.5; (c) A=−1, r=1.5. 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

LCLIP(θ)=Et[min⁡(rt(θ)At, clip⁡(rt(θ),1−ϵ,1+ϵ)At)] with rt(θ)=πθ(at∣st)/πθold(at∣st). 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

  1. Define the ratio rt(θ): how much more (or less) likely the new policy makes the action than the old one. Define the advantage At: how much better the action was than average in that state, estimated for example with GAE (generalised advantage estimation). At θ=θold, rt=1 and the gradient equals the ordinary policy gradient.
  2. Case (a): min⁡(1.5×1, 1.2×1)=1.2. The clipped term is active and constant in θ, so the gradient is zero: no further push to raise an already boosted good action.
  3. Case (b): min⁡(0.5×(−1), 0.8×(−1))=min⁡(−0.5, −0.8)=−0.8. Clipped again, zero gradient: the bad action is already less likely enough.
  4. Case (c): min⁡(1.5×(−1), 1.2×(−1))=min⁡(−1.5, −1.2)=−1.5. The unclipped term is active, so the gradient still pushes rt down: the update can always undo a step that made a bad action more likely.
  5. 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

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 −1 per step, −100 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 γ=0.5. In X, action a gives reward 2 and moves to Y, while action b gives reward 1 and stays in X. In Y, action c gives reward 0 and moves to X, while action d gives reward 3 and stays in Y. Run policy iteration from the policy "b in X, c in Y". What are the evaluation and improvement steps, and what are the optimal policy and values?