Twenty-four lectures attack two hard problems and chase one objective. Tell the router what you have. It names the method family to start with, the bill it charges, and the lectures to reopen.
Pick a robot problem, or flip the switches yourself. Watch the route light up on the course map. Then we build, piece by piece, the two hard problems, the shared objective, the decision tree, the bills, and a race you can measure.
You need the course, or at least Lectures 1 to 11. This lesson connects and decides. It does not re-teach.
Lecture 25 of 25 in Introduction to Robot Learning, CMU 16-831 (Spring 2024), taught by Guanya Shi. Slides on the course lectures page. Every idea is re-taught here in our own words and devices. Previous: Lecture 24, Foundation Models in Robotics.
The routing rule is the decision tree of Chapter 4, built from the course's topic groups. The five problems are illustrative. The tree gives a starting family, not a finished system.
Chapter 0
Map each of the 24 lectures to the part of the loop it improves
A team has a robot arm and 50 recordings of a person peeling a sticker. Nothing scores a peel. Twenty-four lectures each offer a method. Which one do they open first?
This lesson answers that question. It does not re-teach the methods. It shows the two problems every method attacks and the one objective they share. Then a short tree of questions routes a problem to a method family.
Start from the loop of Lecture 1. The robot senses. Its policy, the decision rule, picks an action. The world answers with the next state. Each lecture improves one part of that loop.
Each node is one part of the loop, in its series colour. Pick a part. The chips show which lectures work on it, and the read-out links them.
The grouping of lectures by loop part is ours, built from the course's eight topic groups. Some lectures touch several parts; each sits where it does most.
The sticker team has demonstrations and no reward. So they improve the policy by copying: that is imitation learning, Lectures 5 and 6. Chapter 4 turns that judgement into a rule.
The symptom is a team that reaches for its favourite algorithm. To measure it, write down what you have: a model, demonstrations, a reward, the right to try things. The fix is to let that list pick the method.
Chapter 1
Copy an expert, slip once, and watch the copy stay lost for the rest of the run
A copied policy picks a wrong action with a small chance ε (epsilon) at each step. Supervised learning predicts ε × H bad steps over a run of H steps. A robot does worse.
The first mistake puts the robot in a state the expert never visited. This is distribution shift: the policy meets inputs unlike its training data. It has no data there, so it keeps guessing. One error becomes many.
Name the quantities before the bound. Call the expert's total cost over the run J(π*), and the copy's total cost J(π̂). Each step costs at most 1, the error rate is ε and the horizon is H steps.
J of pi-hat is at most J of pi-star plus epsilon H squared.
Take the error rate ε. Multiply by H once for the steps where a mistake can start. Multiply by H again for the steps it can last. Add that to the expert's cost J(π*).
With made-up numbers: ε = 0.002 and H = 100. The naive guess ε × H is 0.2 bad steps. The bound εH2 is 20. Double H to 200 and the bound is 80, four times as much.
Each bar is one run. Blue steps are on the expert's data. The tick is the first mistake; red steps are lost. Move ε and H, then compare the three summary bars.
Illustrative toy: once a run errs, every later step counts as lost. The expected count is the sum over steps of the chance a mistake has already happened. The bound is from Ross and Bagnell (2010).
The device counts the expected lost steps exactly. At ε = 0.002 it gives 9.5 for H = 100 and 35 for H = 200. Doubling the run more than triples the damage. Four families exist partly to fight this:
| Fix | What it does about drift | Lecture |
|---|---|---|
| DAgger | The expert labels the states the policy itself reaches. | 6 |
| Reinforcement learning | The policy trains on its own states, so it learns to recover. | 7 to 11 |
| Conservative offline RL | It distrusts actions the log never tried. | 17 |
| Online adaptation | It re-fits when the world itself moves. | 23 |
The symptom is a policy that passes tests from the expert's start states and drifts on deployment. To measure it, start from states the policy itself causes and log the error at each step. The fix is DAgger or an RL fine-tune.
Chapter 2
Price robot experience in wall-clock time, then see where each family finds more
Four of the five ingredients behind GPT transfer to robots: the transformer, the loss, the optimizer and the way it generates. The fifth, the data, does not (Lecture 1). Text already exists on the web. A robot must act out its experience, one step at a time, on hardware or in a simulator you must trust.
Name the quantities. Call the number of steps you need N, the control rate f in steps per second, and the number of robots running at once R. The wall-clock time is T.
T equals N over f times R.
Multiply the rate f by the robot count R to get the fleet's steps per second. Divide the steps you need, N, by that. The answer T assumes no breaks, no resets and no repairs.
With N = 10 million, f = 50 Hz and R = 1: T = 10,000,000 / 50 = 200,000 s, about 2.3 days. With N = 10 trillion, about the size of a large language model's text: T = 200 billion seconds, about 6,300 years.
Set how many steps you need and how many robots you run. The marker shows the wall-clock time on a ruler that grows ten times per tick.
The formula assumes nonstop collection. Real fleets lose time to resets, charging and repairs, so the true time is longer.
So every family answers one question: where does extra data come from?
| Family | Where the extra data comes from | Lecture |
|---|---|---|
| Imitation | A human expert shows the task. | 5, 6 |
| Model-based RL | Imagined runs inside a learned model. | 15, 16 |
| Offline RL | Logs you already have. | 17 |
| Exploration | Smarter choices of what to try. | 20 |
| Sim2real | A simulator, run faster than real time. | 21 |
| Foundation models | Pretraining on internet-scale data. | 24 |
The symptom is a plan that needs 50 million real steps. To measure it, price the plan in robot-days with T before you start. The fix is a data source from the table, or training in a simulator.
Chapter 3
Fix the target every method shares, then climb down the ladder of what you start with
Imitation, Q-learning, model-predictive control and offline RL look like separate subjects. They chase one target. Each produces a policy that collects as much reward as it can over time.
Name the parts. The reward at step t is r-t. A later reward counts less, by a factor γ (gamma, the discount) for each step of delay. The policy π picks the actions, and its score is J(π).
J of pi equals the expected value under pi of the sum over t of gamma to the t times r-t.
Run the policy π. Shrink each reward r-t by gamma once per step of delay, and add them: that is one run's return. Average the returns of many runs to get J(π).
With made-up numbers from Lecture 1's corridor: rewards −0.1, −0.1, −0.1, +1 and γ = 0.9. The return is −0.1 − 0.09 − 0.081 + 0.729 = 0.458. Chapter 7's code lab finds the same 0.458 as the best any policy can earn there.
What changes from rung to rung is the input. Each rung exists because the one above it assumed something you cannot always afford.
The yellow bar is the shared objective. It never changes. Pick a rung, or press the button to step down the ladder and watch which input you stop needing.
Our summary of the course's ladder. A filled dot means the rung needs the input; a ring means it can use it.
The symptom is a team that argues "imitation or RL?" as if the goals differ. To measure it, write the objective both methods serve and list the inputs each one needs. The fix is to compare inputs and costs, not goals.
Chapter 4
Ask four questions in order and let the first yes pick the starting family
Faced with a new robot problem, do not start from an algorithm. Start from what you have. Ask these questions in order. The first yes picks the family.
Set what you have. Each diamond reads yes or no. The route stops at the first yes and lights its family.
The same rule as the code lab below and the hero. All 16 combinations of the four switches route somewhere.
Order matters. A good model with a reward wins on samples, so it goes first. A reward plus the right to try is the general fallback. Offline RL sits after it because it is what remains when trying is forbidden.
A rule you can run is a rule you understand. Write it:
The symptom is "we had demos and a reward, so we ran PPO from scratch for three weeks." To measure it, count the real steps spent before the first success. The fix is to start from the demos, then fine-tune with RL.
Chapter 5
Weight what your robot can afford and watch the ranking of the four families change
No family wins on every axis. Each buys an advantage and pays for it somewhere else. Four axes matter most on a real robot:
| Axis | Imitation | Model-free RL | Model-based RL | Offline RL |
|---|---|---|---|---|
| Samples needed | Few: reuses demos | Millions of steps | Fewest: plans in the model | None new |
| Assumes | A good expert | A reward and tries | A model you can learn | A useful log |
| Safe while learning | Yes: trains offline | No: explores live | Partly: unsafe if the model is wrong | Yes: no live runs |
| Ceiling | The expert | Above the expert | High, if the model is right | Above the log, inside its support |
| Fails by | Drift off the expert's states | Sample cost, unsafe tries | Model bias | Overrating unseen actions |
Each slider says how much your robot cares about one axis. The bars add up each family's scores, weighted. Find a weighting where each family wins.
Illustrative scores from 1 to 5, read off the table above. Your own robot may score the families differently.
If a failure breaks costly hardware, weight safety, and imitation or offline RL rises. If you have a faithful simulator and must beat a human, weight the ceiling, and model-free RL in simulation rises. The chart is a budget, not a leaderboard.
The symptom is a method that wins the benchmark and breaks the robot. To measure it, score the candidates on all four axes before you build. The fix is to choose by the bill you can pay.
Chapter 6
Trace the ideas that return under new names, lecture after lecture
Step back from single algorithms and four ideas keep coming back. Spotting them turns a list of methods into one subject.
Each cell is one lecture. Pick a thread. The lit cells are the lectures where it is central. Hover or tap a cell for its title.
Our reading of where each thread is central. Most threads touch every lecture a little.
The symptom is a learner who treats the reality gap and compounding error as two unrelated bugs. To measure it, ask what data each policy trained on and what data it now sees. The fix is to name the shift, then pick the lecture that fights it.
Chapter 7
Count the reward a learner gives up while it finds the best action
A robot that only repeats its best-known action never finds a better one. A robot that keeps trying new ones wastes runs. Exploration is trying actions to learn about them. Regret is the reward you give up while you learn.
An ε-greedy learner picks the best-looking action, except on a fraction ε of tries, where it picks at random. Name the parts. The best possible average reward per try is μ* (mu-star). At try n the learner picks action a-n, whose true average reward is μ(a-n).
R-N equals the sum, for n from 1 to N, of mu-star minus mu of a-n.
At each try, subtract the true value of the picked action, μ(a-n), from the best value μ*. Add these gaps over all N tries. A learner that stops picking bad actions has a regret R-N that flattens.
With made-up numbers: two actions pay 0.6 and 0.4 on average, so μ* = 0.6. With ε = 0.1, the learner picks at random on 10% of tries and hits the bad action on half of those. Over N = 1,000 tries that is about 50 bad picks × 0.2 = 10, plus a few early mistakes; the device below measures about 18. A learner stuck on the bad action has R-N = 200.
Two actions pay 0.6 and 0.4. The red curve is the average regret of 200 learners with your ε. The grey curve is pure greedy, ε = 0. Move ε, or let it shrink over time.
Illustrative two-action bandit with coin-flip rewards, averaged over 200 seeded learners. Shrinking divides ε by 1 + n/50 at try n.
The same idea runs over whole episodes. The lab below computes the best return with value iteration (Lecture 7), then watches an ε-greedy Q-learner (Lecture 8) close the gap.
The symptom is a regret curve that keeps rising in a straight line. To measure it, take the slope over the last few hundred tries. The fix is to shrink ε over time, or explore by optimism (Lecture 19) or curiosity (Lecture 20).
Chapter 8
Race three families on a point mass, count their real steps, then break each one
Claims about bills are cheap, so measure them. A point mass starts at 0 and must stop at the target 1.0 after 10 steps. Each step moves it by the gain g times the action, with g = 0.8. Three families try:
Press Race. Then make the model wrong, or start the clone off the expert's path, and race again.
Illustrative toy. Model-free sees noise of 0.02 per step. Model-based spends 10 real steps to fit its gain. The clone's expert starts at 0. Green means within 0.1 of the target.
Model-based wins on steps because it spends compute, not robot time. Its risk lives in the model. It plans with its estimate of the gain, ĝ (g-hat). Call the target x* and the number of steps H = 10. The plan picks the constant action a = x*/(H·ĝ). The world then moves the mass by the true g.
x-H equals x-star times g over g-hat.
The plan expects each step to move g-hat times the action. The world moves g times the action. So the mass ends at the target x* scaled by g over g-hat. A perfect model, g-hat equal to g, lands exactly.
With made-up numbers: g = 0.8 and a model 30% too high, g-hat = 1.04. x-H = 1.0 × 0.8 / 1.04 = 0.77. The plan stops 23% short, and the planner believes it arrived.
Now run the race in code. The lab counts real steps for each family and tests the clone off its path.
The symptom is a planner that is confident and wrong. To measure it, compare the model's predicted end state with the real one over a few runs. The fix is to re-fit the model on new data, or plan again at every step (MPC, Lecture 13), so feedback absorbs the error.
Chapter 9
Retire five common misreads, then see how far robots are from general skill
Most misreads come from one habit. People carry an idea from a setting with no sequence and no physics into one that has both.
| Misread | Why it fails | Lecture |
|---|---|---|
| Imitation is supervised learning | Its predictions change its next input, so errors compound. | 5, 6 |
| Offline RL is imitation | Offline RL can join good pieces of different runs and beat the log, if it stays where the log has data. | 17 |
| More reward shaping always helps | The robot optimizes a wrong reward exactly: it finds the loophole. | 18, 19 |
| Learning beats classical control | With a good model, control and planning work with no learning at all. | 12 to 14 |
| A bigger model fixes the data problem | Parameters do not create experience. Data sources do. | 1, 24 |
The lecture's honest summary: robots do well on narrow tasks and are far from general skill. A system tuned for one setting stays strong only inside it. A general system gives up some peak skill to cover more ground.
Slide the diversity of tasks and rooms. The pink curve is a specialist built for one setting. The purple curve is a would-be generalist.
Illustrative curves, not measured data. The shapes follow the lecture's narrow-versus-general framing.
Three questions remain open, all downstream of the data problem:
The symptom is a demo video that fails in a new kitchen. To measure it, test on objects, rooms and lighting the training never saw. The fix today is more varied data plus adaptation; the open bet is pretraining.
Chapter 10
Keep every lecture, the numbers, a checklist and the routing rule in code
Robot learning is learning to make sequential decisions in the physical world. Errors compound and data is scarce. Every method maximizes the same return, and differs in what it starts with. Route by what you have, then pay the bill you can afford.
FOUNDATIONS: THE LOOP AND THE TOOLS
IMITATION: BORROW AN EXPERT'S DATA
MODEL-FREE RL: LEARN FROM REWARD BY TRYING
MODEL-BASED: PREDICT THE WORLD, THEN PLAN
OFFLINE DATA AND REWARDS: USE A LOG, LEARN WHAT IS GOOD
REAL-WORLD ADD-ONS: MAKE IT WORK ON A ROBOT
| Term | One line | Number to remember |
|---|---|---|
| Compounding error | Behaviour cloning's extra cost is at most εH². | ε 0.002, H 100: bound 20, not 0.2 |
| Robot time | T = N / (f · R). | 10 M steps at 50 Hz: 2.3 days |
| Objective | J(π) is the average of the sum of γt r-t. | Corridor at γ 0.9: 0.458 |
| Decision tree | Model and reward, demos without reward, reward and tries, log only. | 4 questions, 16 cases |
| Regret | R-N adds μ* − μ(a-n) over N tries. | ε 0.1, 1,000 tries: about 10 plus the start |
| Model bias | x-H = x* · g / g-hat. | g-hat 30% high: 23% short |
pythondef route(model, demos, reward, interact): if model and reward: return 'model-based' # L12-16: plan in the model if demos and not reward: return 'imitation' # L5-6: copy, then DAgger if reward and interact: return 'model-free RL' # L7-11: start from demos if you have them if not interact: return 'offline RL' # L17: learn a reward first if none (L18-19) return 'learn a reward, then explore' # L19-20
This lesson follows Lecture 25, the course summary, of CMU 16-831 Introduction to Robot Learning, Spring 2024, taught by Guanya Shi. The slides are on the lectures page. The compounding-error bound is from Ross and Bagnell (2010), restated as Theorem 2.1 of the DAgger paper. Chapters 4, 7 and 8 add devices and numbers of our own.
Now press Present or Teach and explain from memory: the two hard problems, the shared objective, the four questions and one bill per family. Then go back to the router, pick a robot problem of your own, and say which lecture you would open first.