Log inStart free
LESSON 17.13 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

PPO clipping

Watch PPO reuse one batch and stop the steps that moved too far.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 17.13 · POLICY GRADIENT BAYITERATION 1 · 4 EPISODES · 69 STEPS
01
Stage 1 of 6 · Collect a batch
The old policy plays 4 episodes: 25, 21, 12 and 11 steps. Each step keeps its old chance.
Explain it simply

Each row is one episode, and each small cell is one step. A tick up means a push right, and a tick down means a push left. At the start, both pushes have the same chance, one half. PPO keeps that old chance with every step, so it can compare later.

Four rows of cells: episodes of 25, 21, 12 and 11 steps. Every step has an old chance of 0.50.

steps, pushesclip band, settingsclipped, KLadvantage, ratio, results
episode 125 stepsepisode 221 stepsepisode 312 stepsepisode 411 stepsiteration 1: the batchπ_old(a | s) = σ(0) = 0.50 at every stepepisode 125 stepsepisode 221 stepsepisode 312 stepsepisode 411 stepsiteration 1: the batchπ_old(a | s) = σ(0) = 0.50 at every step
Toy: the 17.C2 cart-pole, seed 1708
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
πold(a∣s)=σ(w⋅s)\sy{po}{out}{\pi_{\text{old}}}(\sy{a}{data}{a} \mid \sy{s}{data}{s}) = \sigma(\sy{w}{param}{w} \cdot \sy{s}{data}{s})
πold(a∣s)=σ(0)=0.50\pi_{\text{old}}(a \mid s) = \sigma(0) = 0.50

The old policy's chance of the push it took.

Common mix-ups

MYTHClipping keeps every ratio between 1 − ε and 1 + ε.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With 1 epoch per batch, does the clip ε change the run?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.