Learning the Stack

A robot that copies an expert makes a small slip, lands somewhere the expert never went, and drifts. At 1% error per step over 120 steps, a plain copy spends 51 steps off the lane. DAgger, which teaches recovery, spends about 1.

Pick a learner and stretch the horizon. Watch the fleet fan out or hold the lane. Then we build, piece by piece, imitation, DAgger, diffusion policies, VLAs, Gaussian splats, world models, and the safety wrapper that lets them near people.

You need what a probability is, a little Python, and "a neural network is a function with weights we fit to data". We build the rest from zero.

Lesson 15 of 15, the capstone of our follow-along of Stanford AA 274A, Principles of Robot Autonomy I. Every idea is re-taught here in our own words and devices. Previous: Lesson 14, Particle Filters.

Send a fleet of copies down the lane

Learner

120

Illustrative toy. Per-step slip chance ε = 0.01. A slipped copy never recovers; a chunked copy can slip only once per 8 steps; a DAgger copy steers back on the next step. The numbers are the expected off-lane steps per robot, computed exactly (Chapters 2 to 4).

Chapter 0

Where the Hand-Built Stack Cracks

Throw two kinds of trouble at two robots and see that each fails at something different

Over fourteen lessons we built a robot by hand. A* and RRT plan its path. PID and LQR track it. An extended Kalman filter and a particle filter tell it where it is. An occupancy grid maps the room. We derived every equation.

Now drive that robot outside. A plastic bag blows across the road. A wet street mirrors the sky. No equation we wrote has a term for either. The stack works as far as its engineer foresaw, and no further. Every corner case is a hand-written rule, and the open world never runs out of corner cases.

The frontier answers with learning: fit a piece of the stack to data instead of writing it by hand. A learned policy is a function, fitted to examples, that maps what the robot sees to what it does.

Throw trouble at two robots

The top robot runs the hand-built stack. The bottom robot runs one learned function from pixels to wheels. Pick the trouble and press Drive.

Illustrative toy with scripted outcomes. The modular detector knows the box's shape class; its hand-tuned filter has no model of a glitch burst. The learned policy saw noisy frames in training, but never an object that looks like this one.

Neither robot wins outright. Each is robust to what its design exposed it to. So the question in this lesson is never "learned or hand-built?" It is "which piece do we learn, and what do we give up?"

The failure, as symptom, measurement and fix

The symptom is a robot that passes every lab test and fails on day one outside. To measure it, log each failure and ask: did an engineer foresee this case? If not, the fix is a learned piece for that job, kept inside the stack's checks.

The road

  1. Copy the expert: behavior cloning as supervised learning.
  2. The drift: why a copy's error grows with the square of the horizon.
  3. DAgger: label the states the copy reaches, and the hero's fleet holds the lane.
  4. Diffusion and chunks: two modes without averaging, fewer decisions per task.
  5. VLAs: an image and a sentence in, motor commands out.
  6. Gaussian splats: a learned, photoreal map made of blobs.
  7. World models: plan in a learned dream, and pay for its errors.
  8. The hybrid stack: learned pieces inside a safety wrapper.
  9. The whole stack: all 15 lessons on one map.
  10. The field guide: terms, numbers, code and the credit.
What is the core weakness of the hand-built stack that motivates learning?

Chapter 1

Behavior Cloning: Copy the Expert

Feed demonstrations to a one-weight policy and watch gradient descent pull it onto the expert

Hand-tuning a controller for a hard task is slow. So watch an expert do it, and copy. A person drives the robot through the task a few hundred times with a joystick. At every instant we record what the robot saw and what the person did.

Name the parts. The observation o is what the sensors give: an image, a scan, joint angles. The action a is the command: a steering angle, a gripper close. The policy πθ (pi-theta) maps o to a, and θ is its weights. The expert's action is a* (a-star). N recorded pairs (o, a*) form the demonstration dataset.

Now the job is ordinary supervised learning, like image classification. We pick θ to make the policy's action close to the expert's on every recorded pair. This recipe is behavior cloning (BC). The loss L measures the mismatch.

Say it aloud

L of theta equals one over N, times the sum over i of the squared size of pi-theta of o-i minus a-i-star.

