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

Token- vs action-level credit assignment and loss masking

Watch one agent episode become training targets, token by token.


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 · 24.04 · TRAINER BAYROLLOUT 1 · 80 TOKENS · 52 BY THE POLICY
01
Stage 1 of 6 · Token stream
Rollout 1 is one stream of 80 tokens: prompt, actions and tool results. The policy wrote 52.
Explain it simply

You see the whole episode written out as text and cut into tokens, small pieces of text. Each blue cell is a token the policy wrote, in 5 actions. Each teal cell came from the prompt or from a tool. The trainer reads this one stream.

Rollout 1 as rows of token cells: one prompt row and 5 turns. 52 cells are policy tokens; 28 are prompt and tool text.

policy tokens, creditprompt, tool textlimit, budgetcut, malformed, negative creditmasked out
promptt1 read_file("leap.py")t2 Century years need th…t3 edit_file("leap.py", …t4 run_tests()t5 submit()15 tokens14 tokens7 tokens35 tokens5 tokens4 tokensrollout 1: the episode as tokens|y| = 80 tokens: 52 written by the policypromptt1 read_file("leap.py")t2 Century years need th…t3 edit_file("leap.py", …t4 run_tests()t5 submit()15 tokens14 tokens7 tokens35 tokens5 tokens4 tokensrollout 1: the episode as tokens|y| = 80 tokens: 52 written by the policy
Toy: the leap-year fix of 24.01, 4 rollouts per prompt
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
y=(x, a1, o1, a2, o2, … )\sy{y}{ink}{y} = (\sy{x}{data}{x},\ \sy{a}{out}{a_1},\ \sy{o}{data}{o_1},\ \sy{a}{out}{a_2},\ \sy{o}{data}{o_2},\ \dots)
∣y∣=15+52+13=80 tokens|y| = 15 + 52 + 13 = 80\ \text{tokens}

The stream is the prompt, then each action and its tool result.

Common mix-ups

MYTHEvery token of the episode should be a training target.

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

Predict, then reveal
3 CHECKS · PRO
Q01With no mask, what share of rollout 1's targets did the policy not write?

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.