Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Learn how the world moves, then plan
A child learning to ride a bike builds, without equations, a feel for how the bike will respond to a lean or a push on the pedals, and uses that feel to decide what to do next. Learning-based control gives a computer the same two steps: watch the system respond to some actions, fit a model of how it moves, and then use that model to plan. If the model is wrong somewhere, try things there, gather more experience and refit.
Learned models plan for robot arms, quadrotors, autonomous racing cars and plasma control in fusion reactors; model-based RL methods such as PETS, Dreamer and TD-MPC are built on this idea.
- 1. Learning-based control first…
- 2. The learned model is then used to…
- 3. Where the model is poor, the controller should…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- System identification: fitting a dynamics model x′ ≈ f(x, u) to observed transitions, classically linear models by least squares.
- Model class: the family of functions the model can represent; physics-based features (grey-box) need little data, generic ones (neural networks, kernels) need more but assume less.
- Random Fourier features: cos(Wz + b) with random W and b; linear regression on them approximates a Gaussian-kernel regressor.
- Cross-entropy method (CEM): a sampling-based planner: sample action sequences, simulate them with the model, keep the best few, refit the sampling distribution, repeat.
- Certainty equivalence: plan as if the learned model were exact; re-planning at every step (MPC, topic L6-4) corrects many of its errors.
- Model-based RL loop: collect data, fit a model, plan or train a policy with it, run on the real system, add the new data, repeat.
- Epistemic uncertainty: uncertainty from lack of data, estimated by Gaussian processes (PILCO) or ensembles (PETS).
- Residual learning: keep a nominal physics model and learn only its error.
- 1. CEM plans by…
- 2. Grey-box models use…
- 3. Ensembles estimate…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.Planning through a learned pendulum model
Exercise 1.
- The real pendulum: angle from upright (hanging down is π), m = l = 1, gravity 9.8, friction 0.1, steps of 0.05 s, torque limited to |u| ≤ 5 so it must swing to get up.
- Two model classes for the angular acceleration, fitted by ridge regression: physics features (sin θ, ω, u, 1), which contain the true law, and 100 random Fourier features of (cos θ, sin θ, ω/4, u/5), which assume nothing.
- The planner: CEM with 100 samples of 20-step torque sequences, 3 refits keeping the best 10, cost Σ θ² + 0.1ω² + 0.001u² with the end state weighted 5 times, run as MPC with a warm start.
- Checks: physics features recover the true parameters from 20 transitions; the random-feature error falls with data; planning with the true model swings the pendulum up.
Practice.
- Start grey-box: if you know the physics, learn only its parameters or a residual on top of a nominal model; it needs orders of magnitude less data.
- Plan with re-planning: sampling-based MPC (CEM, MPPI) tolerates model error well and needs no gradients of the model.
- Model uncertainty: use ensembles or Gaussian processes so the planner avoids regions where the model is guessing (PETS, PILCO).
- Collect data where it matters: iterate data collection and refitting, as model-based RL does (topic L5-1).
- Tools: mbrl-lib, TD-MPC2, PyTorch for neural models, GPyTorch for Gaussian processes.
def cem(f, x, rng, mean=None, H=20, pop=100, elite=10, iters=3):
mu = np.zeros(H) if mean is None else mean; sd = np.full(H, 3.0)
for _ in range(iters):
U = np.clip(mu + sd * rng.normal(size=(pop, H)), -U_MAX, U_MAX)
xs = np.repeat(x[None], pop, 0); J = np.zeros(pop)
for t in range(H): # simulate every sample with the model
J += cost(xs, U[:, t]); xs = f(xs, U[:, t])
J += 5 * cost(xs, np.zeros(pop)) # end-state cost
e = U[np.argsort(J)[:elite]] # the best tenth
mu, sd = e.mean(0), e.std(0) + 0.1
return mu- 1. With known physics, the most data-efficient choice is…
- 2. PETS estimates model uncertainty with…
- 3. MPPI and CEM are…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Why physics features need so little data. The pendulum’s acceleration is exactly 9.8 sin θ − 0.1ω + u. With features (sin θ, ω, u, 1) the model is linear in four unknown parameters, so four transitions in general position determine them, and least squares with more data averages out noise. A generic model must instead learn the shape of the function everywhere, and its error falls only as data covers the state space.
Why a rough model can still control well. MPC uses the model only to rank short action sequences from the measured state, then re-plans after one step. Errors that do not change which sequence is best, or that are corrected by the next measurement, do no harm. What matters is model accuracy along the trajectories the controller actually visits, not average accuracy everywhere.
Distribution shift and the iterative loop. A model fitted to data near the bottom knows nothing about the upright region the controller needs to reach. Running the controller and adding the visited transitions targets data where it matters; this is the core loop of model-based reinforcement learning, and the same reasoning as DAgger in imitation learning (topic L5-3).
Uncertainty. A learned model is most dangerous where data is absent, because it extrapolates confidently. Ensembles and Gaussian processes expose this as disagreement or variance, letting the planner penalise or explore uncertain regions.
- 1. Physics features need few transitions because the model is…
- 2. What matters most for MPC is model accuracy…
- 3. The iterative loop fixes…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.How much data do physics-feature and generic models need for a learned-model planner to swing up a torque-limited pendulum, and does iterative data collection repair a model trained only near the bottom?
History.
- L. Ljung’s book (1987) set out system identification; C. Atkeson and S. Schaal (1997) learned robot models from demonstration data.
- R. Rubinstein (1999) introduced the cross-entropy method; A. Rahimi and B. Recht (2007) introduced random Fourier features.
- M. Deisenroth and C. Rasmussen (2011) introduced PILCO with Gaussian-process models; K. Chua and colleagues (2018) introduced PETS with probabilistic ensembles and CEM.
- G. Williams and colleagues (2017) introduced MPPI; N. Hansen and colleagues (2022–2024) introduced TD-MPC and TD-MPC2.
Exercise 2.
- Planning with the true model, and with physics-feature and random-feature models fitted to 20, 50, 100 and 300 random transitions (any angle, |ω| ≤ 8, random torque). Each controller runs for 5 s on the real pendulum from hanging down.
- Success means staying within 0.1 rad of upright for the last 20 steps. Model error is the RMS error of the predicted acceleration on 2,000 fresh random transitions.
- The iterative loop starts from 100 transitions near the bottom (angle π ± 0.3, slow speeds) with random features; after each episode its 100 transitions are added and the model refitted, for 4 rounds.
Random-feature model, seeds 0, 1 and 2 (success, model error):
| transitions | seed 0 | seed 1 | seed 2 |
|---|---|---|---|
| 20 | failure, 2.84 | success, 2.69 | failure, 2.81 |
| 50 | success, 0.83 | success, 1.04 | success, 1.13 |
| 100 | success, 0.39 | success, 0.34 | success, 0.53 |
| 300 | success, 0.074 | success, 0.080 | success, 0.111 |
Iterative loop with random features (success, model error):
| round (transitions) | seed 0 | seed 1 | seed 2 |
|---|---|---|---|
| 0 (100, near the bottom) | failure, 4.36 | failure, 3.87 | success, 3.34 |
| 1 (200) | success, 1.28 | success, 0.92 | success, 2.86 |
| 3 (400) | success, 1.32 | success, 0.59 | success, 1.70 |
Findings.
- Physics features: succeeded with every data size on every seed, with model errors of 0.001 or less; 20 transitions were plenty.
- Random features: failed on 2 of 3 seeds with 20 transitions and succeeded from 50 on, although their errors (0.83 to 1.13 with 50 transitions) were still far from zero. Re-planning forgives a lot.
- Swing-up cost with learned models (284.8 to 317.5 across the successful runs) matched planning with the true model (286.7 to 296.9).
- Data near the bottom only failed on 2 of 3 seeds; one round of collecting the controller’s own trajectories fixed it on every seed. The model’s error over the whole state space stayed high (0.59 to 1.70 after round 3): the loop makes the model accurate where the controller goes, not everywhere.
Learning-based control in practice
- Robot manipulation and locomotion: learned dynamics with MPC (PETS, TD-MPC2) and learned residuals on physics simulators.
- Racing and aerial robots: Gaussian-process residuals correct nominal models for aerodynamic effects.
- Fusion and process control: learned models of plasma or plant behaviour inform controllers trained in simulation.
- Safety: uncertainty-aware models restrict exploration to regions where predictions are trusted (topic L5-6).
References
- M. Deisenroth and C. Rasmussen (2011). “PILCO: a model-based and data-efficient approach to policy search.” ICML.
- K. Chua, R. Calandra, R. McAllister and S. Levine (2018). “Deep reinforcement learning in a handful of trials using probabilistic dynamics models.” NeurIPS.
- G. Williams and colleagues (2017). “Information theoretic MPC for model-based reinforcement learning.” ICRA.
- A. Rahimi and B. Recht (2007). “Random features for large-scale kernel machines.” NeurIPS.
- N. Hansen, H. Su and X. Wang (2024). “TD-MPC2: scalable, robust world models for continuous control.” ICLR.