L(θ)
L of theta the loss: the average squared miss for weights θ. Lower is better.
1/N
one over N divide by the number of demonstration pairs N, so the loss is an average.
Σi
the sum over i add one term for each recorded pair i, from 1 to N.
πθ(oi)
pi-theta of o-i the action the policy picks for the i-th observation.
ai*
a-i-star the action the expert took for that observation: the label.
‖ · ‖2
the squared size square the miss in each action number and add them up.
In plain words

For each pair i, run the policy on o-i and subtract the expert's a-i-star. Square that miss. Average the squares over all N pairs. Gradient descent then nudges θ to shrink L.

With numbers

With made-up numbers: two pairs, (o, a*) = (2, 1) and (4, 3), and a one-weight policy πθ(o) = θo. At θ = 0 the misses are −1 and −3, so L = (1 + 9)/2 = 5. One gradient step with step size 0.05 moves θ to 0.70, and L falls to 0.10.

Train a one-weight copy

Blue dots are demonstrations. The purple line is the policy a = θo. Press Step for one gradient step, or Add demo for more data. Push the step size past 0.10 and watch it blow up.

0.05

Illustrative toy. New demos come from an expert who acts a* = 0.7o plus a small random wobble. Gradient descent diverges when the step size is more than 2 divided by the curvature of L.

Work the step. The gradient of L at θ = 0 is (2/N) times the sum of miss times o: (2/2)((−1)(2) + (−3)(4)) = −14. The step is θ ← 0 − 0.05 × (−14) = 0.70. That is also the best single weight for these two pairs: 14/20 = 0.70.

Behavior cloningReinforcement learning
You supplypairs of (observation, expert action)a reward function and room to explore
Signalevery frame labelleda score, often late
Ceilingthe expert's skillcan pass the expert
Main failuredrift off the expert's states (Chapter 2)reward hacking, slow and risky trials

The failure, as symptom, measurement and fix

The symptom is a policy whose training loss is tiny but which still fails on the robot. To measure it, score the policy on held-out demonstrations and on real rollouts. A low held-out loss with poor rollouts points to drift, the subject of the next chapter.

Behavior cloning turns "learn to act" into which kind of problem?

Chapter 2

The Drift: Why a Copy's Error Compounds

Stretch the horizon and watch the cost of a plain copy grow like a triangle's area

The expert drives in the middle of the lane. So the demonstrations hold almost no examples of "you are half in the ditch, steer back". Now the copy makes one small slip. It lands in a state the expert never visited. It has no idea what to do there, so it slips again.

This is distribution shift (also called covariate shift): the states the policy meets at run time drift away from the states it trained on. Supervised learning assumes test data looks like training data. A policy breaks that rule the moment it acts, because its own actions choose its next inputs.

Put a number on it. Call the chance of a first slip on any one step ε (epsilon). Call the number of steps in the task the horizon T. Assume the worst case: once off, the copy stays off and pays one unit of cost every step after. Call the expected total cost JBC (J-B-C).

Say it aloud

J-B-C equals the sum from t equals 1 to T of one minus one-minus-epsilon to the t, which is about epsilon T squared over 2.

JBC
J-B-C the expected number of off-lane steps for one copy over the whole task.
Σt=1..T
the sum from t equals 1 to T add one term for each step t of the task.
(1 − ε)t
one-minus-epsilon to the t the chance the copy has not slipped yet after t steps. One minus it is the chance it is off at step t.
εT2/2
epsilon T squared over 2 the shortcut when εT is small: the area of a triangle of height εT and width T.
In plain words

At each step t, find the chance the copy is already off the lane. Add those chances over all T steps. The chance climbs about ε per step, so the sum is a triangle, and its area grows with T squared.

With numbers

With ε = 0.01: at T = 30, JBC = 4.2 (shortcut 4.5). At T = 60, 15.2 (shortcut 18). Doubling T multiplied the cost by about 3.6, close to 4.

Stretch the horizon

The teal curve is the exact cost of a plain copy. The dashed line is the εT²/2 shortcut. The flat grey line is a copy that recovers. Move ε and T.

0.010
60

Exact sums of the formula above. The recovering copy pays ε per step, so εT in total. Cost can never pass T, so at large εT the curve bends away from the shortcut.

Ross and Bagnell (2010) proved the bound behind this picture: a cloned policy with per-step error ε can cost on the order of εT². The square comes from one early slip spoiling every later step.

