TL;DR
Williams and colleagues show that a common objective in optimal control, the expected cost of a trajectory, has a lower bound that is an exponential average over sampled trajectories. Minimising that bound is the same as pushing a sampling distribution toward a known optimal distribution, and that can be done by weighting random control perturbations by their costs. The resulting model predictive controller runs on a GPU at 40 Hz and drives a 1:5 scale autonomous car around a dirt track at speeds past the vehicle's friction limit.
Where you'll see it: aggressive off-road driving and other racing-style control, where the dynamics are nonlinear and the cost has hard barriers that a gradient-based planner handles poorly.
The problem
Autonomous driving is a stochastic optimal control problem. The controller picks a sequence of steering and throttle inputs that minimises the expected accumulated cost (track position, speed error, stability) over a short horizon. Doing this well at the limit of tyre grip is hard for three reasons.
First, the dynamics are highly nonlinear, and on a dirt track the friction model is poorly known. Second, the cost contains soft preferences and near-hard barriers, such as leaving the track, that jump from small to very large values. Third, the controller has to re-solve the problem tens of times per second on onboard hardware.
The standard tools each fail one of these tests. Hierarchical planners split the work into a path and a tracker, which the authors argue limits how close to the edge the car can go. Gradient-based MPC needs smooth cost and dynamics derivatives, which the barrier costs and the rough dirt-track dynamics do not provide. The cross-entropy method, the closest prior art, is sampling-based, but its update (refit a Gaussian to the best few samples) is a heuristic rather than a consequence of the control objective. The paper asks whether a sampling-based controller can be derived from first principles so that it is both principled and fast.
Key idea
Think of the controller as having a distribution over possible control sequences. Some sequences are cheap, most are expensive. The optimal distribution is a known reweighting of the sampling noise: keep each sampled sequence with a weight that falls off exponentially with its cost. The controller's job is to move its own sampling distribution toward that reweighted one. Once it is close, the best open-loop control sequence is simply the weighted average of the samples.
The picture to keep in mind is a cloud of noisy trajectories. Low-cost trajectories get large weight, high-cost ones are almost ignored, and the plan is nudged toward the weighted average. Repeating this at every control step, while warm-starting from the previous plan, gives a controller that never has to differentiate anything.
The method
Write the control sequence as over a horizon of steps, and perturbations as drawn from a Gaussian with covariance around . Let be the trajectory cost of applying the perturbed controls from the current state , and let be a temperature. Denote by the base distribution of perturbations induced by the uncontrolled dynamics, and by the distribution induced by a control sequence .
The free energy lower bound
The paper defines the free energy of the system as
Rewriting the expectation under with importance sampling and applying Jensen's inequality, which is valid because the logarithm is concave, gives
The left side is fixed by the system. The right side is the expected trajectory cost plus a KL penalty for departing from the base distribution. This is the standard optimal control objective, with the control effort measured as a KL divergence. Choosing the base distribution as the perturbation distribution around a nominal control turns that KL into the quadratic control cost , up to terms that do not depend on . So the bound is a family of bounds indexed by the nominal , and the paper shows that the ordinary optimal control cost is always at least the negative free energy.
The optimal distribution
Define
Substituting into the bound makes the inequality tight, so is the distribution that attains the bound. This is the Gibbs Variational Principle applied to trajectories: the best distribution over controls is the base distribution exponentially tilted by cost. Its normaliser is the same quantity that appears in the free energy.
Minimising over , the paper shows that the optimal open-loop control is
the mean perturbation under the optimal distribution. This is the key formula. It cannot be used directly, because nothing lets you sample from , but it says exactly what to aim for.
Importance sampling
Rewrite the expectation under as an expectation under the current controlled distribution using the Importance Sampling identity, with weight . Splitting the weight into a state-cost part and a control-cost part, and cancelling the factors that do not depend on , leaves
and the update is over samples from . The paper stresses that this is an unbiased estimate of the optimum but is only approximated in practice with a finite Monte Carlo sample, which can make the controller look like it is stuck in local minima when the sample count is too low.
Practical modifications
The paper introduces several changes that make the update work on a real car.
Shifting costs. Let be the smallest sampled cost and subtract it from every sample's cost. The best sample then has cost zero, which keeps the exponentials from underflowing when costs are large. All weights are multiplied by the same factor , which cancels when they are normalised, so the optimum is unchanged and only the numerical conditioning improves.
Decoupling control cost from temperature. With the uncontrolled dynamics as base, lowering also lowers the control cost, so tightening the temperature makes the controller reject most samples and oscillate. The fix is to use a base distribution with . This replaces the control-cost coefficient with . Setting near one penalises departure from the previous plan, which gives smooth motion.
Constraints. Actuator limits are handled by clamping: the simulated input is , a clamp to the allowable range, and the clamp is part of the dynamics. No quadratic program is solved online, and no samples are thrown away.
Smoothing. The sampled average is noisy. The paper applies a Savitzky–Golay filter to the averaged control sequence. A Savitzky–Golay filter fits a local polynomial over a sliding window, so it removes high-frequency jitter while keeping the overall shape of the plan.
The real-time algorithm
Each control step the controller takes the current state from the estimator, generates perturbation sequences in parallel on the GPU, rolls them out through the dynamics model, computes their costs, converts costs to weights, computes the weighted average, applies the smoothing filter, sends the first control to the actuators, and shifts the remaining sequence forward to warm-start the next step. A small fraction of samples, under one per cent in the paper's notation, are drawn without any importance-sampling correction. These let the controller recover if a disturbance pushes all the weighted samples into bad regions.
The paper's experiments use a horizon of seconds at Hz, so each plan has control steps. The GPU runs a few thousand samples of such trajectories fast enough for the 40 Hz loop.
Results
The vehicle is a 1:5 scale AutoRally, about 22 kg, with a top speed of 113 kph, running ROS on an onboard Intel quad-core computer with a GPU. The track is a dirt ellipse about 30 m across at its widest. The authors compare IT-MPC against an MPC version of the cross-entropy method, CEM-MPC, using the same cost function and parameters, and two dynamics models: a basis-function model and a neural network model.
Table III reports success rate and lap time over 100 laps per setting. A few representative rows, with success rate and mean lap time in seconds:
| Setting | IT-MPC, neural network | CEM-MPC, neural network | IT-MPC, basis function | CEM-MPC, basis function |
|---|---|---|---|---|
| 6 m/s target, counter-clockwise | 100%, 16.98 s | 100%, 12.61 s | 100%, 18.42 s | 83.16%, 11.82 s |
| 8.5 m/s target, counter-clockwise | 100%, 11.78 s | 91.20%, 10.74 s | 89.10%, 11.30 s | under 50% |
| 11 m/s target, counter-clockwise | 100%, 9.27 s | 66.32%, 8.42 s | under 50% | under 50% |
The pattern is clear. At the lowest target speed both controllers complete laps, and CEM-MPC laps are about 26 per cent shorter with the neural network model (12.61 s against 16.98 s). The authors say IT-MPC is conservative here. As the target rises, CEM-MPC's success rate falls, while IT-MPC with the neural network model finishes every lap in the counter-clockwise direction at 11 m/s. At 11 m/s counter-clockwise the CEM-MPC success rate is 66.32 per cent, so roughly one lap in three fails, against zero failures for IT-MPC. The paper reports that only IT-MPC with the neural network model, going counter-clockwise, completes all 100 laps at 11 m/s. Clockwise at 11 m/s its success rate is 76 per cent.
The paper also reports that the basis-function model is less accurate than the neural network on held-out data, so model quality matters as much as the controller.
Why it mattered
The paper does two things. It gives a derivation of a sampling-based MPC update from an optimal control objective, which the cross-entropy-method controllers it is compared against lacked. It also shows that such a controller can run at the limits of a real vehicle. The derivation is the part that later work built on. The controller form, with exponential cost weights, is the basis of the MPPI algorithm that later work uses, and the Model Predictive Path Integral Control lesson describes that simpler version.
It also changed how people thought about the connection between control and inference. The bound, the optimal distribution and the importance-sampling update are the same mathematics as variational free energy and KL-regularised reinforcement learning, and connects to Policy Gradient methods.
Reading guide
Read the paper in this order, with these prerequisites in hand:
- Section I, Introduction. The control problem for aggressive driving. Needs Optimal Control and Model Predictive Control.
- Section II, Preliminaries. The path-integral setting and the definition of free energy. Needs Gibbs Variational Principle and Boltzmann Distribution for the temperature analogy.
- Section III, the bound. Where Jensen's inequality turns the log of an expectation into an expectation of a log. Needs Jensen's Inequality and Kullback–Leibler Divergence.
- Section III-A, optimal distribution. Needs Gibbs Variational Principle again, plus Gaussian (Normal) Distribution for the perturbation model.
- Section III-B and III-C, the update. The mean of the optimal distribution and its importance-sampling estimate. Needs Importance Sampling and Monte Carlo Method.
- Section III-D, practical issues. Cost shifting, decoupling and clamping. Needs only the previous lessons.
- Section III-E and Algorithm 1, the real-time loop. Needs Model Predictive Path Integral Control, which gives the simpler form of the same update.
- Section IV, relation to stochastic optimal control. Path-integral control with stochastic dynamics. Needs Stochastic Differential Equation.
- Section V, related work. Read after Cross-Entropy Method, since V-A compares the two update rules directly.
- Section VI, experimental setup. Needs no new prerequisites beyond the cost function and the dynamics model.
- Section VII, results. Table III and the 8.5 m/s and 11 m/s discussions. Needs Cross-Entropy Method to interpret the baseline.
Check yourself
QuestionWhy does the optimal distribution q* give the lowest value of expected cost plus KL penalty, according to the paper?Show answer
The bound says that minus lambda times the free energy is at most the expected cost under q plus lambda times the KL divergence from q to the base distribution p. Substituting q* makes the inequality an equality, so q* attains the best value of that bound. Any other distribution gives a larger right-hand side, which means a higher expected cost plus control penalty.
QuestionWith costs S = 10, 12, 20 and lambda = 2, compute the normalised importance weights for the three samples.Show answer
Subtract the minimum cost 10 to get 0, 2, 10. The unnormalised weights are exp(0) = 1, exp(-1) = 0.3679 and exp(-5) = 0.00674. Their sum is 1.3746, so the normalised weights are 0.7275, 0.2676 and 0.0049. They sum to 1. The best sample dominates, and the worst carries almost no weight.
QuestionWhy does the paper avoid tying the temperature lambda directly to the control cost in the importance weights?Show answer
With the uncontrolled base distribution, the control-cost coefficient is the same lambda that sets how sharply the weights fall off. Lowering lambda therefore sharpens the weights but also makes control nearly free, and the plan moves more. Raising lambda keeps the control cost but flattens the weights, so the average gets close to unweighted. Using a base distribution centred on the previous plan with alpha between zero and one separates the two roles: gamma = lambda(1 - alpha) sets the effort penalty, and lambda alone sets how sharply the weights fall off.
QuestionIn the 11 m/s counter-clockwise setting, CEM-MPC with the neural network model has a 66.32 per cent success rate and a mean lap time of 8.42 s. IT-MPC has 100 per cent and 9.27 s. How much faster per lap is CEM-MPC, and what does the success rate imply?Show answer
CEM-MPC is 9.27 minus 8.42, or 0.85 s, faster per lap, which is about 9.2 per cent of the IT-MPC time. The success rate of 66.32 per cent means about 34 per cent of its laps failed. The lap times are only for the successful laps, so the comparison favours the faster controller. A controller that is slower on average but never fails can be the better choice on a real vehicle.
QuestionApplied scenario: a controller samples 500 trajectories per step, but the cost has a barrier that jumps by 10000 when the vehicle leaves the track. What goes wrong without a time-decaying penalty, and what does the paper do about it?Show answer
If a strong disturbance pushes the sampled spray of trajectories off the track early in the horizon, nearly every sample takes the barrier cost and gets weight close to zero. The importance-sampled update then destabilises, because the weights carry little information. The paper's fix is a barrier term multiplied by a decay factor 0.9 raised to the timestep, so that trajectories which leave the track late in the horizon are penalised less. This lets trajectories that stay on track until the end of the horizon still carry useful weight, and the small set of uncorrected samples lets the controller reset if the whole spray is lost.
Sources
- Williams, G., Drews, P., Goldfain, B., Rehg, J. M., Theodorou, E. A. (2017). Information-Theoretic Model Predictive Control: Theory and Applications to Autonomous Driving. arXiv:1707.02342, DOI 10.48550/arXiv.1707.02342.
- Williams, G., Aldrich, A., Theodorou, E. A. (2015). Model Predictive Path Integral Control using Covariance Variable Importance Sampling. arXiv:1509.01149.
- Model predictive control (Wikipedia).