Proximal Policy Optimisation (PPO)
Policy gradient with a clipped objective that stops updates from changing the policy too much.
The idea
After collecting data, PPO takes several gradient steps on the same batch, but clips the probability ratio r = π_new/π_old to [1 − ε, 1 + ε]. Once an action's probability has moved enough in the helpful direction, the gradient is cut off, keeping each update inside a safe "trust region" with a simple first-order method.
L = E[min(r·A, clip(r, 1−ε, 1+ε)·A)]
Watch it run
This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.
- probability of action
- sample pushed up
- sample pushed down
The policy starts uniform: every action is equally likely.
- iteration:
- 0
- expected reward:
- 0.5
Dashed ticks mark each action's probability before this iteration's updates.
Step by step
- 1Collect trajectories with the current policy.
- 2Compute advantages (often with GAE).
- 3Compute the ratio r = π_new(a|s)/π_old(a|s).
- 4Maximise min(r·A, clip(r, 1−ε, 1+ε)·A) for several epochs.
- 5Replace the old policy and repeat.
Where it is used
Robotics, games (OpenAI Five) and RLHF for language models.
Watch out for
Sensitive to implementation details; still on-policy.