The failure, as symptom, measurement and fix

The symptom: the copy handles short tasks and fails long ones. To measure it, plot success against task length. A drop faster than linear is the T² signature. More demos of the same kind shrink ε but keep the square. The fix is data from the states the copy reaches.

Why does a plain copy's cost grow with T squared and not with T?

Chapter 3

DAgger: Label the States the Copy Reaches

Run DAgger round by round and watch the copy learn to steer back from places the expert never went

The cause of drift is missing data: the copy visits states the expert never showed. DAgger (Dataset Aggregation; Ross, Gordon and Bagnell, 2011) collects exactly those states.

  1. Run the copy. Let the current policy drive. It drifts into states the expert never visited.
  2. Ask the expert. For each state the copy reached, the expert says what they would do there.
  3. Add and retrain. Add the new (state, expert action) pairs to the dataset. Train the policy again on all of it. Repeat.

The states come from the copy. The labels come from the expert. After a few rounds the dataset covers the recovery states, so the training states match the run-time states. The analysis then gives a cost that grows like εT, linear in the horizon, when the expert can recover from small mistakes.

Run DAgger, one round at a time

Round 0 is plain cloning on expert demos. Press Run a round: 20 copies drive, the expert labels where they went, and the purple region of known offsets grows.

Illustrative toy: 20 robots, 60 steps, slip chance 0.05 per step, each slip a 0.45 m kick. The policy steers back only from offsets that hold at least 40 labelled states in their 0.1 m bin.

Work the toy's numbers. Round 0 holds 400 expert pairs, all within 0.2 m of the lane. Its 20 copies spend 69% of their steps more than 0.5 m off it. Round 1 adds the 1,200 states they visited, with the expert's labels. Now the policy knows the offsets where slips land, and off-lane time falls to 11%. Round 2 takes it to 0%.

python
D = collect_expert_demos()                  # round 0: plain behavior cloning
policy = train(D)
for i in range(n_rounds):
    states = rollout(policy)                 # 1. the COPY drives and drifts
    labels = [expert(s) for s in states]    # 2. the EXPERT labels those states
    D = D + list(zip(states, labels))        # 3. aggregate
    policy = train(D)                        #    and retrain on everything

The failure, as symptom, measurement and fix

The symptom is a DAgger run that stalls because nobody can label fast enough. Measure the labels each round takes from the expert. The fix is to label less: in HG-DAgger the human takes over only when the robot goes wrong, and those takeovers are the labels.

In DAgger, where do the new training states come from?

Chapter 4

Diffusion Policies and Action Chunks

Denoise a random action into one valid choice, then see why fewer decisions mean less drift

A robot arm meets a cup in its way. In half the demos the person went left of it, in half right. A policy trained with squared error predicts the average: straight into the cup. This is mode averaging, where a mode is one good choice among several.

A diffusion policy (Chi and colleagues, 2023) avoids it. It does not predict the action in one shot. It starts from a random action and removes noise step by step, and each start can settle into a different mode. Call the noisy action at noise level k ak. A network predicts the noise in it, ε̂θ (epsilon-hat), given the observation o.

Say it aloud

a-k-minus-one equals a-k minus alpha times epsilon-hat-theta of a-k, o and k.

ak−1
a-k-minus-one the action after one denoising step: a little cleaner.
ak
a-k the current noisy guess at noise level k. At the start it is pure noise.
α
alpha the step size: what share of the predicted noise to remove now.
ε̂θ(·)
epsilon-hat-theta the network's estimate of the noise in a-k, given the observation o and the level k.
In plain words

Ask the network how much noise is in the guess a-k. Remove the share alpha of it. Repeat K times, from noisy to clean. Training is the mirror: add known noise to an expert action and teach the network to predict it.

With numbers

With made-up numbers: the clean action is 0.50, the start a3 = 0.90, α = 0.5, and the network predicts the true gap. Steps give 0.70, 0.60, then 0.55. Each step halves the gap. A real sampler also rescales and adds a little fresh noise.

Average the modes, or pick one

The two warm marks are valid expert actions. Choose a head and press Sample several times. Lower the denoising steps to see an unfinished action.

5

