Log inStart free
LESSON 24.C1 · 6 STAGES · 3 CONTROLS · 2 CHECKSPRO · PREVIEW

The LLM RL loop end to end

One prompt goes around the whole RL loop: sample, grade, mask, compare, update.


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

Go Pro · $8.25/mo
EXPLAINER · 24.C1 · LOOP BAY4 ROLLOUTS · POLICY V0 · LIMIT 6 TURNS
01
Stage 1 of 6 · Sample a group
The actor samples a group of 4 rollouts with policy v0 (24.01). The turn limit 6 cuts rollout 4.
Explain it simply

The actor is the part that runs the model. It plays four tries at the same coding task, called rollouts. A filled square is a tool call, and a hollow one is text. Rollout 4 is slow, so the turn limit stops it at turn 6.

Four rollout rows of turn squares. Rollouts 1 to 3 end with submit. Rollout 4 is cut at turn 6.

rollouts, prompt and tool text, log μtool calls, passes, rewards, A, ratiopolicy versions, chancesfails, cut episodes, clipped pushmasked, dropped, not graded; v0's 25%
actorpolicy v0 · samples 4sandboxleap.py · 4 toolsgraderhidden tests, outsidelearnerpolicy v1lesson 24.09lesson 24.01lesson 24.03lesson 24.10turns · limit 6rollout 1submit · turn 5rollout 2submit · turn 2rollout 3submit · turn 4rollout 4cut · turn 6the actor samples a groupπ v0 = softmax(0, 0, 0, 0): 25% per rolloutrollout 1: 5 turns, ends with submitactorpolicy v0 · samples 4sandboxleap.py · 4 toolsgraderhidden tests, outsidelearnerpolicy v1lesson 24.09lesson 24.01lesson 24.03lesson 24.10turns · limit 6rollout 1submit · turn 5rollout 2submit · turn 2rollout 3submit · turn 4rollout 4cut · turn 6the actor samples a groupπ v0 = softmax(0, 0, 0, 0): 25% per rolloutrollout 1: 5 turns, ends with submit
Toy: the leap-year task of 24.01, 4 rollouts, one logit per rollout
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
πv0(i)=softmax(θ)i=14\sy{pi}{param}{\pi_{v0}}(i) = \mathrm{softmax}(\theta)_i = \tfrac{1}{4}
πv0(1)=0.25\pi_{v0}(1) = 0.25

Policy v0 gives each of the 4 rollouts the same chance.

Common mix-ups

MYTHComparing rollouts in a group cancels a weak grader.

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

Predict, then reveal
2 CHECKS · PRO
Q01With hidden tests and a policy lag of 2, does rollout 1's push survive the clip?

Make your guess, then test it in the diagram. All 2 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 2 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.