LESSON 24.01 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
An LLM task as an RL environment
Watch a coding task run as an RL episode, from prompt to reward.
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/moEXPLAINER · 24.01 · EPISODE BAYTURN 0 · 2 FILES · 4 HIDDEN TESTS
01
Stage 1 of 6 · Prompt starts it
The prompt sets the initial state at turn 0. The files and the hidden tests are state the agent cannot see yet.
Explain it simply
A task prompt is like a job ticket. It starts the episode, and it sits alone in the conversation. The environment holds the whole state: a code file, a test file and four hidden tests. The agent sees none of them yet, so each box has a dashed outline.
The conversation holds the prompt: is_leap() is wrong for some century years. Fix leap.py. The environment holds leap.py, the test file and 4 hidden tests, all with dashed outlines.
state, observationsactions, rewardtools, limit, θfailed test, cut-offnot seen by the agent
Toy: a leap-year fix, 4 hidden tests, 4 rollouts per prompt
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
The first state holds the prompt and everything the environment keeps.
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.