PPO (Proximal Policy Optimization)

Definition

Proximal Policy Optimization (Schulman et al., 2017; arXiv:1707.06347) is a first-order policy-gradient method that makes training stable by baking a trust region into the objective: a clipped surrogate that removes the incentive to move the policy too far in a single update. It gets most of TRPO’s near-monotonic-improvement guarantee with only clipping and plain SGD, and enables multiple epochs of reuse per batch via importance sampling. It is the classic RLHF optimizer.

Key math

Probability ratio (equals 1 at ). The clipped surrogate:

Both pieces are essential. The clip flattens the objective once the ratio moves a factor in the helpful direction (zero gradient — stop rewarding overshoot). The min makes it a pessimistic lower bound: when the ratio has moved the wrong way, the unclipped (active-gradient) branch is kept so a corrective gradient still pulls it back. Full objective (with value and entropy terms):

Advantages from GAE, usually normalized per minibatch. Loop: rollout → GAE → epochs () of minibatch SGD → refresh . Typical ; PPO-Penalty is an adaptive- KL variant, largely superseded by clip.

Why it matters

RLHF is PPO applied to language generation: policy = the LLM, action = next token, reward = reward-model score at EOS minus a per-token KL penalty to a frozen reference. Note the two distinct KLs: the implicit trust-region KL to (enforced by clip, per-step) and the explicit reference KL to (in the reward, over the whole run). PPO is operationally heavy — up to four large models (policy, critic, reference, reward) and sensitive to , , , and advantage normalization — which motivates GRPO (drop the critic) and DPO (drop the RL loop).

Taught in

  • 04-ppo — TRPO → clipped surrogate derivation, the min case analysis, full objective and loop, and the RLHF instantiation.

See also