Answers · How models work
Why does PPO clip the probability ratio?
In shortPPO clips the probability ratio so the objective stops rewarding a policy for pushing an action further in the direction it already favours, while still penalising pushes the wrong way.
PPO clips the probability ratio because the ratio multiplies the advantage, and without a limit the objective can keep paying for the same action to become more and more likely. The clip places a band around one; outside that band the objective stops increasing, so the optimiser has no further reward for pushing that action's probability in the same direction.
For one sampled action take a clip width , so the band is . If the action had positive advantage , at the unclipped term is . The clipped ratio is , so the clipped term is , and the minimum is . At the unclipped term is but the clipped term is still , so the minimum is still . The objective has gone flat in : making a good action even more likely than times its old probability buys nothing further in this term.
The same band is deliberately not symmetric in its effect. Take , a bad action. At the unclipped term is , the clipped term is , and the minimum is , the more negative one. So a bad action that has been pushed far above the band is still penalised at full strength; clipping alone would have softened that penalty to and left a zero gradient at the edge. At the unclipped term is , the clipped term is , and the minimum is . For that value stays at , so a bad action made much less likely also stops earning further reward. The flat side has moved to the lower edge because the advantage is negative.
What the band does not do
The natural guess is that clipping puts a hard limit on how far the policy can move. It does not. The ratio is still whatever the current parameters make it; nothing in the objective prevents from being or well below the lower edge. What is limited is the objective's payment for that sample. On the side where the action is already being made more likely and the advantage is positive, the gradient with respect to is zero once , so an ordinary optimiser has no reason to go further. On the other side the full penalty remains. This is a one sided brake, not a fence.
Replacing the ratio by its clipped value without the minimum fails exactly here. For at , the clipped-only term is and its gradient in is zero, so a policy that has made a bad action far too likely receives no correction from this term. The minimum restores the unclipped , whose gradient is nonzero. For at , the clipped-only term is and flat, so a good action made too unlikely would also stop being pulled back; the minimum keeps and its gradient. The minimum chooses the smaller of the two terms, and that choice is what places the flat region on the safe side for each sign of the advantage.
Where it stops
Clipping is a first order imitation of a trust region, not the trust region itself. The constrained problem maximises the reweighted objective subject to an average divergence budget, and its solution is the gradient rescaled by the curvature of that divergence. Clipping has no second order object and no explicit budget on the average divergence; it only removes the incentive for further movement in the direction that is already paying. A policy can still move far if many terms in the batch push the same parameters, and the guarantee is local to the states in the batch. The old policy's state distribution is fixed, so states it did not visit get no correction at all.
The clip width sets how much of a single sample's ratio is allowed to matter. With the band is ; a smaller band makes the objective flatter sooner and allows less reuse of one batch before the old ratios are too stale. A larger band lets the same batch be pushed harder, at the cost of the policy moving further from the behaviour that produced the advantages. The safe range is empirical, because the objective is an approximation to the constrained problem rather than the constrained problem itself.
Worth keeping
- Clipping bounds the objective's incentive, not the policy's actual probability ratio.
- The minimum is essential: clipping alone would remove the correction for bad actions driven too far.
- A smaller clip width makes the update more conservative; a larger one allows more reuse of the batch.
Where this goes next
This question is one step of Learning From Reward, a course that works through its subject from the beginning. The page that teaches this part of it is Keeping the Step Small Where It Matters, and it reads the whole way through whether or not you have an account.
What an account changes is the practice: problems standing under every idea, marked with a reason rather than a tick, in a copy of the course that is yours.
Read that pageThe whole courseOther questions people ask about this
- Why is the REINFORCE gradient so noisy even though it is unbiased?Because unbiased only fixes the average, while one noisy return is multiplied by every action's score, so the estimate's spread grows with episode length and reward scale.
- What is the KL penalty against the original policy actually protecting against?It stops the policy from chasing high scores in parts of the answer space where the fitted reward is only guessing, by charging it for moving away from the model it started from.
- Why does the value of a state have to satisfy a recursive equation with the next state's value?A state's value equals the reward from the next step plus the discounted value of wherever that step lands, because every possible future divides that way and averaging over the first step leaves exactly the next state's value.
- How do human pairwise comparisons turn into a reward function?Human pairwise preferences become a reward by fitting a scoring model so that preferred responses score higher, then using that score with a penalty for drifting from the starting model.
- Why does the model get stuck repeating the same sentence over and over?The model is not stuck in a memory loop: once it has written a phrase, that phrase is in its context and makes writing it again more likely, so a decoder that always picks the top word cannot leave.
- Why does diffusion add Gaussian noise instead of any random corruption?Diffusion adds Gaussian noise because Gaussian errors combine exactly: each step keeps the spread fixed and gives a closed-form noisy picture at any later step, which makes the reverse step learnable.