← Notes · 21 November 2026 · 4 min read

Two models from the same data: one for speed, one for safety

A learned model makes a predictive controller fast; it comes with no guarantee. A guaranteed model makes it safe; it is cautious. The compatible models approach builds both from the same data and lets each do what it is good at.

Model predictive control plans a few steps ahead with a model of the system, applies the first step, and plans again. Its quality is the quality of its model. Learn the model from data and the controller can be fast and precise, but only where the data were good. Somewhere else the model is wrong, the plan is wrong, and nothing stops the controller from following it.

The usual answer is a robust controller: plan for the worst case the model allows. That is safe, but it is cautious everywhere, including where the data would have allowed more.

During my PhD, with Antoine Girard and Laurent Fribourg, we asked whether a controller could have both. The answer is to build two models from the same data.

The two models

The first is a guaranteed model. From the measured transitions and bounds on how fast the dynamics can change, it gives, for every region of the state space, an interval that is proven to contain the true dynamics. On top of it we compute the set of states from which the system can be kept safe forever, and for each state the inputs that do it.

The second is a learned model: a smooth function fitted to the same data, the kind of model you want for planning. One constraint makes the pair work: the learned model must lie inside the guaranteed one. We call it compatible.

The controller then plans with the learned model, but picks its first input only among the safe inputs of the guaranteed model. However good or bad the learned model is, the system never leaves the safe set. The learned model decides how fast; the guaranteed model decides what is allowed.

Learning while driving

Both models keep learning while the system runs. Every new measurement tightens the guaranteed model and nudges the learned one, which stays compatible.

The test case is a small car-like robot that must visit four zones in order, as fast as possible, in a 5 × 5 m room with two blocks. It starts with 10,000 measurements, all taken below 1 m/s, but it may drive at up to 2 m/s. At first the learned model is poor above 1 m/s, so the planner stays slow: the first lap takes 14.4 s. After a few seconds of data at higher speeds, the learned model becomes accurate there, and the laps drop to about 9 s, at 1.8–1.9 m/s on average. Over 10 laps there was no collision, and the robot never left the certified safe set.

What the guarantee is worth

To see what the guaranteed half contributes, I ran the same planner with the same learned model and the same online learning, with and without the certified inputs, five times each.

The same run with and without the certified inputs

Without them, the planner trusts its learned model while that model is still wrong at high speed. In one of the five runs it drove into a block 12.8 s after the start; in the others it came within 4 cm of a wall. With the certified inputs there was no collision in any run, for about 2.5 % in lap time.

The lesson

You don’t have to choose between a model that is good and a model you can trust. Build both from the same data, make them agree, and let each do the job it is good at.

Papers: European Journal of Control (2023) and IFAC ADHS (2024). Code: github.com/anas-makdesi/compatible-mpc.