Unit 5 of 11 · about 5 hours · derive, implement
Model ensembles, epistemic and aleatoric uncertainty and pessimistic planning
A single deterministic model is confidently wrong off data. Uncertainty tells the planner where the model ends and guessing begins.
You'll be able to
- Define epistemic versus aleatoric uncertainty, and say which shrinks with more data.
- Derive the Gaussian negative log-likelihood for a probabilistic dynamics model and the ensemble disagreement statistic.
- Implement a small ensemble, show members disagreeing away from data, and apply an uncertainty penalty in planning.
Covers
Read
In this order, only the parts listed
0 of 3 done
- Lecture 15: Model-Based RL Part 1, Part 3Berkeley CS 185/285 Deep Reinforcement Learning (Spring 2026) - Model-Based RL
Part 3 (Uncertainty-aware neural networks: output entropy is not enough, aleatoric versus epistemic uncertainty, bootstrap ensembles, SGD plus initialization usually suffices)
- PETS, uncertainty model and trajectory samplingDeep Reinforcement Learning in a Handful of Trials using Probabilistic Dynamics Models (PETS)
arXiv:1805.12114v2, Section 4 (probabilistic ensemble: each member outputs a Gaussian) and Section 5.1 (trajectory sampling: TS1 resamples a bootstrap for each particle every time step, TS keeps one bootstrap per particle for the whole trial)
The Hands-on model-based page calls the one-member-per-rollout scheme TS1; in the paper that scheme is TS.
- Lecture 11: Model-Based RL, ensemble slideStanford CS224R Spring 2026 - Model-Based RL
Slide 17: partial rollouts from real states plus an ensemble whose errors average out
Focus on
- Aleatoric uncertainty is noise in the world and stays with infinite data. Epistemic uncertainty is ignorance of the parameters and shrinks where data covers the region.
- Each PETS member outputs a Gaussian mean and diagonal variance for . Disagreement of means across members estimates the epistemic part; the predicted variances carry the aleatoric part.
- Pessimism penalizes or constrains plans by uncertainty. Expected value under a high-variance prediction can look fine while the pessimistic value is very low.
Common mistakes · 3
- Training every member on identical data with an identical seed. Without initialization or batch diversity the members agree everywhere and the disagreement statistic is theater.
- Reading predictive variance as model uncertainty. An output variance can encode pure environment noise; epistemic doubt needs member disagreement or a posterior.
- Planning on the ensemble mean as if it were a real dynamics. The mean of plausible models is itself an artificial environment; PETS propagates particles through sampled members instead (TS1 resamples every step, TS once per trial).
Try it yourself
Closed-book, before checking anything
np.std with ddof=0), the disagreement at , and is 0.0000, 0.0816 and 0.7348: reproduce all three on CPU, then derive the diagonal-Gaussian negative log-likelihood your probabilistic member would minimize.Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Which uncertainty shrinks with more data, and which does not?Answer
Epistemic uncertainty shrinks as data covers the region. Aleatoric uncertainty is inherent environment stochasticity and remains with infinite data.
2.Why is output entropy alone not enough for model uncertainty?Answer
It conflates the two kinds: a model can be certain about a noisy world (high aleatoric, low epistemic) or uncertain about a deterministic one (low aleatoric, high epistemic).
3.How do TS1 and TS differ, and what does keeping one member per particle buy?Answer
TS1 resamples each particle's bootstrap every time step; TS keeps it for the whole trial. Holding the member fixed respects time-invariant dynamics and makes the uncertainties separable: variance within one member is aleatoric, variance across members is epistemic. The paper notes TS1 softly restricts trajectory multimodality.
4.What does a pessimistic penalty change about the chosen plan?Answer
It downweights plans whose predicted return has high uncertainty, steering away from regions where the model may be exploited even when the mean looks good.
You're done when
You reproduce the three disagreement numbers, derive the Gaussian loss, and can point at a state where your ensemble disagrees and say what the planner must do there.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 5 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.
- 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
- 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.
- 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.