Illustrative 2D action plane. The stand-in denoiser points at the nearer valid action with α = 0.5, so the gap halves on each step, as in the worked numbers.

The second idea is the action chunk: predict the next H actions at once and run them before deciding again. ACT (Zhao and colleagues, 2023) used chunks of 100 steps at 50 Hz. Fewer decisions mean fewer chances to slip.

Say it aloud

J-chunk is about epsilon T squared over two H.

Jchunk
J-chunk expected off-lane steps when the policy decides once per chunk.
ε
epsilon the chance one decision slips. We assume a chunk decision slips as often as a single step: an optimistic assumption.
T2
T squared the horizon in steps, squared.
2H
two H H is the chunk length in steps, so there are T/H decisions.
In plain words

With T/H decisions instead of T, the triangle of slips has T/H rows. Each slip still spoils the H steps of every later chunk. The cost falls by a factor of H.

With numbers

With made-up numbers: ε = 0.001, T = 240, H = 8. One decision per step costs about 0.001 × 57,600 / 2 = 28.8 steps. Chunks of 8 cost about 28.8 / 8 = 3.6 steps.

The failure, as symptom, measurement and fix

The symptom is a chunked arm that keeps moving after a person bumps the cup: it runs the chunk open loop. Measure the reaction delay, which is up to H steps. The fix is shorter chunks or blending overlapping chunks, as ACT's temporal ensembling does.

Why does a diffusion head beat a squared-error head when demos go both left and right?

Chapter 5

Vision-Language-Action Models

Turn a motor speed into a token and back, and measure what the rounding costs

A diffusion policy trained on one task does one task. We want a robot that hears "put the cup in the sink" today and "fold the towel" tomorrow. A vision-language-action model (VLA) takes a camera image and a sentence and outputs robot actions.

The bet: a vision-language model (VLM), trained on web images and text, already knows what a cup and a sink are. A VLA starts from such a model and teaches it to output actions too. Then robot data goes further, because the meaning of "mug" comes from the web.

ModelBackboneAction output
RT-2 (2023)PaLI-X 55B or PaLM-E 12B, co-trained on web and robot data256 bins per action number, each bin a token
OpenVLA (2024)Llama 2 7B with DINOv2 and SigLIP image encoders; 970k robot episodes256 bins over the 1st to 99th percentile of each action number
π0 (2024)PaliGemma 3B plus a separate action expertcontinuous chunks of 50 actions by flow matching, up to 50 Hz

How does a speed become a word? Cut the range of one action number into equal bins and give each bin a token. Call the speed v, its range lo to hi, and the bin index b.

Say it aloud

b equals the floor of v minus lo over hi minus lo, times 256.

b
b the bin index, 0 to 255. The model emits the token for b.
(v − lo)/(hi − lo)
v minus lo over hi minus lo where v sits in its range, as a share from 0 to 1.
256
256 the number of bins, as in RT-2 and OpenVLA.
⌊ ⌋
the floor of round down to a whole number. A value of exactly hi goes in bin 255.
In plain words

Find where v sits between lo and hi. Multiply by 256 and round down: that is b. To decode, take the centre of bin b. The rounding error is at most half a bin.

With numbers

With made-up numbers: v = 0.30 m/s in a range of −1 to 1. (1.30 / 2) × 256 = 166.4, so b = 166. The centre of bin 166 is −1 + 166.5 × 2/256 = 0.3008 m/s. The worst case is half a bin: 0.0039 m/s.

Turn a speed into a token

Slide the speed and watch which bin it falls in and what decodes back. Fewer bins mean a coarser robot.

0.30 m/s

Uniform bins over −1 to 1 m/s, illustrative. OpenVLA sets each range from the 1st and 99th percentiles of the training actions, so rare extremes do not stretch the bins.

A 7-number action becomes 7 tokens, emitted one at a time. That is slow, and 256 steps per number is coarse for fine motion. π0 instead attaches a small network that outputs a whole chunk of continuous actions with flow matching, a close relative of diffusion.

The failure, as symptom, measurement and fix

The symptom is a VLA that grasps a new mug in the lab and misses on a table 5 cm higher. Measure success while you change one physical factor at a time. Meaning transfers from the web; physical skill needs robot data from that setting.

A VLA was trained to grasp apples. Why can it often grasp a banana?

Chapter 6

