Unit 2 of 11 · about 5 hours · derive, implement
One-step and multi-step prediction, open-loop rollout and Model Predictive Control
A model is used by rolling it forward. This unit turns prediction into decisions, and shows why replanning beats blind execution.
You'll be able to
- Derive a finite-horizon planning objective with a terminal value, and state how its return depends on model and reward error.
- Implement open-loop rollout and closed-loop replanning on a small system, and show where they disagree under noise.
- Run Model Predictive Control (execute the first action, replan) and explain why the horizon is not the task horizon.
Covers
Read
In this order, only the parts listed
0 of 4 done
- Lecture 11: Model-Based RL, planning slidesStanford CS224R Spring 2026 - Model-Based RL
Slides 21 to 27: Planning V1 (open loop), receding-horizon replanning, Planning V2 with terminal value, full planning algorithm
- Lecture 16: Model-Based RL Part 2, Part 1Berkeley CS 185/285 Deep Reinforcement Learning (Spring 2026) - Model-Based RL
Part 1 (Planning with models: deterministic, stochastic open-loop and closed-loop cases, open-loop versus closed-loop terminology)
- Chapter 8, Section 8.8: Planning at Decision TimeReinforcement Learning: An Introduction (2nd ed.) - Chapter 8
Section 8.8, printed p. 180: background planning versus decision-time planning
Read for the distinction only. The authors post the full text free at incompleteideas.net; the URL above is the publisher page.
- PETS, Algorithm 1 (MPC loop)Deep Reinforcement Learning in a Handful of Trials using Probabilistic Dynamics Models (PETS)
arXiv:1805.12114v2, Section 6, Algorithm 1: sample action sequences with CEM, propagate particles, execute only the first action
Read the control loop only, not the ensemble training in Sections 4 and 5.
Focus on
- Open loop commits to a whole action sequence from . Closed loop replans after each observation, so feedback corrects prediction error while it is still small.
- Planning V2 adds a terminal value to the reward sum over steps. Without it a short horizon is myopic; with a bad one it inherits value error.
- MPC executes only the first planned action. The planning horizon is a compute knob, not the task horizon.
Common mistakes · 3
- Executing the full planned sequence in a stochastic system. The later actions were optimized for predicted states, not for the states that occur.
- Setting the planning horizon from the task horizon. A short horizon with a terminal value solves long tasks; a task-length horizon with model error solves none.
- Dropping the terminal value and calling short-horizon control optimal. It is optimal for the truncated problem, which need not match the task.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.What is the operational difference between open-loop and closed-loop use of the same model?Answer
Open loop executes the planned sequence without new observations. Closed loop executes the first action, observes the next state, and replans, so feedback corrects drift.
2.Why does Planning V2 add a terminal value after the horizon?Answer
The finite sum alone ignores everything after step , which makes short-horizon plans myopic. The terminal value estimates the missing tail.
3.A planner with controls a 500-step task well. Does that contradict the task horizon?Answer
No. The horizon bounds each lookahead, not the episode. Replanning every step chains short lookaheads across the full task.
4.In PETS Algorithm 1, how many planned actions are executed per control step?Answer
One: the first action of the best CEM sequence. The rest are discarded and planning restarts at the next state.
You're done when
You can derive the finite-horizon objective with its terminal value, and your receding-horizon loop matches a hand rollout on a deterministic toy.
Only when you can do this without notes.
Leads to
Notes
Resources · 4 for this unit, 4 more in the section
- Berkeley CS 185/285 Deep Reinforcement Learning (Spring 2026) - Model-Based RLUC Berkeley · primary
Slides are public at https://rail.eecs.berkeley.edu/deeprlcourse/static/slides/lec-N.pdf; current videos are not, and the public Fall 2023 playlist numbers lectures differently. Study Lectures 15 and 16 (model-based RL: learned dynamics, open-loop and closed-loop planning, random shooting and CEM, MPC, model-based policy learning). There is no model-based homework, so build the planner yourself on a small environment with known dynamics first.
- Reinforcement Learning: An Introduction (2nd ed.) - Chapter 8Richard Sutton and Andrew Barto · required
The authors post the full second edition free at incompleteideas.net; cite the printed page numbers. Study Sections 8.1 to 8.3 (models, Dyna-Q, when the model is wrong) and Sections 8.8 to 8.11 (decision-time planning, rollout algorithms and Monte Carlo Tree Search). Reproduce the Dyna-Q versus Dyna-Q+ ranking on the blocking or shortcut maze.
- Stanford CS224R Spring 2026 - Model-Based RLStanford University · support
Use Lecture 11 (model-based RL) and its MBPO reading as a second treatment of model error, uncertainty and short model rollouts.
- Deep Reinforcement Learning in a Handful of Trials using Probabilistic Dynamics Models (PETS)Chua et al. (NeurIPS 2018) · support
Read the split between aleatoric uncertainty (probabilistic networks) and epistemic uncertainty (ensembles) and the trajectory-sampling planner. Implement an ensemble on a small task and show where the members disagree.
Also in this section
- When to Trust Your Model: Model-Based Policy OptimizationJanner et al. · required
Study the model-error analysis and short model-rollout design. Reproduce a reduced real-plus-imagined-data comparison and retain the horizon where model bias reverses the gain.
- Mastering Diverse Domains through World ModelsDeepMind · depth
Read DreamerV3 only after the small explicit dynamics and planning path passes. Trace representation, latent dynamics, imagination and actor-critic state, but do not make a large benchmark reproduction part of the exit gate.
- Hands-on Modern RL - Model-Based and World-Model SectionsWalking Labs · support
Use Sections 9.3 and 9.4 as concept maps for model-based RL, search and world models. No runnable dynamics or planner script exists, so reproduce its error-recursion numbers by hand and verify algorithm claims against the original papers. Pin commit 9231bab of walkinglabs/hands-on-modern-rl; its
code/chapterNNfolders do not follow the site chapter numbers. - Reinforcement Learning Control Laboratory - Model-Based StretchRoadmap-Final · support
Add a learned-dynamics stretch with a known-dynamics sanity case, prediction and planning tests, horizon sweeps, model-exploitation failure and matched model-free comparison.