The Clipped Surrogate
How Clipping Works
Section titled “How Clipping Works”The PPO objective takes the minimum of the unclipped and clipped surrogate:
Let’s break this down for both cases:
When (the action was good)
Section titled “When A^t>0\hat{A}_t > 0A^t>0 (the action was good)”We want to increase , which increases . But the clip caps the benefit at :
When (the action was bad)
Section titled “When A^t<0\hat{A}_t < 0A^t<0 (the action was bad)”We want to decrease , which decreases . The clip prevents over-correction below :
Interactive: Clipped Objective
Section titled “Interactive: Clipped Objective”Adjust and toggle the advantage sign to see how the clipping region changes:
Worked Example: One PPO Update Step
Section titled “Worked Example: One PPO Update Step”Suppose at a single timestep we have:
- (good action)
Consider three candidate post-update probabilities :
| Inside trust region? | contribution | ||
|---|---|---|---|
| 0.22 | 1.10 | yes (1 − ε = 0.8, 1 + ε = 1.2) | |
| 0.26 | 1.30 | no, clipped to 1.20 | |
| 0.40 | 2.00 | clipped to 1.20 |
Notice the contribution stops growing at . The gradient with respect to at that point is zero — pushing from 0.26 to 0.40 buys exactly zero more reward in the objective. That is the trust-region effect made concrete.
Now flip the advantage. With (bad action) the clip activates on the low side:
| contribution | ||
|---|---|---|
| 0.18 | 0.90 | |
| 0.14 | 0.70 | |
| 0.05 | 0.25 |
For a bad action the takes the more negative number, so the clip prevents extreme down-weighting from over-rewarding the loss. Either way, stays inside (i.e. within of ) before clipping kicks in.
Choosing
Section titled “Choosing ϵ\epsilonϵ”| Effect | |
|---|---|
| 0.1 | Very conservative — slow but stable |
| 0.2 | Standard (OpenAI default) |
| 0.3 | More aggressive — faster but riskier |
In practice, works well across many tasks, including RLHF for language models.
References
Section titled “References”- Schulman et al. Proximal Policy Optimization Algorithms. 2017, §3. arXiv:1707.06347