3D Gaussian Splatting: A Map Made of Blobs

Move a pixel through three overlapping blobs and watch the front one hide the rest

Lesson 12 stored the room as a grid of free or full cells. 3D Gaussian splatting (3DGS; Kerbl and colleagues, 2023) stores it as millions of soft, coloured, see-through blobs fitted to photos.

Each blob, or splat, has four parts: a centre μ (mu), a shape Σ (Sigma, a 3 by 3 covariance), a colour c and an opacity α. The renderer projects the splats onto the image and sorts them front to back. Take a round splat on the image, with spread σ (sigma). Call the distance from its centre to a pixel d. Its weight at that pixel is w.

Say it aloud

w equals alpha times e to the minus d squared over two sigma squared.

w
w how strongly this splat paints this pixel, from 0 to α.
α
alpha the splat's opacity: 1 is solid, 0 is invisible.
exp(−d2/2σ2)
e to the minus d squared over two sigma squared the bell curve: 1 at the centre, fading with distance d. A larger spread σ fades slower.
In plain words

Measure the distance d from the splat's centre to the pixel. Feed it through the bell curve. Multiply by the opacity alpha. That is the splat's weight w at this pixel.

With numbers

With made-up numbers: centre (10, 10), pixel (12, 10), so d = 2. With σ = 3 and α = 0.8: exp(−4/18) = 0.80, so w = 0.64.

Many splats cover one pixel. The front one paints first and blocks part of the light. Call the light that still gets through to splat i its transmittance Ti. The pixel colour is C.

Say it aloud

C equals the sum over i of c-i times w-i times T-i, where T-i is the product over j less than i of one minus w-j.

C
C the final colour of the pixel.
Σi
the sum over i add one term per splat, front to back.
ci
c-i the colour of splat i.
wi
w-i splat i's weight at this pixel, from the equation above.
Ti
T-i the share of light not yet blocked by the splats in front of i.
Πj<i
the product over j less than i multiply one factor for each splat j in front of i.
In plain words

Start with all the light, T = 1. For each splat, front to back, paint c-i times w-i times T. Then shrink T by the factor one minus w-i. Every step is smooth, so gradients reach every splat.

With numbers

With made-up numbers: weights 0.48, 0.35 and 0.81, front to back. The front splat paints 0.48 and leaves T = 0.52. The middle paints 0.35 × 0.52 = 0.18 and leaves 0.34. The back paints 0.81 × 0.34 = 0.27. Only 6% of the light passes.

Probe one pixel

Drag the crosshair across the splats. The bars show what each splat paints there, front first. Raise the front opacity and watch it hide the others.

0.60
1.00×

