Agents and Worlds
What does it take to act over many steps in a world you only partly see?
At 97 percent a step, thirty steps in a row succeed 40 percent of the time: the part opens on sixty simulated runs dying off. It goes back to Shakey and the DARPA races, then to a robot in a corridor of 40 cells whose belief is predicted and corrected by Bayes' rule, which is Part 7's forward algorithm. The agent loop of thought, action and observation is shown on a simulated warehouse agent with tools, protocols and memory. Errors compound as p to the n, the half-way horizon is derived, and METR's time-horizon measurements are refitted to a doubling every few months. The part turns to learning to act: on a windy lane solved exactly, behaviour cloning's cost is bounded by T squared epsilon and DAgger repairs it by labelling the states the learner itself reaches. World models follow, with a small Dreamer trained from pixels inside its own dreams, then Genie, sim-to-real with domain randomization on the cart-pole, and vision-language-action models with flow-matched action chunks and FAST's DCT tokens.
What you need. Bayes' rule and Markov chains (Part 5), hidden Markov models (Part 7), reinforcement learning (Part 26) and flow matching (Part 21) for the last two chapters.
- Mathematics and history
- POMDPs, tool use, long horizons, imitation learning, world models, VLAs
- Models, data
- Dreamer, Genie, π0
What you will be able to do
Undergraduate
- Compute the chance that a task of n steps succeeds at per-step reliability p, and the task length at which it falls to one half.
- Update a belief over positions after a move and a sensor reading with Bayes' rule.
- Describe the loop a language-model agent runs and what tools and memory add to it.
Master's
- Derive the belief update of a POMDP and identify it with the forward algorithm.
- Prove behaviour cloning's bound J <= J* + T^2 eps by coupling learner and expert, and explain why DAgger's cost grows only linearly in T.
- Write Dreamer's world-model loss term by term and say what KL balancing and symlog are for.
Research
- State DAgger's no-regret reduction and what its guarantee assumes about the expert and the policy class.
- Relate the ratio of 50% to 80% time horizons to the hazard's shape, and say what a falling hazard implies for long tasks.
Engineering
- Read an agent benchmark score (SWE-bench Verified, OSWorld, Terminal-Bench) with its known flaws, and tell a company claim from an independent measurement.
- Choose between per-step binning and DCT-based action tokens from token count and reconstruction error, and use domain randomization to cross a reality gap.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Undergraduate 19 min · Master's 50 min · Research 53 min · Engineering 32 min.
- 0Many steps in a rowUndergraduate1 min
- 1From Shakey to agentsUndergraduate3 min
- 2Acting without seeing everythingUndergraduate3 min
- 3The agent loopUndergraduate3 min
- 4Memory, and many agentsMaster's3 min
- 5Compounding errorUndergraduate2 min
- 6Horizons that doubleMaster's3 min
- 7Coding agentsEngineering3 min
- 8Using a computerEngineering2 min
- 9Learning by imitationUndergraduate4 min
- 10DAggerMaster's3 min
- 11World modelsMaster's3 min
- 12Dreamer: learning inside a dreamMaster's4 min
- 13Worlds you can walk throughResearch3 min
- 14From simulation to realityEngineering3 min
- 15Vision-language-action modelsMaster's3 min
- 16Action tokens, and robot foundation modelsEngineering4 min
- Recap, problems, and what comes nextAll tracks2 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · 中文 · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film. A dashed box stands for a number the film computes when it is rendered (hover over it to see what is computed); the README's figures for each chapter, where it lists them, follow the chapter's text.
Many steps in a rowUndergraduate1 min
A chatbot answers one question. An agent has to do a whole job: thirty steps, a hundred, a thousand, each depending on the last. Even at ninety-seven percent per step, thirty steps in a row succeed only 40 percent of the time.
Here are 60 attempts at once. Each step, a few more runs go wrong, and a run that has gone wrong stays wrong. By step thirty, 27 of 60 are still on track.
This is Part 29 of AI, Built: agents and worlds. We start with history, from the first robot that planned to the first cars that drove themselves, and with how to act when you can't see everything. Then the loop every language-model agent runs, with its tools and memory. Then long horizons: why errors compound, how fast agents' horizons are growing, and how coding and computer-use agents are measured. Then imitation, and why copying an expert can have a worst-case cost bound quadratic in the task's length. Then world models, including a small Dreamer trained on this computer, and finally robots: from simulation to reality, and the models that turn pictures and words into motion.
1From Shakey to agentsUndergraduate3 min
The story of agents starts in a few rooms at the Stanford Research Institute. From 1966 to 1972, Nils Nilsson, Charles Rosen and their colleagues built Shakey, the first mobile robot that reasoned about its own actions. It looked with a television camera, planned in logic, and then moved, so slowly that its name came from how it wobbled. Its by-products outlived it: the A-star search of Part 2, the STRIPS planner, and a better way to find lines in pictures. And it fixed a pattern for decades: sense the world, build a model of it, plan, act, and sense again.
The next leap came from the desert. In March 2004, the American defence research agency DARPA offered a million dollars to any robot car that could drive about a hundred and forty miles across the Mojave on its own. None came close: the best, Carnegie Mellon's Sandstorm, went about seven miles and got stuck on an embankment. Eighteen months later, five cars finished a hundred-and-thirty-two-mile course, and Stanford's Stanley won in under seven hours. What made the difference was learning: Stanley taught itself to recognise the road far ahead in its camera images, using what its lasers measured up close as the labels. In 2007 the Urban Challenge put the cars in traffic, among stop signs and other robots; six finished, and Carnegie Mellon's Boss won. The engineers from these races went on to build today's self-driving cars.
Meanwhile robots began to learn their skills instead of having them programmed. In 1989 Dean Pomerleau's ALVINN steered a van along a road with a small neural network that copied a human driver, the idea of chapter nine. In 2016 Sergey Levine, Chelsea Finn and colleagues trained one network from camera pixels straight to motor torques, and a room of robot arms at Google learned to grasp from hundreds of thousands of attempts. In 2019 an OpenAI robot hand solved a Rubik's cube after training only in simulations it never fully trusted. And in 2022 language models began choosing what a robot should do next, while Google's RT-1, a transformer, learned seven hundred tasks from a hundred and thirty thousand demonstrations.
The newest agents grew out of language models. In 2021 OpenAI's WebGPT learned to search the web and quote what it found. In 2022 ReAct had a model alternate between thinking and acting. In 2023 models learned to call tools, from calculators to any program described in a few lines of JSON. In 2024 agents fixed real bugs in real repositories, and began to use a computer's screen and mouse; by 2025 they wrote code in a terminal for long stretches, and by 2026 for hours on end. Underneath all of it is one loop, older than Shakey: act, see what happened, decide again. The rest of this part is about that loop, in software and in the physical world.
2Acting without seeing everythingUndergraduate3 min
An agent acts in a world it can only partly see. Part 26's Markov decision process assumed the agent sees the state. Drop that, and you get a partially observable Markov decision process, a POMDP. The world still has a state, and moves on when the agent acts. But all the agent gets back is an observation, a clue, drawn from a distribution that depends on the state. Karl Johan Åström showed in 1965 what to do: keep a probability for every state, a belief, and act on that.
Here's the classic example: a robot in a corridor with a few doors, which doesn't know where it is. Its knowledge is a belief: a probability for every cell, spread evenly at first. Each step it moves right, sometimes slipping, so the belief shifts and blurs. Then it senses: door, or no door, and Bayes' rule from part five multiplies the belief by how well each cell explains what it saw. Watch the uncertainty fall as the pattern of doors gives the place away: from bits This is part seven's hidden Markov model, run forward, with the robot's own moves added.
Where did that update come from? The new belief is the probability of each state after the agent's action and the observation it got. Bayes' rule turns it around: how likely the observation is from each state, times how likely the state was before seeing it. And that prior is the old belief pushed through the transitions: the prediction. Together, with eta just making it sum to one: predict, then correct. Strip out the actions, and it is exactly the forward recursion of Part 7's hidden Markov model. With Gaussians in place of tables, it is the Kalman filter that tracks a car on a map.
The belief is more than bookkeeping. It sums up everything the agent has seen and done: nothing else in the history says more about the present. So a POMDP is an ordinary MDP whose states are beliefs, and Part 26's Bellman equation applies, over a continuum of states. That is why exact POMDPs are so hard to solve, and why the best policy sometimes acts just to learn: walk to a door, to find out where you are. Many language-model agents use a context window as working memory. It contains only the information currently supplied, and is not itself an explicit probability distribution over hidden states.
3The agent loopUndergraduate3 min
A language model only writes text. To make it an agent, put it in a loop. The context starts with a task. The model writes a thought, then an action, in a form a program can read: search for this, run that. The program carries the action out and pastes the result back into the context as an observation. The model reads everything again and writes the next thought and action, until it writes an answer. This pattern, reasoning interleaved with acting, was named ReAct by Shunyu Yao and colleagues in 2022. With one or two worked examples in the prompt, it beat agents trained by imitation and reinforcement learning on two text-based tasks.
Here is a loop running for real, in a small warehouse of our own. The tools are a few functions: list a shelf, look up a price, add. The task: what do three items cost together? The agent's moves come from a script with error rates we chose, not from a language model, so we can count what goes wrong. It looks up a price, reads the observation, keeps a running total. Here it misspells an item 2 times. The tool answers with an error, the error lands in the context, and the agent tries again. Seeing the result of every action is what lets it recover: the answer, 117, is right.
How does a model learn to use tools at all? In February 2023 Meta's Toolformer taught itself: it tried inserting calls to a calculator or a search engine into ordinary text, and kept the calls whose results made the next words easier to predict. In June 2023 OpenAI made it a product. A program describes each tool to the model with a schema: its name, what it does, its arguments. The model, fine-tuned for this, answers with a structured call instead of prose. The program runs it and hands back the result. Every agent since, coding agents included, is built on this handshake.
Every app that hosts a model needs its tools, and every tool wants to serve every app. Wired up one by one, three apps and four tools take twelve integrations. In November 2024 Anthropic published the Model Context Protocol, MCP: a tool is wrapped once, as a server that lists what it offers, and any app that speaks the protocol can use it. Three plus four instead of three times four. It spread fast. By December 2025 more than ten thousand servers had been published, and the protocol was handed to a new foundation under the Linux Foundation, alongside OpenAI's AGENTS dot md and Block's goose. Google's A2A protocol does the same for agents talking to other agents.
4Memory, and many agentsMaster's3 min
An agent's working memory is its context window, and it fills up. Every thought, action and observation of the loop adds tokens. A long task produces far more than any window holds. When it is full, something has to go. The simplest fix is to summarize: the agent writes down what it has done and what matters, empties the window, and starts again from the summary. Coding agents do this many times in a long session. Earlier, MemGPT treated memory like an operating system, paging facts in and out of the context; and even windows of a million tokens, from Part 15, have a weakness: models use what sits in the middle of a long context less well than what sits at its ends.
For memory that outlives the window, agents keep notes outside it. A memory is a short text stored with its embedding, the vectors of Part 24. To recall, the agent embeds a question and fetches the nearest notes back into its context. In 2023 Joon Sung Park and colleagues filled a simulated town with twenty-five such characters, each retrieving memories by how recent, how important and how relevant they were. Reflexion stored lessons from failures in words, and read them before trying again. And Voyager, in Minecraft, saved every skill it mastered as a program to call later, and collected three point three times as many unique items as earlier agents. Notes, lessons and skills: three kinds of memory.
When one context is not enough, use several. A lead agent plans and hands pieces of the task to subagents, each with a fresh context of its own, and each returns only a short summary, so the lead's window stays clear. Anthropic reported in 2025 that such a team beat a single agent by ninety percent on its own research evaluation. That is the company's measurement, on its own test. It also used about fifteen times the tokens of a chat, and on one public benchmark, the number of tokens spent explained eighty percent of the differences in performance. So much of the gain is simply more computation, spread out. It helps most on broad tasks that split cleanly, like research, and less on tightly coupled ones, like changing one codebase, where every agent needs to know everything.
5Compounding errorUndergraduate2 min
Agents work in long chains of steps: read a page, click, write code, run it, read the error. How many steps a task takes, from start to finish, is its horizon, and every step has to go right. If each step succeeds with probability p, a task of n steps succeeds with p to the n. At ninety percent per step, a ten-step task already fails two times in three. At ninety-nine percent, a hundred-step task succeeds only 37 percent of the time. Small errors compound.
Our warehouse agent shows where the reliability comes from. Here is how often it gets the total right, against the number of prices it has to look up. Working in its head, every slip is silent, and by sixty steps it is right only percent of the time. With tools, most errors announce themselves: a malformed call comes back as an error, and the agent simply tries again. Only the silent slips compound: percent at sixty steps. Add a check, reading back what it fetched, and most of the silent slips get caught too: percent, for calls a step. an error the loop can see is an error it can fix.
Turn it around: how long a task can an agent finish half the time? Set p to the n equal to a half, and take logarithms. When p is close to one, minus log p is almost exactly one minus p, the error rate. So the half-time horizon is about zero point seven divided by the error rate per step: at ninety-nine percent, 69 steps. In this independent-step model, halving the error rate roughly doubles that horizon. The next chapter tracks a related task-duration measure on real models, not per-step error.
6Horizons that doubleMaster's3 min
The research group METR turned the length of a task into a measuring stick for agents. Take hundreds of software and research tasks, and time skilled people doing each one: some take seconds, some take a working day. Run an agent on all of them and plot success against the human time, on a log scale. Short tasks it mostly gets, long ones mostly not. Fit a logistic curve, and read off where it crosses one half: the task length the agent finishes half the time, its fifty-percent time horizon. Part 31 looks at how this is measured in detail; here we follow what it shows about agents.
Here are METR's measurements: every model they tested, by release date, on a log scale of minutes. The first three models use earlier Time Horizon 1.0 measurements stitched into this series. GPT-2, in 2019, finished tasks of 3 seconds. GPT-4, in 2023, about 4 minutes. On a log scale the frontier climbs in a straight line, and a straight line on a log scale means a fixed doubling time. Fitting the frontier models since 2023 gives one doubling every 129 days, which is METR's own fit. Our interval resamples model rows, not METR's underlying tasks. Over the whole span since 2019, it is 188 days: the pace has quickened. The last frontier model inside METR's reliable range, Claude Opus 4.6, finishes tasks of about 12 hours half the time. These task-level horizons do not directly measure per-step error. Halving a constant failure rate doubles a horizon only under the simplified constant-hazard model.
Half the time is a low bar for work you'd hand over. METR also reports where each model's success curve crosses eighty percent. Those horizons are far shorter. Under a continuous constant-failure-rate model, with rate lambda per minute, success is exponential in time. The ratio of the two horizons would be fixed: log 2 over log one point two five, .
The ruler itself is running out. METR says its current tasks cannot reliably measure horizons above sixteen hours. Its last frontier measurement, Claude Mythos Preview (early) in April 2026, came out at about 17 hours, already past that line, and in September 2026 the page stopped being updated. And a horizon on a benchmark is not a job: METR's own trial found experienced developers slower, not faster, with early-2025 tools. Part 31 asks how far such trends can be trusted. Next, how coding agents in particular are measured.
7Coding agentsEngineering3 min
How do you test a coding agent? In 2023 Carlos Jimenez, John Yang and colleagues at Princeton built SWE-bench from the history of open-source software. Each problem is a real issue reported on GitHub, in a real repository, frozen at the moment before it was fixed. The agent must write a patch. Then the tests the real fix added are run: they must go from failing to passing, while every other test keeps passing. There were 2,294 problems from twelve Python projects. The best model of the day, Claude 2, solved under two percent of them.
The first big gains came from the interface, not the model. In 2024 the same Princeton group gave GPT-4 commands made for it: find a file, look at a hundred lines at a time, edit a range of lines, run the tests. And the environment answers compactly, refusing an edit that would break the syntax. They called it an agent-computer interface, and with the same model it solved twelve and a half percent of SWE-bench, several times more than before. That August OpenAI had developers check every problem in a subset of five hundred, keeping those that were well posed: SWE-bench Verified, the standard yardstick for two years. And by 2025 the loop had moved into developers' own terminals.
Then the yardstick wore out. Frontier models came to solve most of Verified, and in February 2026 OpenAI announced it would stop reporting it. Of a hundred and thirty-eight problems its model kept failing, its engineers judged fifty-nine percent to have tests that reject correct fixes. And given nothing but a problem's ID, three frontier models wrote out the real fix, comments included: the answers had leaked into training data. Those are OpenAI's findings. Its suggested successor was Scale AI's SWE-Bench Pro: eighteen hundred and sixty-five problems from forty-one actively maintained repositories, some held back from the public, with bigger changes to make. When it appeared in September 2025, the best models solved about a quarter of it. On Scale's leaderboard today, the top entry, Muse Spark 1.1, solves 61.5 percent of the public set, within a few points of the next.
Real engineering is more than patches. Terminal-Bench, from Stanford and the Laude Institute in 2025, drops an agent into a terminal inside a container with a job to do, like building software, configuring a server or training a model, and a script checks the result at the end. Version 2.0 had eighty-nine such tasks, and frontier agents solved less than two thirds. Benchmarks now get retired as fast as models improve: version 4.0, in 2026, dropped the tasks every model solved and gave each task up to eight hours. In September 2026 Anthropic reported sixty-six percent on it for its newest model: a company's measurement of its own model, to be checked on public leaderboards.
8Using a computerEngineering2 min
Most software was built for people, with screens and mice, not for programs. So the most general tool an agent can have is a computer of its own. The loop is the same. The observation is a screenshot. The model reads it, as pixels, and answers with an action: click at these coordinates, type this text, press that key. Then it takes another screenshot to see what happened. Anthropic released this as computer use in October 2024, and OpenAI's Operator followed in January 2025. The hardest part turned out to be the most basic: turning what it sees into exactly the right pixel to click.
To measure this, Tianbao Xie and colleagues built OSWorld in 2024: three hundred and sixty-nine real tasks in real desktop apps, from editing a spreadsheet to configuring a mail client, each checked by a script that inspects the machine afterwards. People completed seventy-two percent of them. The best model, at release, twelve. Then the companies reported their own agents: fifteen percent in October 2024, thirty-eight in January 2025, sixty-one by that September. These are the companies' numbers, with their own settings, and the benchmark itself was revised along the way, so read them as a trend.
In 2026 the same team released OSWorld 2.0, with tasks of a different size. Each of its hundred and eight workflows takes a skilled person a median of an hour and a half, and an agent around three hundred tool calls, ten times as many as before. On its leaderboard, the best agent finishes one in five outright. Anthropic reports eighty-two percent partial credit for its newest model, on its own runs. Reading the screen brings a new danger. Any web page can contain text written to look like instructions, and the agent reads it with the same eyes it reads its task. An agent that reads untrusted text while holding real permissions is a security problem, one Part 31 returns to.
9Learning by imitationUndergraduate4 min
The simplest way to teach an agent is to show it. In 1989 Dean Pomerleau's ALVINN watched the road through a small camera and learned to steer a van by copying a human driver. This is behaviour cloning: record what the expert saw and what it did, and fit a policy by ordinary supervised learning. The average is over the states the expert visits. It is how robot policies start to this day. But there is a catch. Once the learner drives, it visits its own states, not the expert's, and a small mistake takes it somewhere the expert never went.
Here is a small driving task we can solve exactly. A car drives up a lane, and each step it can steer left, go straight, or steer right, while a wind keeps pushing it to the right. Every step off the lane costs one. The expert knows exactly where the car is and steers back, so it never leaves the lane. Here are twelve of its drives. The learner sees the road through a camera that is sometimes one cell off. That noise is what makes even a perfect copy make occasional mistakes.
Behaviour cloning: give the learner the expert's drives, and for each camera reading it copies the expert's most common action. It only ever saw 5 of the 21 possible readings, the ones near the middle of the road, because those are the only places the expert goes. Now let it drive. Most of the time it copies well: on the expert's own states it chooses differently only 8.5 percent of the time. But one gust at the wrong moment, a misread camera, and it is off the lane, in readings it never saw, and there it has no idea what to do. Of these twelve drives, 5 end off the lane.
How bad can this get? Let epsilon be the learner's error rate, measured on the states the expert visits: exactly what supervised learning makes small. The chance it has made no mistake in the first t steps is at least one minus the sum of the error rates so far: a union bound. Until its first mistake, the learner is exactly where the expert would be. After it, the worst it can do is pay the full cost every step. Add that up over a task of T steps. Each inner sum is at most T epsilon, so the extra cost is at most T squared epsilon. Stéphane Ross and Drew Bagnell proved this in 2010, and showed tasks where it is reached under their assumptions. This is a worst-case upper bound, not a prediction for every task.
Here is our learner's expected cost, computed exactly, for every horizon up to four hundred steps, over eight seeds. The bound, T squared epsilon, recomputed at each horizon and ending at , is a worst-case upper bound. If errors simply added up, the cost would follow T epsilon.
10DAggerMaster's3 min
The cure, from Stéphane Ross, Geoff Gordon and Drew Bagnell in 2011, is to ask the expert about the learner's own mistakes. Let the learner drive. Afterwards, the expert labels every state the learner visited: here is what I would have done. Add those labels to everything collected so far, retrain, and drive again. They called it DAgger, for dataset aggregation. Each round, the data moves towards the states the learner actually reaches, including the ones off the road.
Here is DAgger on our lane, round by round. Round one is an expert drive, so the learner knows only the middle of the road. In the next rounds it drives itself, wanders off, and the expert labels the readings it saw out there: steer back. Grey arrows turn into real ones. By round 4 its expected cost over 400 steps has fallen from 345 to 84, and the later rounds keep it there.
Why does this fix the T squared? The trick is to treat the rounds as an online learning game. Now the error that matters is measured on the learner's own states, the ones its own policies visit. With a no-regret online learner and suitable loss assumptions, average loss approaches the best fixed policy in hindsight. Retraining alone does not guarantee this. And the cost then grows only linearly with the horizon, times u, how much one wrong action can cost later, if the task lets you recover. The difference is where the errors are counted.
Now the fair comparison: the same number of expert labels for both, eight seeds each. Its cost grows more nearly in a straight line, a log-log slope of over the first steps against . The spread across seeds is wide, steps for DAgger, because which readings a learner happens to see matters.
DAgger has a price: an expert on call to label the learner's states. A person cannot easily say, after the fact, how they would have steered at every moment of someone else's drive. So practical versions let the human take over only when the learner goes wrong, and train on the corrections. When the expert is a program, it is easy, and the idea is everywhere: Part 27's on-policy distillation, where the teacher grades the student's own answers, is DAgger for language models. The lesson: learn from where you actually end up.
11World modelsMaster's3 min
An agent that can predict the results of its actions can try things out in its head before doing them. The idea is old. Around 1990 Richard Sutton's Dyna learned a model of the world and practised in it between real steps, and Jürgen Schmidhuber built recurrent networks that modelled their world. In 2018 David Ha and Schmidhuber made it vivid. A variational autoencoder squeezes each frame of a game, a recurrent network learns to predict the next squeezed frame, and a tiny controller acts on both. It was the first to score over nine hundred at a car-racing game from pixels, and in VizDoom it was trained entirely inside its own dream. MuZero, in Part 26, went the other way: a model of only what planning needs, never the pixels.
To plan, an agent needs to predict what its actions will do. A world model learns that from experience. Ours watches a ball bouncing in a box. It squeezes each frame into eight numbers, learns how those numbers change from one frame to the next, and can turn numbers back into a picture.
How does a world model learn to dream? Here it is at checkpoints during training, each time given the same two opening frames and left to imagine the next twelve, every frame built on its own last guess. Untrained, its brightest pixel is : a haze, nothing like a ball. The final model carries the ball through of the frames, though small errors still add up: after twelve imagined frames, its ball is pixels from the real one.
Now let it imagine. Give it two real frames and let it run on its own predictions, step after step, while the real ball keeps going. For a while, imagination and reality move together: one step ahead it's 0.1 pixels off. Then small errors compound, like the long tasks of the last chapter: 4.9 pixels off after twenty steps. Agents like Dreamer learn by practising inside such imagined worlds, and Genie generates whole playable worlds from video.
12Dreamer: learning inside a dreamMaster's4 min
Our bouncing-ball model only predicted. Danijar Hafner's Dreamer agents, from 2019 on, learn a world model and then learn to act entirely inside it. Its core is a recurrent state-space model. A recurrent network carries a deterministic memory h from step to step, updated with each action. Beside it sits a stochastic state z, here eight categorical variables. From the memory alone, the prior guesses z without looking at the picture. When there is a picture, the posterior looks at it and corrects the guess. From h and z the model redraws the picture and predicts the reward. DreamerV3, in 2023, ran with one fixed set of settings across more than a hundred and fifty tasks, and was the first to collect diamonds in Minecraft without human data.
It learns from three terms. Redraw each picture from the state. Predict each reward. And make the prior agree with the posterior, so that the model can predict without looking: that is what lets it dream. The agreement is a KL divergence, and DreamerV2 split it in two. One part, with the posterior frozen, trains the prior towards what was seen. The other, with the prior frozen, nudges the posterior towards states the prior can predict. Weighting the first more, the prior moves more: KL balancing. Below one nat, the clamped KL term has zero gradient. This reduces pressure to collapse, but does not guarantee the posterior keeps useful information.
Does balancing matter? We trained just the world model of our small game both ways, three seeds each, with the same total weight on the KL, and let each dream thirty steps ahead from six real frames, counting the pixels it gets wrong.
A second trick from DreamerV3 lets one set of settings work everywhere. Rewards in one game are around one, in another around a thousand, and a squared error is dominated by the largest. So V3 predicts the symmetric logarithm of the reward and undoes it afterwards: close to the identity near zero, logarithmic far away. We trained one small network to predict the rewards of four games whose scales differ a thousandfold. Our Dreamer predicts its rewards this way, as a distribution over bins in symlog space.
Then the agent learns to act without touching the real game. From states the model has seen, it dreams 15 steps ahead, choosing actions with the current policy, rewards predicted by the model. The return of each dream mixes the rewards it dreamed with a critic's estimate of what comes after, a lambda-return. The policy follows Part 26's REINFORCE, with the critic as baseline, scaled by the spread of the returns, plus a little entropy. The critic learns the dreamed returns. The real game is only used to collect more experience for the model.
Here is our Dreamer-lite learning the game of catch. At each checkpoint it watches the same six real frames, then dreams on, given the same actions as reality. Untrained, its dreams have nothing to do with the game. As it trains, the dreams come to match reality, Errors still creep in the longer it dreams, as in chapter eleven, and a new ball, which appears at a random place, can never be dreamed exactly.
And the policy, trained only in those dreams, is tested in the real game. On the right, one of its real games at the end:
13Worlds you can walk throughResearch3 min
Our world models learned from frames paired with the actions that caused them. The Internet is full of video, but almost none of it records which buttons were pressed. Genie, from Google DeepMind in 2024, learned the actions too. A latent action model looks at two consecutive frames and must explain the change with one of just eight codes, as if guessing which button was pressed. A dynamics model learns to draw the next frame from the past frames and a code. At play time a person picks the codes, and a video model becomes a game you can steer, learned from game videos with no labels at all.
Then the worlds grew. Genie 2, in December 2024, made three-dimensional worlds from a single picture. Genie 3, in August 2025, drew them at seven hundred and twenty lines, twenty-four frames a second, in real time, and kept them consistent for a few minutes: walk away from a wall and come back, and what you painted on it is still there. Text could change the world as you went, and DeepMind used it to train its SIMA agent. In January 2026 a prototype opened to some subscribers. And on the twenty-seventh of October 2026, DeepMind announced Genie 4, with sound generated alongside the picture and pitched as a place to train robots; by DeepMind's own account, objects can still drift over long sessions.
Danijar Hafner's Dreamer line, the subject of the last chapter, reached the same scale. Dreamer 4, in 2025, learned a world model mostly from Minecraft videos, only a small part of them labelled with actions, then trained an agent entirely inside it, and that agent collected diamonds, a task of more than twenty thousand mouse and keyboard actions, without ever playing the real game during training.
All of these predict pixels: every leaf and every ripple, most of which an agent doesn't need. Part 24's joint-embedding predictive architectures predict an embedding instead, only what the encoder finds worth predicting. Meta's V-JEPA 2 turned this into a world model for a robot. After pretraining on a million hours of video, sixty-two hours of robot video taught it how the arm's actions change what it sees. To act, it imagines many action sequences in embedding space and carries out the one whose predicted embedding comes closest to a picture of the goal. With that, it picked up and placed objects in labs it had never seen. Planning with a learned model, as in MuZero, but the model is learned from video.
14From simulation to realityEngineering3 min
Robots learn slowly in the real world: one robot, one attempt at a time, wearing out and falling over. So most robot learning starts in simulation. A simulator can run thousands of robots at once, faster than real time, with nothing to break and the true state always known. In 2021 and 2022 NVIDIA's Isaac Gym ran thousands of legged robots in parallel on one graphics card, and taught them to walk in minutes. The catch is the reality gap. The simulator's physics are written by people, and wrong in small ways: friction, masses, motor strength, the delay between sensing and acting, the noise in every sensor. A policy that exploits the simulator's quirks fails on the real machine.
The fix is counterintuitive: make the simulator worse on purpose. Don't train in one simulator. Train in many, each with its own settings, drawn afresh every episode: different masses, different friction, a slower motor, a delay. A policy that works across many settings may be less dependent on one simulator's quirks. Covering the real world can help it transfer, but does not guarantee success. Josh Tobin and colleagues did this for pictures in 2017, randomizing textures and lights, Xue Bin Peng and colleagues for physics in 2018, and OpenAI's robot hand solved a Rubik's cube in 2019 with randomization that widened itself as the hand improved.
Let's try it on Part 26's cart-pole. Our test cart-pole is another simulation, with a longer, heavier pole, a weaker motor, a one-step delay, and noisy sensors, all inside the range we randomize over. We train simple linear policies with the cross-entropy method, eight seeds each, with the same number of training episodes, and test every round on the simulated test system.
Here is the whole picture: how long each kind of policy balances, across pole lengths and motor strengths, each with the simulated test system's delay and noise. Those trained across randomized simulators, in percent, including the test setting. The price is a policy that is less tuned to any one machine; the gain is that it does not need to know which machine it is on.
Domain randomization is now routine. Walking and running for legged robots and humanoids are mostly trained this way, in randomized simulation, and moved to the real machine unchanged. The newest step closes the loop with the previous chapters: in October 2026 Google reported building a simulated twin of a real table from a single photo, and DeepMind pitched Genie 4 as a training ground for robots. Simulators that no one writes by hand, only learned.
15Vision-language-action modelsMaster's3 min
In chapter one we left robot learning at Google's RT-1, a transformer trained on a hundred and thirty thousand demonstrations. The next step was to borrow a mind. RT-2, in 2023, took a vision-language model trained on the web and fine-tuned it to write the robot's actions as if they were words. On objects and scenes it had never seen, it succeeded sixty-two percent of the time, against RT-1's thirty-two: knowledge from the web, turned into motion. Then twenty-one labs pooled over a million trajectories from twenty-two kinds of robot, the Open X-Embodiment dataset. On it, OpenVLA, with open weights and seven billion parameters, beat the fifty-five-billion-parameter RT-2-X by sixteen and a half points across twenty-nine tasks.
Here is what is inside a vision-language-action model. It starts from a model that already reads images and text, trained on the web. Give it camera images and an instruction, and add a way to output motion. RT-2, in 2023, wrote actions as tokens, like words. Pi-zero, in 2024, added an action expert: a small extra network attached to the vision-language model, whose only job is to output smooth arm motions. It's not one of part sixteen's mixture-of-experts experts. It generates those motions by flow matching, part twenty-one's machinery, now drawing trajectories instead of pictures.
Here is pi zero's action expert, exactly. A chunk is the next fifty actions, one second of motion. Training draws a straight line from pure noise to the true chunk, and teaches the network the velocity along that line, given what the robot sees: part twenty-one's flow matching. To act, it starts from noise and takes ten small steps along the learned velocity, and the noise becomes a motion.
Why go to the trouble of a generative model for actions? Because people demonstrate in more than one way. Here, demonstrations pass an obstacle above or below, half and half. Real demonstrations are full of such choices: which hand, which grasp, which way round.
And it doesn't act one tiny step at a time. It plans a chunk of motion, a second or so, then looks at the world again and plans the next: the belief and the world model of the earlier chapters, folded into one network that sees, thinks and moves.
16Action tokens, and robot foundation modelsEngineering4 min
RT-2 and OpenVLA wrote actions as tokens the simplest way. Take each joint's position at each time step, and round it to one of two hundred and fifty-six bins. For a seven-joint arm at fifty steps a second, that is 350 tokens for one second of motion. On our smooth training motions, 46 percent of same-joint values repeat from the previous step, and 75 percent are within one bin. Neighboring values are often similar, leaving potential redundancy across hundreds of tokens.
In January 2025 Karl Pertsch and colleagues at Physical Intelligence compressed first. Any smooth motion is a sum of cosine waves, slow ones first, and the discrete cosine transform, the one inside JPEG, lists how much of each wave you need. Smooth motion lives in the slowest few: over our motions, the first three waves carry 99.7 percent of the energy. FAST scales the coefficients, rounds them to integers, so that on this chunk only 4 of 50 are not zero, and lets byte-pair encoding, from Part 23, merge the common patterns into tokens.
How much does it save? Here is FAST on held-out motions, for a range of scales gamma: tokens per second against the error of the motion rebuilt from them. A bigger gamma keeps more detail and costs more tokens. Per-step binning sits far to the right: 350 tokens. At about the same error, FAST needs 63, 6 times fewer, and each one carries real information. Physical Intelligence reported that a policy writing FAST tokens matched their flow-matching pi zero on many tasks and trained about five times faster.
Physical Intelligence's pi zero point five, in April 2025, asked what it takes to work in a home the robot has never seen. The model first writes a subtask in words, pick up the pillow, then the motion for it, with the flow-matching expert. And it is trained on everything at once: web data, many kinds of robot, and many different homes. In the company's own ablation, in unseen homes, the full model succeeded ninety-four percent of the time; without web data, seventy-four; without other robots' data, forty-nine; without the variety of homes, thirty-one. For robots, as for language, breadth of data is what generalizes.
Since then the field has moved fast, mostly through company reports. In March 2025 Google DeepMind built Gemini Robotics on its Gemini models, and NVIDIA released an open model for humanoids. In November Physical Intelligence added learning from experience: a value function scores how each moment is going, and the policy is told to act as the good moments did. It made espresso from five thirty in the morning to eleven thirty at night. In 2026 came memory for tasks longer than ten minutes, and pi zero point seven, which can be prompted with the speed and quality wanted, or a picture of the next subgoal. This October, Google released a physical-reasoning model that plans and builds simulations, and Physical Intelligence opened its models to other robot makers. These are the companies' own results; independent benchmarks for robots are still young.
Recap, problems, and what comes nextAll tracks2 min
Let's take stock. An agent that cannot see everything acts on a belief, predicted and corrected by Bayes' rule. A language-model agent runs a loop of thoughts, actions and observations, with tools and memory around it. Over long tasks small errors compound, so reliability per step sets how far it can go, and on METR's measurements that reach has been doubling every few months. Copying an expert fails with the square of the horizon, and DAgger repairs it by learning where the learner actually goes. And robots learn in randomized simulators and from demonstrations, with generative action experts and compressed action tokens.
All of this comes back. Whether the reasoning an agent writes is really how it decides, and whether networks carry models of their world inside them, are questions for Part 30. And how to evaluate agents, keep them from gaming their rewards, and control what they can touch, is the subject of the last part.
Here are seven problems to try, from the belief update to the error of FAST's rounding. Pause here, and work through them; full solutions are in this part's notes.
Next time: inside the model. How a network stores more ideas than it has dimensions, how sparse autoencoders pull them apart, and how to trace a thought through its layers.
The best place to go deeper on the first half of this part is Thrun, Burgard and Fox's Probabilistic Robotics, and on learning to act, Sutton and Barto. Thanks for watching, and see you in Part 30.
Where it goes next. Whether an agent's written reasoning is how it decides, and whether networks carry models of their world, are questions for Part 30; how to evaluate agents, forecast their horizons, keep them from gaming rewards and control what they touch is Part 31.
Key results
The part's results in one place, for revision.
Try it
Lab 29 · Behaviour cloning against DAgger on a windy lane
An expert keeps a car in a lane against a side wind; a learner sees the offset through a noisy camera and copies the expert's steering from 400 labels, either all from the expert's drives (behaviour cloning) or mostly from its own (DAgger). Compute each learner's expected steps off the lane exactly, for 24 learners of each kind.
python -m videos.ai.labs 29
needs numpy, scipy, matplotlib · download lab29.py ·
source on GitHubexpert 0.0 expected steps off the lane in 400
error on the expert's drives, eps behaviour cloning 0.085 DAgger 0.085
expected steps off the lane in 400 behaviour cloning 70 (17 to 169) DAgger 37 (17 to 127)
behaviour cloning against its bounds at T = 400 T eps = 34 cost 70 T^2 eps = 13610
growth from T = 200 to 400 (log-log slope) behaviour cloning 1.53 DAgger 1.39
camera readings behaviour cloning never saw 16.0 of 21 on average
Both learners are about equally accurate where the expert drives, but the clone's rare errors carry it to readings it has no labels for, and there the cost compounds; DAgger asks the expert about exactly those.
The code (149 lines; it asserts its own result)
"""Lab 29: clone an expert on the film's windy lane, check the T^2 eps bound, and repair the clone with DAgger."""
import numpy as np
from videos.coursekit import labs
from explainer.ai.autodiff import Tensor, cross_entropy
TITLE = "Behaviour cloning against DAgger on a windy lane"
GOAL = ("An expert keeps a car in a lane against a side wind; a learner sees the offset through a noisy camera and "
"copies the expert's steering from 400 labels, either all from the expert's drives (behaviour cloning) or mostly "
"from its own (DAgger). Compute each learner's expected steps off the lane exactly, for 24 learners of each kind.")
TASKS = [
"Give both methods 1,600 labels instead of 400. Which one improves, and which is limited by readings it never sees?",
"Set the camera noise to 0. What is eps on the expert's drives now, and can behaviour cloning still leave the lane?",
"Run DAgger with 2 rounds of 200 labels instead of 8 rounds of 50, and compare the cost at T = 400.",
]
D, WIND, NOISE = 10, 0.3, 0.2 # the film's lane: offsets -10 .. 10, a push to the right 30% of the time
OFFS = np.arange(-D, D + 1)
S = len(OFFS)
EXPERT = np.where(OFFS >= 0, -1, 1) # steer back towards the centre; it never leaves |d| <= 1
COST = (np.abs(OFFS) >= 2).astype(float) # a step off the lane costs 1
POBS = np.zeros((S, S)) # P(camera reading | offset): one cell off either way with probability NOISE
for _i in range(S):
for _nz, _p in ((-1, NOISE / 2), (0, 1 - NOISE), (1, NOISE / 2)):
POBS[_i, min(max(_i + _nz, 0), S - 1)] += _p
def chain(table=None):
"""P[d, d'] when the learner steers by ``table[reading]`` (None: the expert, who knows d)."""
P = np.zeros((S, S))
for i in range(S):
acts = [(1.0, EXPERT[i])] if table is None else [(POBS[i, j], table[j]) for j in range(S) if POBS[i, j] > 0]
for po, a in acts:
for w, pw in ((1, WIND), (0, 1 - WIND)):
P[i, min(max(i + a + w, 0), S - 1)] += po * pw
return P
def run_exact(table, T):
"""The expected cumulative cost J(1..T) from the centre, and the offset's distribution before each step."""
P, p, ps, per = chain(table), np.eye(S)[D], [], []
for _ in range(T):
ps.append(p)
p = p @ P
per.append(p @ COST)
return np.cumsum(per), np.array(ps)
def rollout(table, T, rng):
"""A sampled drive: the camera's readings and the expert's label at each step."""
i, obs, labels = D, [], []
slips, gusts = rng.choice([-1, 0, 1], size=T, p=[NOISE / 2, 1 - NOISE, NOISE / 2]), rng.random(T) < WIND
for k in range(T):
o = min(max(i + slips[k], 0), S - 1)
obs.append(o)
labels.append((EXPERT[i] + 1) // 2) # class 0: steer left, class 1: steer right
a = EXPERT[i] if table is None else table[o]
i = min(max(i + a + gusts[k], 0), S - 1)
return obs, labels
def fit(obs, labels, init, steps=25):
"""One row of logits per camera reading, fitted by cross-entropy with the series' autodiff; the learner steers by
the larger logit. Readings it was never shown keep their initial logits: an arbitrary but fixed action."""
theta = Tensor(init.copy(), requires_grad=True)
obs, labels = np.array(obs), np.array(labels)
for _ in range(steps):
theta.grad = np.zeros_like(theta.data)
cross_entropy(theta[obs], labels).backward()
theta.data -= 20.0 * theta.grad
return np.where(theta.data[:, 1] > theta.data[:, 0], 1, -1)
def run(seed=0):
rng = np.random.default_rng(seed)
T, N, rounds, learners = 400, 400, 8, 24
J_exp, ps_exp = run_exact(None, T)
def eps(table, horizon): # the learner's error rate on the expert's own first `horizon` steps
wrong = (table[None, :] != EXPERT[:, None]).astype(float)
return float((ps_exp[:horizon] @ (POBS * wrong).sum(1)).mean())
bc, dagger, J_bc, J_da, unseen = [], [], [], [], []
for _ in range(learners):
init = 0.01 * rng.standard_normal((S, 2))
obs, labels = [], []
for _ in range(rounds): # behaviour cloning: eight drives by the expert
o, l = rollout(None, N // rounds, rng)
obs, labels = obs + o, labels + l
bc.append(fit(obs, labels, init))
unseen.append(S - len(set(obs)))
obs, labels = rollout(None, N // rounds, rng) # DAgger: one drive by the expert, then the learner drives
table = fit(obs, labels, init)
for _ in range(rounds - 1):
o, l = rollout(table, N // rounds, rng)
obs, labels = obs + o, labels + l
table = fit(obs, labels, init)
dagger.append(table)
J_bc.append(run_exact(bc[-1], T)[0])
J_da.append(run_exact(table, T)[0])
J_bc, J_da = np.array(J_bc), np.array(J_da)
e_bc = np.mean([eps(t, T) for t in bc])
e_da = np.mean([eps(t, T) for t in dagger])
m_bc, m_da = J_bc.mean(0), J_da.mean(0)
slope = lambda J: np.log(J[399] / J[199]) / np.log(2)
lab = labs.Lab()
lab.row("expert", f"{J_exp[-1]:.1f} expected steps off the lane in {T}")
lab.row("error on the expert's drives, eps", f"behaviour cloning {e_bc:.3f} DAgger {e_da:.3f}")
lab.row(f"expected steps off the lane in {T}", f"behaviour cloning {m_bc[-1]:.0f} ({J_bc[:, -1].min():.0f} to {J_bc[:, -1].max():.0f})"
f" DAgger {m_da[-1]:.0f} ({J_da[:, -1].min():.0f} to {J_da[:, -1].max():.0f})")
lab.row("behaviour cloning against its bounds at T = 400", f"T eps = {T * e_bc:.0f} cost {m_bc[-1]:.0f} T^2 eps = {T * T * e_bc:.0f}")
lab.row("growth from T = 200 to 400 (log-log slope)", f"behaviour cloning {slope(m_bc):.2f} DAgger {slope(m_da):.2f}")
lab.row("camera readings behaviour cloning never saw", f"{np.mean(unseen):.1f} of {S} on average")
lab.note = ("Both learners are about equally accurate where the expert drives, but the clone's rare errors carry it to "
"readings it has no labels for, and there the cost compounds; DAgger asks the expert about exactly those.")
assert J_exp[-1] == 0, "the expert never leaves the lane"
for table, J in zip(bc + dagger, list(J_bc) + list(J_da)):
for t in (10, 50, 200, 400):
assert J[t - 1] <= t * t * eps(table, t) + 1e-9, "Ross and Bagnell's bound J <= J* + T^2 eps"
assert m_bc[-1] > 1.5 * T * e_bc, "the clone's cost is well above T eps: errors compound"
assert m_da[-1] < 0.9 * m_bc[-1], "DAgger leaves the lane less with the same number of labels"
fig, ax = labs.figure(2, size=(11, 4.2))
t = np.arange(1, T + 1)
for J in J_bc:
ax[0].loglog(t, np.maximum(J, 1e-3), color=labs.RED, alpha=0.25, lw=1)
for J in J_da:
ax[0].loglog(t, np.maximum(J, 1e-3), color=labs.GREEN, alpha=0.25, lw=1)
ax[0].loglog(t, m_bc, color=labs.RED, lw=2.4, label="behaviour cloning (mean of 24)")
ax[0].loglog(t, m_da, color=labs.GREEN, lw=2.4, label="DAgger (mean of 24)")
ax[0].loglog(t, t ** 2 * e_bc, color=labs.MUTED, ls="--", label=r"$T^2\varepsilon$")
ax[0].loglog(t, t * e_bc, color=labs.MUTED, ls=":", label=r"$T\varepsilon$")
ax[0].set(title="Expected steps off the lane by time T", xlabel="horizon T", ylabel="steps off the lane",
ylim=(1e-2, 3 * T), xlim=(1, T))
ax[0].legend(loc="upper left")
occ = lambda tables: np.mean([run_exact(tb, T)[1].mean(0) for tb in tables], 0)
w = 0.3
ax[1].bar(OFFS - w, ps_exp.mean(0), w, color=labs.MUTED, label="expert")
ax[1].bar(OFFS, occ(bc), w, color=labs.RED, label="behaviour cloning")
ax[1].bar(OFFS + w, occ(dagger), w, color=labs.GREEN, label="DAgger")
ax[1].axvspan(-1.5, 1.5, color=labs.BLUE, alpha=0.1)
ax[1].set(title=f"Where the car spends its {T} steps (lane shaded)", xlabel="offset from the centre",
ylabel="share of time", xticks=OFFS[::2])
ax[1].legend()
lab.fig = fig
return lab
Now change it
- Give both methods 1,600 labels instead of 400. Which one improves, and which is limited by readings it never sees?
- Set the camera noise to 0. What is eps on the expert's drives now, and can behaviour cloning still leave the lane?
- Run DAgger with 2 rounds of 200 labels instead of 8 rounds of 50, and compare the cost at T = 400.
Problems, with solutions
Try each problem before opening its solution.
-
A robot is at a door with prior probability q. It senses a door (probability 0.9 at one, 0.05 elsewhere). Find the posterior, and how many consistent sightings take q = 0.1 above 0.99.
Solution
Bayes: q' = 0.9q / (0.9q + 0.05(1 − q)). In odds, each sighting multiplies by the likelihood ratio 0.9/0.05 = 18. Prior odds 1/9; after k sightings 18ᵏ/9. Two give 36 (q = 0.973), three give 648 (q = 0.9985): three sightings.
-
Show −ln p ≥ 1 − p, so n½ ≤ 0.69/(1 − p); compute it for p = 0.98.
Solution
ln x ≤ x − 1 for x > 0 (the logarithm is concave and touches its tangent at 1); put x = p. Hence n½ = ln 2/(−ln p) ≤ ln 2/(1 − p). For p = 0.98, n½ = 0.6931/0.02020 = 34.3 steps (the bound gives 34.7).
-
Prove J(π̂) ≤ J(π) + T²ε for behaviour cloning, and build a task where it is nearly reached.* — Couple the learner and the expert (same randomness). Let εₜ be the learner's error rate on the expert's distribution at step t, ε their mean. Until the first disagreement the two trajectories coincide; the probability of a disagreement by step t is at most Σ_{k≤t} εₖ (union bound). With costs in [0, 1], step t costs the learner at most the expert's cost plus that probability, so J(π̂) − J(π*) ≤ Σₜ Σ_{k≤t} εₖ ≤ T Σₖ εₖ = T²ε. Tight case: two states, "on" and "lost"; the expert never leaves "on"; the learner leaves with probability ε a step, and "lost" is absorbing with cost 1. Then J = Σₜ (1 − (1 − ε)ᵗ) ≈ T²ε/2 for Tε ≪ 1: the same order as the bound.
-
If success on a task of length t is exp(−(t/τ)ᵏ), show t₅₀/t₈₀ = (ln 2/ln 1.25)^{1/k}; find the k that gives METR's median ratio; what does k < 1 mean?
Solution
Success S at length t_S: (t_S/τ)ᵏ = −ln S, so t_S = τ(−ln S)^{1/k} and the ratio is (ln 2/ln 1.25)^{1/k} = 3.106^{1/k}. With the measured median ratio r, k = ln 3.106/ln r (r = 5.08 gives k ≈ 0.70). k < 1 is a falling hazard: the longer a task has gone well, the less likely the next minute fails — what a mix of easy and hard tasks produces, and why long tasks are less hopeless than a constant hazard implies.
-
Show symlog is odd, increasing, ≈ x near 0, and that symexp inverts it.
Solution
symlog(−x) = −sign(x) ln(1 + |x|) = −symlog(x); its derivative is 1/(1 + |x|) > 0; ln(1 + u) = u − u²/2 + …, so symlog(x) ≈ x for small x; symexp(symlog(x)) = sign(x)(e^{ln(1+|x|)} − 1) = sign(x)|x| = x.
-
With Aᵗ = (1 − τ)ε + τA, show dAᵗ/dτ = A − ε. If demonstrations are ±m with probability ½ each, the squared-error-optimal deterministic action is 0.
Solution
Differentiate the straight line. For the second part, E[(a − Y)²] = a² − 2aE[Y] + E[Y²] is minimized at a = E[Y] = 0: the mean of the two modes, the path through the obstacle. A generative policy instead samples Y.
-
The orthonormal DCT is orthogonal; show that rounding γ·DCT(a) changes the signal by an RMS error of about 1/(γ√12).
Solution
Orthogonality preserves Euclidean norms (Parseval), so the error in the signal equals the error in the coefficients. Rounding γc to an integer leaves an error roughly uniform on [−½, ½] when |γc| is large, variance 1/12; divided by γ, variance 1/(12γ²) per coefficient, so the RMS error per sample is 1/(γ√12) (0.029 at γ = 10, in the normalized units). Coefficients rounded to 0 have error |c| < 1/(2γ), usually smaller, so this is about an upper estimate.
Notes and sources
Glossary
| English | 中文 |
|---|---|
| agent, agent loop | 智能体,智能体循环 |
| partially observable Markov decision process (POMDP) | 部分可观测马尔可夫决策过程(POMDP) |
| belief, belief update, belief MDP | 信念,信念更新,信念MDP |
| observation | 观测 |
| predict, correct (filtering); Kalman filter | 预测,修正(滤波);卡尔曼滤波 |
| ReAct: thought, action, observation | ReAct:想法,动作,观测 |
| tool use, function calling, JSON schema | 工具使用,函数调用,JSON模式说明 |
| Model Context Protocol (MCP), server, host | 模型上下文协议(MCP),服务器,宿主应用 |
| context window, compaction | 上下文窗口,(总结式)压缩 |
| retrieval memory, skill library, reflection | 检索记忆,技能库,反思 |
| lead agent, subagent (multi-agent system) | 主智能体,子智能体(多智能体系统) |
| compounding error, horizon | 误差累积,时程 |
| half-time horizon n½ | 一半把握的时程n½ |
| time horizon (50%, 80%), doubling time | (百分之五十、百分之八十)时间跨度,倍增时间 |
| constant hazard, Weibull | 恒定风险,韦布尔分布 |
| SWE-bench, patch, fail-to-pass tests | SWE-bench,补丁,从失败到通过的测试 |
| agent–computer interface (ACI) | 智能体与计算机的接口(ACI) |
| contamination | (数据)污染 |
| computer use, screenshot, prompt injection | 电脑使用,截图,提示注入 |
| behaviour cloning, demonstration, expert | 行为克隆,示范,专家 |
| distribution shift; union bound | 分布偏移;联合界 |
| DAgger (dataset aggregation), no-regret learning | DAgger(数据集聚合),无悔学习 |
| world model, imagination, dream | 世界模型,想象,梦 |
| recurrent state-space model (RSSM), deterministic state, stochastic state | 循环状态空间模型(RSSM),确定性状态,随机状态 |
| prior, posterior; KL balancing; free bits | 先验,后验;KL平衡;自由比特 |
| symlog, symexp, two-hot target | 对称对数(symlog),symexp,双热目标 |
| λ-return, critic, return normalization | λ回报,评论家,回报归一化 |
| latent action model | 潜在动作模型 |
| reality gap, sim-to-real, domain randomization | 现实差距,从仿真到现实,域随机化 |
| cross-entropy method (CEM) | 交叉熵方法(CEM) |
| vision-language-action model (VLA), action expert | 视觉–语言–动作模型(VLA),动作专家 |
| action chunk, flow matching | 动作块,流匹配 |
| FAST action tokens, discrete cosine transform (DCT), byte-pair encoding (BPE) | FAST动作词元,离散余弦变换(DCT),字节对编码(BPE) |
| per-step binning | 逐步分箱 |
| robot foundation model, co-training, ablation | 机器人基础模型,联合训练,消融实验 |
Sources
Independent scientific source repair (2026-11-03)
A new source-only repair corrects checker call accounting, Dreamer diagnostic RNG isolation, landing-frame metadata and transition counts, continuous detour collisions/crossing counts, FAST's declared integer alphabet, and horizon-specific imitation bounds. Synthetic regression checks are not new experiment results. The historical measurements below and other saved numerical narration are retained for provenance (the measured warehouse narration has been updated from a separately reviewed isolated run); affected figures must not be presented as measurements of these corrected recipes until explicit regeneration and review. Legacy affected caches are rejected, and scene cache misses never launch computations implicitly. See the phase-1 acceptance scope.
Sources
Books: S. Thrun, W. Burgard & D. Fox, Probabilistic Robotics (2005); R. S. Sutton & A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed. (2018).
- History: N. J. Nilsson (ed.), Shakey the Robot, SRI Technical Note 323 (1984); S. Thrun et al., Stanley: The robot that won the DARPA Grand Challenge (2006); C. Urmson et al., Autonomous driving in urban environments: Boss and the Urban Challenge (2008); D. Pomerleau, ALVINN (1989); S. Levine, C. Finn, T. Darrell & P. Abbeel, End-to-end training of deep visuomotor policies (2016); OpenAI et al., Solving Rubik's Cube with a Robot Hand (2019).
- POMDPs: K. J. Åström, Optimal control of Markov processes with incomplete state information (1965); L. P. Kaelbling, M. L. Littman & A. R. Cassandra, Planning and acting in partially observable stochastic domains (1998).
- Agents: R. Nakano et al., WebGPT (2021); S. Yao et al., ReAct (2022); T. Schick et al., Toolformer (2023); OpenAI, Function calling (13 June 2023); J. S. Park et al., Generative Agents (2023); N. Shinn et al., Reflexion (2023); G. Wang et al., Voyager (2023); C. Packer et al., MemGPT (2023); N. F. Liu et al., Lost in the Middle (2023); Anthropic, Introducing the Model Context Protocol (25 November 2024); Linux Foundation, Agentic AI Foundation (9 December 2025); Anthropic, How we built our multi-agent research system (13 June 2025).
- Horizons and evaluations: T. Kwa et al. (METR), Measuring AI Ability to Complete Long Tasks (2025); METR, Time Horizon 1.1 (metr.org, last updated 8 September 2026; data retrieved 29 October 2026); J. Becker et al. (METR), Measuring the impact of early-2025 AI on experienced open-source developer productivity (2025); C. E. Jimenez et al., SWE-bench (ICLR 2024); J. Yang et al., SWE-agent (2024); OpenAI, Introducing SWE-bench Verified (August 2024) and Why we no longer evaluate SWE-bench Verified (23 February 2026; reported by Decrypt, 24 February 2026); X. Deng et al., SWE-Bench Pro (arXiv 2509.16941, 2025); Scale AI, SWE-Bench Pro public leaderboard (labs.scale.com, retrieved 29 October 2026); M. A. Merrill et al., Terminal-Bench (arXiv 2601.11868, 2026); tbench.ai, Terminal-Bench 4.0; T. Xie et al., OSWorld (NeurIPS 2024); OSWorld 2.0 (osworld-v2.xlang.ai, arXiv 2606.29537, 2026); Anthropic, Introducing computer use (22 October 2024), Claude Sonnet 4.5 (29 September 2025), Introducing Claude Opus 5.5 (22 September 2026); OpenAI, Computer-Using Agent (23 January 2025).
- Imitation: S. Ross & J. A. Bagnell, Efficient reductions for imitation learning (AISTATS 2010); S. Ross, G. J. Gordon & J. A. Bagnell, A reduction of imitation learning and structured prediction to no-regret online learning (AISTATS 2011); M. Kelly et al., HG-DAgger (2019).
- World models: R. S. Sutton, Dyna (1990); J. Schmidhuber, Making the world differentiable (1990); D. Ha & J. Schmidhuber, World Models (2018); D. Hafner et al., PlaNet (2019), Dreamer (2020), DreamerV2 (2021), Mastering diverse domains through world models (DreamerV3, 2023; Nature 2025); D. Hafner, W. Yan & T. Lillicrap, Training Agents Inside of Scalable World Models (Dreamer 4, arXiv 2509.24527, 2025); J. Bruce et al., Genie (2024); Google DeepMind, Genie 2 (4 December 2024), Genie 3 (5 August 2025), Project Genie (29 January 2026), Genie 4: A new generation of world simulation (27 October 2026); M. Assran et al., V-JEPA 2 (2025).
- Sim-to-real: J. Tobin et al., Domain randomization (2017); X. B. Peng et al., Sim-to-real transfer of robotic control with dynamics randomization (2018); V. Makoviychuk et al., Isaac Gym (2021); N. Rudin et al., Learning to walk in minutes (2022); Google, Gemini 4 Argon for Robotics (13 October 2026).
- VLAs: A. Brohan et al., RT-1 (2022), RT-2 (2023); Open X-Embodiment Collaboration (2023); M. J. Kim, K. Pertsch et al., OpenVLA (2024); K. Black et al., π0 (2024); K. Pertsch et al., FAST (2025); Physical Intelligence, π0.5 (22 April 2025), π*0.6 (17 November 2025), VLAs with long and short-term memory (3 March 2026), π0.7 (16 April 2026), Frontier models for every robot (13 October 2026); Gemini Robotics Team (March 2025); NVIDIA, GR00T N1 (March 2025).
About this partfrom its README
Part 29 of a thirty-one-part series on how modern AI works and how it came to be (see the series plan and the syllabus). What it takes to act over many steps in a world you only partly see: from Shakey and the DARPA races to today's coding and computer-use agents; beliefs and POMDPs; the agent loop with its tools, protocols and memory; why errors compound and how fast agents' horizons are growing; imitation learning, behaviour cloning's T²ε and DAgger; world models from Ha and Schmidhuber to Dreamer, Genie and V-JEPA; sim-to-real and domain randomization; and vision-language-action models up to π0, FAST, π0.5 and the 2026 robot foundation models. Everything that is trained here is trained on this computer, on the CPU, and replayed on screen; every other number is cited, and company claims are labelled as such.
What is computed and built
All numbers below come from python -m videos.ai.ai29.compute on this machine (Linux, CPU); the narration states
them through f-strings over the cached results, so another machine's last digits flow through to what is said.
- Hook. 0.97³⁰ = 0.40; of 60 simulated runs of a 30-step task, 27 reach the end.
- Belief (corridor, 40 cells, 4 doors). Uncertainty from 5.32 bits to 0.80 bits after 40 steps; the most likely cell is the robot's.
- Agent loop (simulated warehouse agent, 3,000 tasks per point). Effective per-step reliability fitted from success against task length: in its head 96.3% (a slip is set at 6% a step, but two slips can cancel), ReAct with tools 97.9% (theory 98%), ReAct with a check 99.3% (theory 99.4%); at 60 steps: 11%, 28% and 66% of tasks right; the check costs 1.15 calls a step.
- METR (Time Horizon 1.1, 26 models, refitted). Frontier models since 2023 within the 16-hour range (14 points): a doubling every 129 days (bootstrap 95%: 102–155; METR's own fit: 128.7); since 2019 (17 points): 188 days (METR: 187.8); 80% horizons double every 133 days; median t₅₀/t₈₀ = 5.1 against 3.1 for a constant hazard.
- Behaviour cloning against DAgger (windy lane, 400 expert labels each, 8 seeds, exact expectations). The learner's error on the expert's states ε = 0.085 for both. Expected steps off the lane in 400: BC 94 on average (seeds 17–183), DAgger 31 (17–84); expert 0. Log-log slope of J(T): BC 1.30 (steps 10–60) and 1.59 (200–400), DAgger 1.08 and 1.29. Against the label budget (50–1,600): BC 208 → 94 and flat from 200 labels on; DAgger 208 → 17. DAgger's replay (seed 0): 345 → 84 by round 4. The bound J ≤ J* + T²ε is checked for every seed at T = 10, 50, 200.
- Bouncing-ball world model. Imagined ball 0.10 px off after 1 step, 0.88 after 5, 4.9 after 20.
- Dreamer-lite (12 × 12 catch, RSSM from pixels, policy trained only in imagination, 3 seeds). All three seeds catch 100% of the balls after 4,556 steps of real play (60 rounds of 40 updates), against 29% for a random paddle.
- KL balancing (world model alone, 3 seeds each, equal total KL weight). Mean wrong pixels per dreamed frame over 30 steps: balanced 5.8, plain 5.6 — no clear difference on a world this small (balanced is better for the first few steps: 0.8 against 1.5 wrong pixels one step ahead).
- symlog (one network, four games with reward scales 1 to 1,000, 3 seeds). Relative error by game, raw squared error: 278%, 38%, 12%, 0.5%; after symlog: 1.9%, 1.0%, 1.2%, 0.9%.
- Regression against flow matching (two-way demonstrations, 400 demos, chunks of 20, 5 seeds, 60 starts each). Regression hits the obstacle 98% of the time (seeds 95–100%); flow matching 27% (17–38%), passing above 51% of the time.
- FAST (300 held-out one-second chunks of synthetic seven-joint motion). Per-step binning: 350 tokens, RMS error 0.0060 rad; 46% of tokens repeat the previous one, 75% are within one bin. FAST (BPE, 600 merges): γ = 2 → 12.4 tokens (0.108 rad), γ = 10 → 25.2 (0.029), γ = 100 → 63.4 (0.0049): at about the per-step error, 6× fewer tokens.
- Domain randomization (cart-pole, linear policies, CEM, 8 seeds each, equal episodes). Both kinds balance all 500 steps in Part 26's simulator; on the "real" cart-pole (1.7× pole, 3× pole mass, 30% weaker motor, 1.6× cart, a one-step delay, sensor noise): single-simulator policies 97 steps on average (44–283), randomized 473 (379–500). Over the robustness map (pole length 0.2–1.2 m, force 4–15 N, with delay and noise), the share of cells above 400 steps: 0% against 83%.
Chapter notes
- Many steps in a row (hook). 0.97³⁰; sixty simulated runs of a thirty-step task; the objectives.
- 1. From Shakey to agents. SRI's Shakey (1966–72; Nilsson, Rosen; A*, STRIPS, the Hough transform); the DARPA Grand Challenges (2004: no finisher, Sandstorm about 7 of ~142 miles; 2005: five finishers, Stanley under 7 hours, self-supervised road detection; 2007 Urban Challenge, Boss); ALVINN (1989), Levine et al. (2016), Dactyl (2019), SayCan and RT-1 (2022); WebGPT (2021), ReAct (2022), Toolformer and function calling (2023), SWE-agent, computer use and MCP (2024), terminal coding agents (2025).
- 2. Acting without seeing everything. POMDP definition card; Åström (1965); a robot localizing itself in a corridor of 40 cells and 4 doors, its belief predicted and corrected step by step; the belief update derived (Bayes, total probability, normalization) and shown to be Part 7's forward algorithm; the belief MDP (Kaelbling, Littman & Cassandra 1998); a language-model agent's context as its belief.
- 3. The agent loop. ReAct (Yao et al. 2022: +34 and +10 points on ALFWorld and WebShop from one or two examples); a real trace from our simulated warehouse agent (real tools, scripted model with set error rates); Toolformer (Schick et al. 2023); function calling with JSON schemas (OpenAI, June 2023); the Model Context Protocol (Anthropic, November 2024), the Agentic AI Foundation (Linux Foundation, December 2025, with AGENTS.md and goose; over 10,000 MCP servers), Google's A2A.
- 4. Memory, and many agents. The context window as working memory; compaction; MemGPT (2023); lost in the middle (Liu et al. 2023); retrieval memory with embeddings (Part 24); Generative Agents (Park et al. 2023), Reflexion (Shinn et al. 2023), Voyager (Wang et al. 2023: 3.3× unique items, milestones up to 15.3× faster); orchestrator and subagents; Anthropic's multi-agent research system (June 2025, a company report: +90.2% on an internal evaluation, ~15× the tokens of a chat, token usage explaining 80% of BrowseComp variance).
- 5. Compounding error. pⁿ; the warehouse agent in its head, with tools (errors it can see are retried), and checking its work, 3,000 simulated tasks per point, each set falling on its own pⁿ; the half-time horizon n½ = ln 2 / (−ln p) ≈ 0.69 / (1 − p), derived.
- 6. Horizons that double. METR's 50% time horizon (Kwa et al. 2025): tasks timed by people, a logistic fit per model (schematic); METR's Time Horizon 1.1 measurements, 2019–2026, refitted here (doubling time since 2023 with a bootstrap; since 2019); the 80% horizons against a constant-hazard model (t₅₀/t₈₀ = ln 2/ln 1.25 = 3.1) and their own doubling; the 16-hour reliability ceiling, Claude Mythos Preview's ~17 h, the page no longer updated (September 2026); METR's developer trial (Becker et al. 2025). Forecasting and its caveats are Part 31's.
- 7. Coding agents. SWE-bench (Jimenez et al. 2023/24: 2,294 issues, 12 repositories, Claude 2 at 1.96%), an astropy issue as the example; SWE-agent's agent–computer interface (12.5% against 3.8%); SWE-bench Verified (OpenAI, August 2024: 500 problems, GPT-4o 33.2%); OpenAI's February 2026 audit (59.4% of 138 problems flawed; contamination evidence; a company's own audit) and SWE-Bench Pro (Scale AI, September 2025: 1,865 problems, 41 repositories) with Scale's public leaderboard (retrieved 29 October 2026); Terminal-Bench (2025; 2.0: 89 tasks, under 65%; 4.0 in 2026) and Anthropic's 66.4% for Claude Opus 5.5 (September 2026, a company claim).
- 8. Using a computer. Screenshots in, mouse and keyboard out; computer use (Anthropic, October 2024) and Operator (OpenAI, January 2025); OSWorld (Xie et al. 2024: 369 tasks, people 72.36%, best model 12.24%) and the companies' reported scores since (14.9%, 38.1%, 61.4%); OSWorld 2.0 (2026: 108 workflows, median 1.6 human hours, ~318 tool calls a task, best binary score 20.6%); Anthropic's 81.8% partial credit on 2.1 (a company claim); prompt injection.
- 9. Learning by imitation. ALVINN; behaviour cloning defined; a windy lane solved exactly (the expert never leaves it; the learner sees a noisy camera); the cloned policy and the readings it never saw; its drives; the T²ε bound derived (Ross & Bagnell 2010); the measured cost against horizon, 8 seeds, against T²ε and Tε.
- 10. DAgger. The algorithm (Ross, Gordon & Bagnell 2011); DAgger replayed round by round on the lane (the learner's table filling in, its drives, its cost); the no-regret reduction and the uTε_N bound; BC against DAgger at equal numbers of expert labels (8 seeds), and against the label budget; HG-DAgger (Kelly et al. 2019) and on-policy distillation (Part 27) as DAgger.
- 11. World models. Dyna (Sutton 1990), Schmidhuber's recurrent world models, Ha & Schmidhuber (2018: V, M, C; 906 on CarRacing; VizDoom in the dream), MuZero (Part 26); a small world model trained here on a bouncing ball (encoder to 8 numbers, learned dynamics, decoder), its dreams at checkpoints during training, imagination against reality and the error growing with the horizon.
- 12. Dreamer: learning inside a dream. The RSSM (deterministic h, categorical z, prior and posterior; PlaNet, Dreamer, DreamerV2, V3 in Nature 2025); the loss derived term by term, KL balancing and free bits; KL balancing measured on our world model (3 seeds each, equal total KL weight); symlog, with a four-game regression measured; learning in imagination (λ-returns, REINFORCE with a critic baseline and return normalization, entropy); our Dreamer-lite on a 12 × 12 game of catch from pixels (3 seeds): its dreams at checkpoints against reality, its catch rate against real experience, one of its real games.
- 13. Worlds you can walk through. Genie (Bruce et al. 2024: 11B, latent actions from unlabelled platformer videos); Genie 2 (December 2024), Genie 3 (August 2025: 720p, 24 fps, minutes of consistency, a minute of visual memory, promptable events, SIMA), Project Genie (January 2026), Genie 4 (27 October 2026, Google DeepMind's description: native audio, Gemini-planned events, pitched for robots); Dreamer 4 (Hafner, Yan & Lillicrap 2025: diamonds from offline data); V-JEPA 2 and its action-conditioned planner (Assran et al. 2025; Part 24).
- 14. From simulation to reality. Isaac Gym (2021) and walking in minutes (Rudin et al. 2022); the reality gap; domain randomization defined (Tobin et al. 2017; Peng et al. 2018; OpenAI's Rubik's cube 2019); our cart-pole (Part 26's physics): linear policies trained by the cross-entropy method in one simulator against randomized ones (8 seeds each, equal episodes), tested every round on a "real" cart-pole (longer, heavier pole, weaker motor, a delay, noisy sensors); robustness maps over pole length and motor force; one episode each; learned simulators (Gemini 4 Argon for Robotics and Genie 4, October 2026, company claims).
- 15. Vision-language-action models. RT-1 (2022), RT-2 (2023: 62% against 32% on unseen objects and scenes), Open X-Embodiment (2023), OpenVLA (2024: 7B, 970k trajectories, +16.5 points over the 55B RT-2-X); the anatomy of a VLA with π0's action expert (Black et al. 2024); flow matching on action chunks, exactly; regression against flow matching on two-way demonstrations, trained here (5 seeds each); action chunks.
- 16. Action tokens, and robot foundation models. Per-step binning (RT-2, OpenVLA) and why its tokens carry little; FAST (Pertsch et al. 2025): the DCT, rounding, BPE; tokens against reconstruction error computed on held-out motions; π0-FAST (about 5× faster training, the company's report); π0.5 (April 2025) and its ablation (a company result); Gemini Robotics and GR00T N1 (March 2025); π*0.6 and Recap (November 2025); memory for VLAs (March 2026); π0.7 (April 2026); Gemini 4 Argon for Robotics and the Pi API (October 2026).
- Recap, where it comes back (Parts 30 and 31), seven problems, Part 30's teaser, references.
Running time: about 56 minutes (silent 480p build measured by tools/lecture_length.py ai29).
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- History: Shakey (1966–72), the DARPA driving challenges (2004–07), robot learning.
- POMDPs and belief.
- The agent loop: ReAct, tools, function calling, memory, multi-agent.
- Long horizons: compounding error; the METR horizon doubling (cited data, fitted); SWE-bench.
- Imitation learning: BC's O(T²ε) vs DAgger.
- World models: Ha and Schmidhuber, Dreamer (RSSM, KL balancing, symlog), Genie 1–3, JEPA world models.
- VLAs: RT-2, OpenVLA, π0's flow-matched action expert, FAST tokens, π0.5.
- Sim-to-real; domain randomization.
- Computer use and coding agents.
Computed: Dreamer-lite on a tiny environment; DAgger vs BC; FAST's DCT.
中文讲义
本讲的中文部分(与英文版对应)。
习题与解答
- 机器人在门前的先验概率是q。它感知到一扇门(在门前时概率0.9,别处0.05)。求后验概率;从q = 0.1出发,连续几次一致的观测能让它超过0.99? —— 贝叶斯法则:q' = 0.9q / (0.9q + 0.05(1 − q))。用几率表示,每次观测乘以似然比0.9/0.05 = 18。先验几率1/9,k次之后是18ᵏ/9。 两次得36(q = 0.973),三次得648(q = 0.9985):需要三次。
- 证明 −ln p ≥ 1 − p,从而 n½ ≤ 0.69/(1 − p);计算 p = 0.98 时的值。 —— 对x > 0有ln x ≤ x − 1(对数是凹函数,在1处与切线相切); 取x = p。于是 n½ = ln 2/(−ln p) ≤ ln 2/(1 − p)。p = 0.98时,n½ = 0.6931/0.02020 = 34.3步(上界是34.7)。
- 证明行为克隆满足 J(π̂) ≤ J(π) + T²ε,并构造一个几乎达到这个界的任务。* —— 让学习者和专家共用同样的随机性。设εₜ为学习者在第t步、 在专家分布上的错误率,ε为其平均。在第一次分歧之前,两条轨迹完全相同;到第t步为止出现分歧的概率至多是Σ_{k≤t} εₖ(联合界)。 代价在[0, 1]之间,所以第t步学习者的代价至多是专家的代价加上这个概率,于是 J(π̂) − J(π*) ≤ Σₜ Σ_{k≤t} εₖ ≤ TΣₖ εₖ = T²ε。 紧的例子:两个状态,“在路上”和“迷路”;专家从不离开“在路上”;学习者每步以概率ε离开,而“迷路”是吸收态,每步代价1。 于是 J = Σₜ (1 − (1 − ε)ᵗ) ≈ T²ε/2(当Tε ≪ 1):与上界同阶。
- 若长度为t的任务成功率为exp(−(t/τ)ᵏ),证明 t₅₀/t₈₀ = (ln 2/ln 1.25)^{1/k};求出给出METR中位比值的k;k < 1意味着什么? —— 成功率为S的长度满足(t_S/τ)ᵏ = −ln S,所以 t_S = τ(−ln S)^{1/k},比值为 3.106^{1/k}。测得的中位比值为r时, k = ln 3.106/ln r(r = 5.08时k ≈ 0.70)。k < 1表示风险随时间下降:任务进行得越久而没出错,下一分钟出错的可能就越小—— 这正是难易混杂的一批任务会产生的结果,也说明长任务没有恒定风险所暗示的那么无望。
- 证明symlog是奇函数、单调递增、在0附近≈x,且symexp是它的反函数。 —— symlog(−x) = −sign(x) ln(1 + |x|) = −symlog(x); 导数为1/(1 + |x|) > 0;ln(1 + u) = u − u²/2 + …,所以x很小时symlog(x) ≈ x;symexp(symlog(x)) = sign(x)(e^{ln(1+|x|)} − 1) = x。
- 设Aᵗ = (1 − τ)ε + τA,证明dAᵗ/dτ = A − ε。若示范以各½的概率为±m,证明平方误差最优的确定性动作是0。 —— 对直线求导即可。 第二问:E[(a − Y)²] = a² − 2aE[Y] + E[Y²]在a = E[Y] = 0处取最小:两个峰的平均,正是穿过障碍物的那条路。生成式策略则是对Y采样。
- 正交归一化的DCT是正交变换;证明把γ·DCT(a)取整,信号的均方根误差约为1/(γ√12)。 —— 正交变换保持欧氏范数(帕塞瓦尔), 所以信号的误差等于系数的误差。|γc|较大时,把γc取整留下的误差近似均匀分布在[−½, ½]上,方差1/12;除以γ,每个系数的方差为1/(12γ²), 所以每个样本的均方根误差为1/(γ√12)(γ = 10时为0.029,归一化单位)。被取整为0的系数误差是|c| < 1/(2γ),通常更小,所以这大致是一个上估计。
Build the film
python -m videos.ai.ai29.compute # the part's numbers, into .cache/ai29
python tools/build.py ai29 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py ai29 Hook # one chapter, silent, with a contact sheet
Scenes: videos/ai/ai29. Setup: see the course page. Source of these notes: the README and the scenes' narration.
Build it
python tools/make.py ai29 # computations, then the narrated cut in English and Chinese
python tools/make.py ai29 --silent -q l --lang en # a quick silent preview
or step by step, from the repo root:
python -m videos.ai.ai29.compute # everything missing (about an hour on a laptop CPU)
python -m videos.ai.ai29.compute --force lane # one item again
python tools/build.py ai29 # English
python tools/build.py ai29 --lang zh # Chinese
Every computation is seeded. Torch uses AI29_THREADS threads (default 2). The two long items, dreamer (three
Dreamer-lite seeds) and klbal (six world-model runs), keep each finished run in .cache/ai29/*.partial.json, so an
interrupted run resumes. No multiprocessing; nothing is downloaded. The METR measurements are written into
compute.py from METR's published data file (metr.org/assets/benchmark_results_1_1.yaml, retrieved 29 October 2026).
Part 26's cart-pole equations and drawing are reused through videos/ai/ai26/envs.py and common.py.