PPO, LLM Reasoning, Importance Ratio, Advantage

Work through PPO's clipped objective with numbers: the importance ratio, the sign of the advantage, the clip width ε, and how it maps onto LLM training.

A language model answered a prompt. We scored its response, and now want to make useful choices more likely. But if we train repeatedly on the same recorded response, how much should one batch be allowed to change the model?

Proximal Policy Optimization, or PPO, includes a method called PPO-Clip that removes some incentive to keep pushing a recorded action's probability in the same direction. We will inspect that mechanism with one action. The action could be a game move or a language model's next token.

Compare the old and current probabilities

Suppose the model that collected the response assigned probability 0.20 to a particular token at a particular prefix. After an update, the current model assigns 0.30 to that same token at the same prefix.

The ratio is 0.30 / 0.20 = 1.5. The token is now 50% more likely at that prefix. This importance ratio compares the current policy with the old policy that generated the data:

$$r(\theta)=\frac{\pi_\theta(a\mid s)}{\pi_{\text{old}}(a\mid s)}$$

Here π is an action probability, θ means the current model parameters, s is the state or token prefix, and a is the recorded action. Keep the old probability fixed while updating the current model. The two policies are identical at the start of the batch, so the ratio starts at 1.

Now suppose this action's estimated future return is 4 and the baseline expectation is 2. Its advantage is +2: better than expected. An advantage of −2 would mean worse than expected. In a language model, a final response score can contribute to advantages for the preceding tokens; it does not identify a separate correct answer for every token.

Watch where the incentive stops

Without clipping, the policy objective for this sample would be ratio × advantage. At ratio 1.5 and advantage +2, that is 3. Increasing the ratio would keep increasing the objective.

For this example, choose a clipping width ε = 0.2. That gives the interval [0.8, 1.2]. Clipping leaves values inside the interval unchanged, replaces smaller ones with 0.8, and replaces larger ones with 1.2. PPO-Clip compares the ordinary product with a product using the clipped ratio, and takes the smaller one. We maximize this objective:

$$\begin{aligned} L_{\text{clip}} &= \min(r\widehat A,\;\bar r\widehat A) \\ \bar r &= \operatorname{clip}(r,\;1-\varepsilon,\;1+\varepsilon) \end{aligned}$$

 is the estimated advantage, held fixed for this policy update. With +2 advantage, increasing the ratio from 1.2 to 1.5 no longer helps this term: it stays at 2.4.

What if the advantage is negative? Predict the objective at ratio 0.5 and advantage −2 before opening the answer.

The sign matters. For a bad action, increasing its probability is still penalized, even beyond the clipping interval. PPO does not simply replace every ratio with a clipped number.

Run the three ratios for both advantage signs:

Change only ε to 0.1. For +2 advantage and ratio 1.5, what is the new ceiling?

Fit it into language-model training

PartIn a language model
ObservationPrompt and generated prefix
ActionNext token
PolicyDistribution over vocabulary tokens
RewardFeedback on the response, such as a verifier or reward-model score
Value estimateExpected future return at a prefix

Collect responses with a snapshot of the policy. Score them, estimate advantages, then run a limited number of updates using the saved old log probabilities. A value model is commonly trained alongside the policy. Finally collect fresh responses.

LLM training may also penalize divergence from a separate reference model. That reference is conceptually different from the old policy used in the importance ratio. A larger reward-model score also does not automatically mean a more truthful or useful response; check task performance on held-out prompts.

Inspect the actual claim: Spinning Up's PPO guide works through both advantage signs and explains why clipping can still allow a large policy change. Find its early-stopping discussion: implementations may additionally monitor KL divergence, a measure of distribution change. The original PPO paper, §3, introduces the clipped objective. Read that section's plot by matching its positive and negative advantage cases to the numbers above. This lesson isolates the policy term; it is not a complete PPO trainer.

  • The importance ratio compares current and old probabilities for the same recorded action at the same state or prefix.
  • Advantage estimates how much better or worse the outcome was than a baseline.
  • PPO-Clip maximizes the smaller of ratio × advantage and clipped-ratio × advantage.
  • Clipping removes further incentive in the favorable direction; the sign of the advantage determines that direction.
  • Old probabilities and advantage estimates stay fixed during the policy update. Fresh data is collected after limited updates.
  • Clipping does not guarantee a bound on policy change. A separate reference-model KL penalty is distinct from the old-policy ratio.