Robot learning is learning to make sequential decisions in the physical world. Put three robots in one wind. The one that never looks misses. The one that looks stops short. The one that learns the wind arrives.
Pick a robot and drag the wind. Count the goals it reaches. Then we build, piece by piece, the loop, the reason small errors snowball, the data problem, and the language the rest of the course speaks.
You need what a probability is and a little Python. Nothing about control or reinforcement learning. We build the rest from zero.
Lecture 1 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. Next: Lecture 2, Robot Learning: An Overview.
Illustrative toy on a 1.6 m by 1 m field. A goal counts when the robot comes within 5 cm. The looking robot steers toward the goal at a gain of 2 per second. A steady wind leaves it short by wind speed divided by 2. The adaptive robot also estimates the wind from its own motion and cancels it.
Chapter 0
Find the edge of the field with one question, and watch a robot that never looks weld thin air
On the first day of CMU 16-831, the instructor asks: is a microwave a robot? It senses a button press. It heats. It stops. It never checks whether the food is hot.
A factory welding arm is the same kind of machine at a higher price. It traces one seam thousands of times a day. It runs a fixed script. This is open-loop control: the machine acts and never checks the result. Turn the part a few degrees and the script welds air.
The grey plate holds a 400 mm seam. Turn the plate, then press Weld. Switch on sensing to let the torch look at the seam before each move.
Illustrative toy. The script welds a straight line from the seam start. The 1 mm tolerance is a made-up number for the picture.
Work the number. The seam is 400 mm long and the part turns 5 degrees about the seam start. The far end moves 400 × sin 5° = 34.9 mm. The script leaves a 1 mm tolerance after 1 / sin 5° = 11.5 mm of weld. The other 388 mm of bead are scrap.
Closed-loop control senses the result before each action. The sensing torch finds the seam at every step and follows it. The ring of sense, decide, act, sense again is the object this course studies.
The symptom is a demo that works in the lab and fails on the line. To measure it, move the start: shift and turn the part, then record the error at the end. The fix is to close the loop with a sensor, then learn the parts you cannot write down.
Chapter 1
Split the definition into three properties, and place six AI systems by which ones they have
A team trains a network to pick a steering angle from one dashcam frame. It scores well on recorded video. On the road it drifts into the curb. Which part of the definition did it miss?
The lecture splits the definition into three words. Each word alone names a large area of AI. Robot learning is the corner where all three hold.
| Word | It means | Drop it and you get |
|---|---|---|
| Learning | The behaviour is data-driven and improves from data. | Search and planning, classic control, optimal control |
| Sequential | The current action changes the next state, so it changes the next decision. | Bandits, standard supervised learning |
| Physical world | The robot acts on the real world in a closed loop. This is embodied intelligence. | Reinforcement learning for games, large language models |
A bandit is a one-shot choice problem: each pull of a slot-machine arm is independent of the last. Supervised learning fits inputs to labels, and its prediction on image 5 does not change image 6.
Each circle is one word of the definition. Pick a system. Only the centre, where all three overlap, is robot learning.
The three words and their "without" lists are the lecture's (slide 16). The placement of each system follows those lists.
Back to the dashcam network. It has learning and it lives in the physical world. But it treats each frame alone, as if its steering never changed the next frame. It dropped sequential. One small steering error moves the car, the next frame looks new, and nothing in its training says how to recover. Chapter 3 puts a number on that.
The symptom is a model that scores well offline and drifts when it drives. To measure it, compare the error on recorded frames with the error on frames the model itself caused. The fix is to train and test in the loop.
Chapter 2
Name the five parts of the loop, write the two rules that join them, and push a cart through wind
A cart must sit on a line while gusts push it. The rest of the course speaks about this loop with five names. Here they are, in the order the loop runs.
Call the state at step t s-t, the observation o-t, the action a-t, and the policy π. The first rule says how the robot decides.
a-t equals pi of o-t.
Read the sensor to get o-t. Feed it to the policy pi. Send what comes out, a-t, to the motors. Do this again at every step.
With made-up numbers: the cart reads o-t = −0.4 m, left of the line. a-t = −2 × (−0.4) = 0.8 m/s, a push to the right.
The second rule says what the world does with that action. Call the world's rule f, the wind speed w-t, and the time between steps Δt.
s-t-plus-one equals f of s-t and a-t.
Take the state s-t and the action a-t. The world applies its rule f and returns the next state s-t-plus-one. That new state makes the next observation, and the loop closes.
With made-up numbers: s-t = −0.4 m, a-t = 0.8 m/s, wind w-t = 0.3 m/s, Δt = 0.1 s. s-t-plus-one = −0.4 + (0.8 + 0.3) × 0.1 = −0.29 m. The wind helped this time. The next reading shows it, so the next push is smaller.
An open-loop controller fixes all its actions at step 0 and never reads o-t again. A closed-loop controller runs the first rule at every step. With no wind they match. Add gusts and press Run.
Both carts start 1 m left of the yellow line and get the same gusts. Grey runs a plan made at the start. Teal runs a = −2o at every step. Set the wind, then press Run.
Illustrative toy. The plan drives at 0.5 m/s for 2 s, then stops. The gusts are one fixed random sequence, scaled by the slider up to 0.8 m/s.
The symptom is error that grows with time under any disturbance. To measure it, log the distance to the target over a run and compare the start with the end. The fix is feedback: compute each action from the latest observation.
Chapter 3
Copy an expert, make one small mistake, and watch the policy stay lost for the rest of the run
You record an expert driver and train a policy to copy the expert's action in each state. This is behaviour cloning, the simplest kind of imitation learning. On the expert's states the copy is good. It picks a wrong action with a small chance ε (epsilon) at each step.
Over a run of H steps, how many bad steps? Supervised learning says ε × H: with ε = 0.05 and H = 100, that is 5. The truth is far worse.
The first mistake puts the car where the expert never drove, a little too close to the curb. This is distribution shift: the policy meets states it never trained on. It is now lost, and its next actions are guesses. Say each lost step costs 1.
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.
Illustrative toy with the worst case built in: once lost, a run never recovers. The "expected" value is exact for that toy: the sum over t of 1 − (1 − ε) to the t.
Ross and Bagnell (2010) proved a ceiling on this. Name the total expected cost of a policy over H steps J, with each step's cost between 0 and 1. Call the copy π-hat and the expert π-star.
J of pi-hat is at most J of pi-star, plus epsilon times H squared.
Start from the expert's cost J of pi-star. Add epsilon times H squared. The copy's cost J of pi-hat is never above that. The extra cost grows with the square of H, not with H.
With made-up numbers: ε = 0.002 and H = 100. The naive guess is 0.002 × 100 = 0.2 bad steps. The bound allows 0.002 × 10,000 = 20. The never-recover toy expects 9.5. Double H to 200 and the bound becomes 80: four times, not two.
When ε × H is large, the bound passes H and says nothing new. The toy still shows the effect: at ε = 0.05 and H = 100, a copy spends about 81 steps lost, not 5. The first mistake comes after about 1 / ε = 20 steps, and the rest of the run is gone.
The lab below encodes the one fact that bends the curve: once lost, stay lost.
The symptom is a copy that looks fine for a while, then wanders off for good. To measure it, log the step of the first departure from the expert's states across many runs. The fix is to ask the expert for labels on the states the copy visits. That is DAgger, in Lecture 6.
Chapter 4
Check which parts of the recipe behind GPT transfer to robots, and price a dataset in robot hours
The lecture asks why GPT works and how much of that carries over to robots. It lists the recipe in five lines.
| Part | For GPT | For a robot |
|---|---|---|
| Architecture | Transformer | Transfers |
| Data | Web text, books, wikis | No such pile exists |
| Loss | Next-token prediction | Transfers in form (predict the next action) |
| Optimization | SGD | Transfers |
| Generation | Autoregressive | Transfers |
Text was already written, free to scrape, and labelled by itself: the next word is the label. Someone must act out robot data, on a real robot in real time or in a simulator you then must trust. Each robot step costs a real moment of time and some risk.
Even game reinforcement learning, such as DQN for Atari and AlphaGo, has it easier. The lecture contrasts the two.
| Games | Robots |
|---|---|
| Known and static rules | Unknown and changing world |
| One task | Many tasks |
| Clear reward: the score | Unclear goals |
| Offline learning is enough | Needs online adaptation |
| Slow moves | Fast real-time action, such as 50 Hz |
| Failures are free | Physics does not forgive |
| Discrete, digital | Continuous, physical |
How long does one dataset take? Call the number of environment steps N, the control rate f in steps per second, and the number of robots running at once R. Call the wall-clock time T.
T equals N divided by f times R.
Multiply the rate f by the number of robots R to get steps per second. Divide the steps N by that. The result T is how long the robots must run without a break.
With a made-up need of N = 10,000,000 steps, f = 50 Hz and R = 1: T = 10,000,000 / 50 = 200,000 s. That is about 55.6 hours, or 2.3 days of nonstop running. Ten robots cut it to 5.6 hours, at ten times the hardware.
The marker shows how long the robots run without a break. Set the steps, the rate and the number of robots.
The 50 Hz rate is the lecture's example (slide 20). The step counts are illustrative. Resets, charging and repairs would add time on top.
The symptom is a project that waits weeks for data. To measure it, count robot hours per experiment before you start. The fix is one of the course's later topics: simulation and Sim2Real, offline RL, learned world models, or human demonstrations.
Chapter 5
Read the lecture's four-block picture, and see where a hand-built pipeline tops out
One picture returns through the whole lecture: four blocks named algorithm, data, computation and hardware. The goal they serve is general-purpose embodied intelligence: robots that do thousands of tasks in thousands of places. The lecture's claim is one line: data raises the upper bound of algorithm, computation and hardware.
A hand-designed system has a ceiling set by its assumptions. The lecture lists where they crack:
Non-learning methods also design each module apart: perception, then planning, then control. Call each module's success rate p-1, p-2 and p-3. If one module fails, the pipeline fails. Call the pipeline's success rate p.
p equals p-one times p-two times p-three.
Every module must work. Multiply the three chances p-one, p-two and p-three. The product p is smaller than the weakest of them.
With made-up numbers: p-one = 0.95, p-two = 0.90, p-three = 0.92. p = 0.95 × 0.90 × 0.92 = 0.787. Three good modules give a pipeline that fails one try in five, and more data cannot lift it past their hand-set limits.
A learned system can train the modules together, even end to end from pixels to motor commands, so each covers the others' blind spots. The price is data. Slide the data and compare.
Pink is the hand-built pipeline. Purple is the end-to-end learned policy. Dashed lines are their ceilings. Drag the data.
Illustrative curves. The pipeline's ceiling is the product above, 0.787. The learned policy's curve is a made-up S shape with a 0.97 ceiling. The lecture makes the claim in words, not with these numbers.
The symptom is an end-to-end policy that loses to a simple pipeline. To measure it, plot success against data for both. The fix is a hybrid. Learn the parts that are hard to model, such as perception and contact. Keep classical control where the physics is good.
Chapter 6
Meet five robots with no learning at all, then break a model-based controller with a wrong model
Before the learning results, the lecture shows robots that work with no learning.
| System | Method, no learning |
|---|---|
| Apollo 11 | Trajectory optimization and control: optimal control plus robust control |
| Boston Dynamics Atlas | Trajectory optimization plus model predictive control (MPC) |
| Off-road autonomy | Sampling-based MPC |
| High-speed robot hand, Ishikawa Komuro Lab, 2009 | Fast vision and feedback |
| Tailsitter aerobatics, MIT LIDS | Trajectory generation plus nonlinear control |
The common thread is a good model of the dynamics. Model predictive control (MPC) plans a few steps ahead with that model, acts once, then plans again. With a good model, classical control is excellent. Learning earns its place where the model is unknown, changes, or cannot be written.
What does a wrong model cost? Take a cart that should reach a target position x-star. The true gain b says how far the cart moves per unit of command. The controller only has its model's guess, b-hat, and sends u = (x-star − x) / b-hat to close the whole gap in one step. The cart then moves b × u. Call the error at step t e-t.
e-t-plus-one equals one minus b over b-hat, times e-t.
The controller aims to close the gap e-t in one step, but the cart moves b over b-hat of the planned amount. What is left, e-t-plus-one, is e-t times one minus that ratio. If the factor is between minus 1 and 1, the error shrinks. If not, it grows.
With made-up numbers, b = 1 and e-0 = 1 m. A perfect model, b-hat = 1, gives a factor of 0: done in one step. With b-hat = 0.7 the factor is 1 − 1/0.7 = −0.43. The errors run 1, −0.43, 0.18: it overshoots and settles. With b-hat = 0.4 the factor is −1.5. The errors run 1, −1.5, 2.25, and the cart flies off.
Each stem is the error after one command. The green band is ±5 cm. Drag the model's guess of the gain away from the truth.
Illustrative toy: a one-step controller on a cart whose motion is exactly gain times command.
The symptom is a controller that rings or runs away after the robot picks up a load. To measure it, compare the predicted and the real motion after each command. The fix is to learn or adapt the model online. Chapter 8 does it for a wind.
Chapter 7
Install six words for sequential decisions, and add up a discounted return by hand
A robot walks a corridor of five cells. Each move costs effort. The last move reaches a charger. Is the walk worth it?
To answer, the course uses the Markov decision process (MDP). Lectures 5 and 7 teach it in full. Here are the words.
| Symbol | Name | Meaning |
|---|---|---|
| s | State | The situation now. |
| a | Action | What the robot does. |
| r(s, a) | Reward | A number that scores the action here. Bigger is better. |
| P(s′ | s, a) | Transition | The chance of each next state s-prime: the dynamics. |
| π(a | s) | Policy | The chance of each action in each state. We learn it. |
| γ | Discount | A number from 0 up to 1 that says how much later reward counts. |
The robot's aim is a large return: the sum of its rewards, with later rewards shrunk. Call the reward at step t r-t and the return G.
G equals the sum over t of gamma to the t, times r-t.
Shrink each reward r-t by gamma once for every step you waited for it. Add them up. The total is the return G.
With the corridor's made-up rewards −0.1, −0.1, −0.1, +1.0 and γ = 0.9: G = −0.1 − 0.09 − 0.081 + 0.729 = 0.458. The charger's +1.0 counts as 0.729, which is 0.9 cubed, because it comes three steps late.
Why discount? With γ below 1 an endless sum stays finite. And a reward now beats the same reward later, as a dollar today beats a dollar next year.
Outlined bars are the raw rewards. Filled bars are what each counts at step 0. Slide gamma and watch the charger's bar.
Illustrative corridor. Standing still is worth 0, so the walk pays when G is above 0. That happens for γ above about 0.58.
The symptom is an agent that refuses a task you know is worth doing. To measure it, compute G for the good plan and for doing nothing at your γ. If doing nothing wins, the fix is a larger γ or a reshaped reward.
Chapter 8
Hold the four dials of the field at once, break the robot, then let it learn the wind
The robot from the top of the page lives in an unknown, windy field and must reach a stream of goals. You now hold four dials, each from an earlier chapter:
Feedback alone fights a steady wind and still stops short: it pushes only as hard as its error, so it needs some error to push. Online adaptation removes that gap by learning the wind while it runs. The robot knows the command it sent, so the extra motion it sees is the wind. Call the robot's wind estimate d-hat, the wind effect it measured this step m, and the learning rate α (alpha).
d-hat-new equals d-hat, plus alpha times m minus d-hat.
Each step, measure the wind effect m. Find the surprise, m minus d-hat. Move d-hat a fraction alpha of the way toward m. Then subtract d-hat from the next command.
With made-up numbers: a steady wind of 0.8, α = 0.3, d-hat starting at 0. Step 1: 0 + 0.3 × 0.8 = 0.24. Step 2: 0.24 + 0.3 × 0.56 = 0.408. Step 3: 0.526. Each step closes 30% of the gap, so the estimate reaches 0.8 within about ten steps.
Press Run. Then break it: open the loop, raise the noise and the wind. Then switch adaptation on and watch the success rate recover.
Illustrative toy, the same field as the hero. In each 0.2 s window, with chance ε, the robot heads in a random direction for 0.2 s. Adaptation needs the loop closed, because it learns from what the robot senses. The update rate is α = 0.08 per step at 30 steps per second.
Try the strongest wind with adaptation off, then on. The looking robot stops short by wind divided by its gain. The adaptive robot leans into the current and arrives.
Chapter 3 returns too: with the loop open, one noisy step ruins the whole leg. With it closed, the robot corrects. This is the seed of the online adaptation work in Lecture 23. Build the update yourself:
The symptom is a steady miss in one direction, the same on every goal. To measure it, average the final error vectors: a nonzero mean is a bias the robot did not model. The fix is an online estimate of that bias, like d-hat.
Chapter 9
Keep the course map, the terms and numbers, a checklist and the core loop in code
Every topic in 16-831 answers one of two hard problems. Errors compound once the robot leaves its data (Chapter 3). Robot data is scarce (Chapter 4). The course has eight topic groups.
| Group | Topic | The question it answers |
|---|---|---|
| 1 | What robot learning is and why | What is the problem? (this lesson, Lecture 2) |
| 2 | Machine and deep learning refresher | What tools do we fit with? (Lecture 3) |
| 3 | Imitation learning | Can we borrow a human's data? (Lecture 5) |
| 4 | Model-free reinforcement learning | Can we learn from reward alone? (Lecture 7) |
| 5 | Model-based reinforcement learning | Can a learned model save data? (Lecture 12) |
| 6 | Learning from offline data | Can we use a fixed log? (Lecture 17) |
| 7 | Bandits, preferences, exploration | What should we try next? (Lecture 19) |
| 8 | Specialized topics | Does it work on a real robot? (Lecture 21) |
| Term | One line | Number to remember |
|---|---|---|
| Robot learning | Learning + sequential + physical world, all three. | 3 of 3 |
| Closed loop | a-t = π(o-t) at every step; s-t+1 = f(s-t, a-t). | Cart: −0.4 m to −0.29 m in one step |
| Compounding error | Behaviour cloning's extra cost is at most εH². | ε 0.05, H 100: about 81 lost steps, not 5 |
| Data cost | T = N / (f · R). | 10M steps at 50 Hz: 2.3 days |
| Pipeline ceiling | p = p-1 · p-2 · p-3. | 0.95 · 0.90 · 0.92 = 0.787 |
| Wrong model | e-t+1 = (1 − b / b-hat) e-t. | Diverges when b-hat < b / 2 |
| Return | G = sum over t of γ to the t times r-t. | Corridor at γ 0.9: G = 0.458 |
| Adaptation | d-hat moves a fraction α toward each measurement. | α 0.3, wind 0.8: 0.24, 0.408, 0.526 |
pythondef rollout(policy, world, s, H, gamma=0.9): G = 0.0 for t in range(H): o = world.observe(s) # sensors see o, not the true state s a = policy(o) # a_t = pi(o_t): the closed loop s, r = world.step(s, a) # s_{t+1} = f(s_t, a_t): the action changes what comes next G += gamma ** t * r # discounted return return G
This lesson follows Lecture 1, "Robot Learning: What, Why, and How?", of CMU 16-831 Introduction to Robot Learning, Spring 2024, taught by Guanya Shi. The slides are on the lectures page. The lecture's reading is Lake, Ullman, Tenenbaum and Gershman, Building Machines That Learn and Think Like People. The compounding-error bound is from Ross and Bagnell (2010), restated as Theorem 2.1 of the DAgger paper. Chapters 3 and 7 add material the later lectures need.
Now press Present or Teach and explain from memory: the three words, the loop's two rules, why errors compound, and why robot data is scarce. Then go back to the three robots, set the wind high, and say why only one arrives.