Illustrative 2D splats in one colour role (the robot's map). Real 3DGS projects 3D ellipsoids, uses view-dependent colour, and blends millions of splats per frame.

Training starts from the sparse points of structure from motion (Lesson 9). It renders a view, compares it to the photo, and lets gradients adjust every splat. It splits splats where detail is missing and prunes ones that fade out. At 1080p it rendered the paper's scenes at roughly 90 to 135 frames per second. NeRF-style methods of equal quality took seconds per frame.

The failure, as symptom, measurement and fix

The symptom is floating fog in a new view far from the training photos. Measure image error on held-out views from new angles. The fix is more photos from those angles. A splat map is only sure where the cameras looked.

What makes 3D Gaussian splatting trainable from photos?

Chapter 7

World Models: Plan Inside a Dream

Roll a learned model forward, act on its plan, and see the gap between dream and world

Trying actions on a real arm is slow, and a crash costs money. A world model is a learned simulator of the robot's world: given the state now and an action, it predicts the next state. With it, the robot can try thousands of plans in its head.

Predicting raw images is wasteful. The Dreamer family encodes each image into a small latent state z: a short vector that keeps what matters for the task. A learned dynamics function f steps z forward under an action a, and a reward head r̂ (r-hat) scores each imagined state. Call the imagined horizon H and the dreamed return R̂ (R-hat).

Say it aloud

z-t-plus-one equals f of z-t and a-t, and R-hat equals the sum from t equals 1 to H of r-hat of z-t.

zt+1
z-t-plus-one the imagined latent state one step later.
f
f the learned dynamics: a network fitted to real transitions.
zt
z-t the latent state now. Step 0 comes from encoding one real image.
at
a-t the action the policy tries at step t.
R̂
R-hat the dreamed return: the total predicted reward of the plan.
Σt=1..H
the sum from t equals 1 to H add one term per imagined step, up to the horizon H.
r̂(zt)
r-hat of z-t the reward the model predicts for state z-t.
In plain words

Encode one real image into z. Pick an action a, step z with f, and score the new z with r-hat. Repeat H times and add the scores. That total R-hat ranks the plan, with no real motion.

With numbers

With made-up numbers: z is the distance to the goal, f is z + 0.3a, r̂ = 1 − z², and z starts at 0.9. Three steps with a = −1 give z = 0.6, 0.3, 0.0 and rewards 0.64, 0.91, 1.00, so R̂ = 2.55.

Act on a dream

The real robot moves 0.25 per unit of action. The model believes 0.30. Choose whether the robot runs the dreamed actions blind or re-encodes a real image every step.

0.30

Illustrative 1D toy. The policy asks for a = −min(1, z / gain), so in the dream it lands on the goal. The true gain stays 0.25.

Now the real robot runs those three actions. Its true gain is 0.25, so it reaches 0.65, 0.40, then 0.15, and earns 2.40, not 2.55. The model's error added 0.05 of distance per step. Over a long dream such errors compound, so Dreamer imagines only 15 steps ahead and keeps collecting real data. DreamerV3 (Hafner and colleagues, 2023) used this to collect diamonds in Minecraft from scratch, with no human data.

The failure, as symptom, measurement and fix

The symptom is a plan that scores well in the dream and fails on the robot. Measure the gap between dreamed and real return on fresh episodes. The fix is short dreams, frequent re-encoding of real images, and more real data where the gap is large.

Why do latent world models dream in a small vector z instead of in images?

Chapter 8

The Hybrid Stack: Learned Pieces, Checked Edges

Wrap a learned policy in a shield and a monitor, and watch them catch what it gets wrong

We now have five learned parts. How much of the Lesson 1 stack should they replace? Go module by module.

ModuleHand-builtLearned replacement
PerceptionICP, feature matching (Lessons 7 to 9)learned detectors (Lesson 10), splat maps (Chapter 6)
Localization, SLAMEKF, particle filter, factor graphlearned odometry, a world model's latent state
PlanningA*, RRT, trajectory optimizationplanning in a world model (Chapter 7)
ControlPID, LQRcloned or diffusion policy (Chapters 1 to 4)
All at oncenonean end-to-end VLA (Chapter 5)

A learned policy is hard to prove safe. So wrap it. A safety filter (or shield) is a hand-built check that replaces any proposed action that would leave a certified safe set. An out-of-distribution monitor spots inputs unlike the training data and hands control to a cautious fallback. The policy proposes; the verified checks decide.

Wrap a learned policy

Raise how unusual the scene is: the policy's moves get worse. Switch the shield and the monitor on or off, then press Drive.

0.50

Illustrative toy. The policy's heading error grows with how unusual the scene is. The shield turns any step that would enter the zone along its edge. The monitor stops the robot when the scene score passes 0.7.

A concrete design: a warehouse picker. Learn perception, because shelves hold thousands of new items. Localization is an EKF on a known map. Planning is A* on the floor plan, because the robot must provably miss the racks. Grasping is a diffusion policy. A hand-built executive shields the grasp and falls back to "drop and re-approach".

Open problem (as of late 2026)Why it is hard
Robot datano web of robot actions; each demo needs a robot and a person
Physical transfernew words transfer from the web; a new table height does not
Sim to realfriction, light and noise never match; randomizing them helps
Evaluationreal trials are slow and noisy; labs test different conditions
Guaranteesno one can yet prove a large learned policy never does harm

The failure, as symptom, measurement and fix

The symptom is a shield that fires all the time, so the robot creeps. Log each override and why it fired. Many overrides on normal scenes mean the policy needs more data there, not a looser shield.

When does a modular stack with some learned blocks beat one end-to-end policy?

Chapter 9

The Whole Stack: Fifteen Lessons, One Map

Pick a module of the stack and see which lessons built it and what you can now learn inside it

Lesson 1 drew one picture: a loop of see, think and act, run by four modules and an executive. Each lesson since built one band of it. Here is the picture, filled in.

Read the finished stack

Pick a band. Its lessons light up, and the purple tag shows what this lesson can learn inside it.

Lesson numbers follow this follow-along of AA 274A. The learned tags point to chapters of this lesson.

ModuleLessonsWhat you can build
Perception7, 8, 9, 10LiDAR and ICP, camera models, RANSAC and structure from motion, learned detectors
Localization, SLAM11, 12, 13, 14factor graphs, occupancy maps, Kalman filters, particle filters
Planning3, 4, 5A* in configuration space, RRT, trajectory optimization
Control2, 6SE(2) and SE(3) transforms, wheeled models, PID and LQR
Executive1, 15the loop, the state machine, and now the shield around learned parts

Read the stack once more through this lesson. Every method here fights the same enemy, distribution shift.

DAgger labels the states a copy reaches. Chunks cut the number of decisions. VLAs borrow web data to widen what the policy has seen. World models let the robot make its own experience. The shield and the monitor catch what is left.

The failure, as symptom, measurement and fix

The symptom is a team that tunes one module while the robot fails at a boundary. Measure the data on every arrow, with units and frames, as Lesson 1 said. Most field failures sit at an interface, learned or not.

A teammate says: "Delete the classical stack and use one VLA." What is the most accurate reply?

Chapter 10

Field Guide

Keep the terms, the numbers, the code and the links onward in one place

Copy an expert and you get a policy that drifts, at a cost near εT². Label the states it reaches (DAgger) and the cost falls toward εT. Diffusion keeps several good actions apart; chunks cut decisions. VLAs add web knowledge, splats give a photoreal map, world models let the robot plan in imagination. A shield and a monitor keep it all inside the stack's checks.

TermMeaningNumber to remember
Behavior cloningL(θ) = (1/N) Σ ‖πθ(oi) − ai*‖²pairs (2, 1), (4, 3): θ = 0.70
Drift costJBC ≈ εT²/2, never above Tε = 0.01, T = 60: 15.2 steps
DAggercopy's states, expert's labels, retraincost near εT: 0.6 at T = 60
Denoising stepak−1 = ak − αε̂0.90, 0.70, 0.60, 0.55
ChunkingJchunk ≈ εT²/(2H)H = 8: 28.8 to 3.6 steps
Action tokenb = ⌊(v − lo)/(hi − lo) × 256⌋0.30 m/s: bin 166, error 0.0008
Splat weightw = α exp(−d²/2σ²)d = 2, σ = 3, α = 0.8: 0.64
CompositingC = Σ ciwiTi0.48, 0.18, 0.27; 6% passes
Dreamzt+1 = f(zt, at)dreamed 2.55, real 2.40

Checklist before a learned policy meets a person

The core, in code

python
def act(obs, state):
    a = learned_policy(obs)                  # a VLA or diffusion policy proposes
    if out_of_distribution(obs):             # monitor: unlike the training data?
        return fallback(state)               # stop, hold, hand back control
    if not safe(state, a):                   # shield: would a leave the safe set?
        return nearest_safe(state, a)        # the closest action that stays safe
    return a                                 # in distribution and safe: allow it

Keep going

Based on Stanford AA 274A, Principles of Robot Autonomy I. This page re-teaches the course's last lesson in our own words, devices and toy numbers.

We checked the model details against the papers. Imitation: Ross and Bagnell (2010); Ross, Gordon and Bagnell (2011). Policies: Chi and colleagues (2023); Zhao and colleagues (2023). VLAs: Brohan and colleagues (2023); Kim and colleagues (2024); Black and colleagues (2024). Maps and models: Kerbl and colleagues (2023); Hafner and colleagues (2023). The page is a snapshot of a fast field as of late 2026.

The takeaway. The frontier learns the stack's insides and keeps its skeleton. Every learned part fights distribution shift, and the executive from Lesson 1 now guards them all.

Now press Present or Teach and explain from memory why a copy drifts and how DAgger fixes it. Then explain a diffusion head, a chunk, an action token, a splat and a dream. Then go back to the fleet, set T to 200, and say why only one learner holds the lane.

Principles of Robot Autonomy I · Stanford AA 274A · Lesson 15: Learning the Stack
Back to Lesson 1 · Back to Gleams