Source-linked AI summary
ZipMPC: Compressed Context-Dependent MPC Cost via Imitation Learning
Rahel Rickenbach, Alan A. Lahoud, Erik Schaffernicht, Melanie N. Zeilinger, Johannes A. Stork
TL;DR
MPC often uses short horizons to meet computational limits, but those horizons leave a gap in future information and make cost design difficult. ZipMPC learns a context-dependent cost for short-horizon MPC by imitating long-horizon MPC with differentiable optimization. In autonomous racing, it improves lap times over short-horizon MPC, approaches long-horizon MPC lap times, and also improves performance on unseen tracks.
Problem
MPC's computational burden often requires short prediction horizons, which limit future information and make it harder to design costs that reflect long-term objectives.
Source: §1 · pp. 1–2Method
ZipMPC uses neural networks and differentiable MPC to learn a context-dependent cost for short-horizon MPC by imitating long-horizon MPC solutions.
Source: §1 · p. 2, §3.2 · p. 4Results
ZipMPC decreases lap times relative to short-horizon MPC across tested scenarios, achieves times close to long-horizon MPC, and improves lap times on unseen tracks.
Source: §4.1 · pp. 6–7, §5 · p. 8Takeaways & Limitations
The reported results indicate that ZipMPC combines reduced controller-input optimization time with constraint feasibility and generalization to unseen environments.
Source: §1 · p. 2, §5 · p. 8ZipMPC cannot be assumed to inherit long-horizon MPC stability and recursive-feasibility guarantees because its approximation is imperfect; these properties are shown empirically only.
Source: §6 · p. 9
Abstract
from arXiv · showhide
The computational burden of model predictive control (MPC) limits its application on real-time systems, such as robots, and often requires the use of short prediction horizons. This not only affects the control performance, but also increases the difficulty of designing MPC cost functions that reflect the desired long-term objective. This paper proposes ZipMPC, a method that imitates a long-horizon MPC behaviour by learning a compressed and context-dependent cost function for a short-horizon MPC. It improves performance over alternative methods, such as approximate explicit MPC and automatic cost parameter tuning, in particular in terms of i) optimizing the long term objective; ii) maintaining computational costs comparable to a short-horizon MPC; iii) ensuring constraint satisfaction; and iv) generalizing control behaviour to environments not observed during training. For this purpose, ZipMPC leverages the concept of differentiable MPC with neural networks to propagate gradients of the imitation loss through the MPC optimization. We validate our proposed method in simulation and real-world experiments on autonomous racing. ZipMPC consistently completes laps faster than selected baselines, achieving lap times close to the long-horizon MPC baseline. In challenging scenarios where the short-horizon MPC baseline fails to complete a lap, ZipMPC is able to do so. In particular, these performance gains are also observed on tracks unseen during training.
1 Introduction
Short MPC is computationally tractable but has limited future information, making cost design difficult; ZipMPC learns a context-dependent cost to imitate long-horizon MPC while retaining short-horizon computation. It is designed to combine computational efficiency with constraint satisfaction and generalization, and is evaluated in simulation and real-world autonomous racing.
1 Introduction
- Short prediction horizons make MPC more computationally tractable but limit future information and complicate designing a cost that reflects the desired objective.Long-horizon MPC can use future environmental features to perform well with manually designed costs, but its computation grows with horizon length.Source: §1 · pp. 1–2
- ZipMPC learns a neural-network cost for short-horizon MPC from long-horizon solutions, using differentiable MPC to propagate imitation gradients through the optimization.The learned cost encodes contextual information such as track curvature; the method is evaluated in simulation and real-world autonomous racing.Source: §1 · p. 2
- ZipMPC is positioned to combine fast inference with constraint recognition and generalization by learning a cost rather than cloning a control policy.The contribution reports improved performance in both seen and unseen environments.Source: §1 · p. 2
- Short-horizon cost tuning methods do not address the information gap, while explicit MPC approaches can struggle with unseen environments and hard-constraint satisfaction.The cited related work describes contextual BO as not scaling well with context dimension [22].Source: §1 · pp. 2–3
2 MPC Preliminaries
The preliminaries define MPC as a constrained optimization over predicted states and inputs under context-dependent dynamics. The controller applies only the first optimized input, then resolves the problem at the next step.
2 MPC Preliminaries
- MPC predicts states using context-dependent discrete-time dynamics and optimizes from the current state over a horizon of length N.The formulation includes state and input constraints, and a stage cost parameterized by c_i.Source: §2 · p. 3
- Solving the MPC problem returns optimal state and input trajectories, subject to the state and input constraint sets.The passage identifies the feasible sets as X for states and U for control inputs.Source: §2 · p. 3
- Only the first optimal control input is applied before the optimization is reinitialized and solved again.The paper calls this receding horizon control and uses a formulation without terminal ingredients to simplify cost design.Source: §2 · p. 3
3 ZipMPC: Compressed MPC Cost via Imitation Learning
ZipMPC learns a context-dependent cost for short-horizon MPC by imitating a well-tuned long-horizon MPC. Its learning framework compares predicted trajectories and propagates imitation-loss gradients through the short-horizon MPC optimization.
3.1 Problem Formulation
- The learned parameters minimize imitation loss between trajectories from a well-tuned long-horizon MPC and a short-horizon MPC.The long horizon is more expensive, while the short horizon is computationally efficient; the objective is to imitate the long-horizon controller's behavior.Source: §3.1 · pp. 3–4
3.2 Learning framework
- A learned nonlinear function maps the current state and long-horizon context to cost parameters for short-horizon MPC.The context sequence is intended to contain at least as much information as is provided to the long-horizon MPC.Source: §3.2 · p. 4
- Imitation loss compares only the first N_S steps of both trajectories, while sampled initial states are retained only if feasible for long-horizon MPC.This setup trains the short-horizon controller to anticipate behavior within its horizon using the added context.Source: §3.2 · p. 4
- ZipMPC uses differentiable MPC to propagate informative gradients through the short-horizon optimization when learning cost parameters.The method addresses the gradient-backpropagation bottleneck by differentiating the MPC solution with respect to its cost parameters.Source: §3.2 · p. 4
- The learning algorithm starts from manually designed costs, uses them as a warm start, and learns neural-network cost corrections with an imitation loss.The procedure uses mean squared error over the first N_D steps and Adam to update network weights.Source: §3.2 · p. 5
4 Experiments
The experiments evaluate ZipMPC in simulation and on hardware, testing imitation of long-horizon MPC, lap times, track generalization, and the role of context. ZipMPC improves on short-horizon MPC, approaches long-horizon lap times in simulation, and retains gains on unseen tracks and hardware.
4 Experiments
- The evaluation compares tuned short- and long-horizon MPC, Bayesian-optimization cost tuning, and a neural-network controller cloning long-horizon MPC, using imitation error and lap time.Experiments use kinematic and Pacejka car models, with track curvature as context.Source: §4 · pp. 5–6
4.1 Simulation Results
- On 1,000 validation initial states, ZipMPC shows increased imitation capability over the selected baselines against long-horizon MPC trajectories.Table 1 reports first-five-step RMSE for the kinematic model, with mean and standard deviation.Source: §4.1 · p. 6, Table 1 · p. 6
- ZipMPC improves lap times over short-horizon MPC across tested horizon combinations and models, approaches long-horizon MPC with the kinematic model, and reduces optimization time relative to long-horizon MPC.The Pacejka-model comparison also reports lap completion and per-step execution-time reduction; Figure 3 illustrates trajectory smoothing at the same MPC horizon as the short-horizon baseline.Source: §4.1 · p. 6, Table 3 · p. 6, Table 2 · p. 6
- On the trained track and two unseen tracks, ZipMPC reduces lap time versus short-horizon MPC and comes close to long-horizon MPC with the kinematic model.The evaluation uses tracks with different lengths and curvature steepness and directions, without extrapolating maximum steepness.Source: §4.1 · p. 7, Table 4 · p. 7
4.2 Ablation Study in Simulation
- Context yields substantial gains at shorter prediction horizons; the benefit diminishes as the short horizon approaches the long horizon.Performance also trends upward as the short horizon increases, which the authors attribute to better initial cost estimates and greater cost-optimization capacity.Source: §4.2 · p. 7, Figure 5 · p. 8
- The learned lateral-deviation cost varies with track position: right-hand curves correspond to positive values and left-hand curves to negative values, with values strongly correlated with upcoming curvature.Figure 5 presents the learned values along the track and against curvature.Source: §4.2 · p. 8, Figure 5 · p. 8
4.3 Real World Results
- ZipMPC trained in simulation with the Pacejka model was tested on hardware without retraining, where its trajectories incorporate context to improve racing performance.The comparison uses ZipMPC with NS = 20 and NL = 40 against MPC NS.Source: §4.3 · p. 8, Figure 7 · p. 8
5 Conclusion
ZipMPC imitates long-horizon MPC solutions with a significantly shorter-horizon MPC by incorporating long-horizon context into a learned cost. The experiments report reduced optimization time, preserved constraint feasibility, stronger generalization, and validation on a miniature racing platform.
5 Conclusion
- ZipMPC combines a significantly shorter-horizon MPC with a learned cost that incorporates long-horizon context to imitate long-horizon MPC solutions.The method uses differentiable MPC and neural networks.Source: §5 · p. 8
- Experiments report reduced controller-input optimization time, preserved feasibility with respect to system dynamics, and enhanced generalization to unseen environments.The observations were further validated in real-world experiments on a miniature racing platform.Source: §5 · p. 8
6 Limitations
The section identifies limitations tied to differentiable MPC, infeasible training samples, nonconvex imitation loss, and the absence of inherited theoretical guarantees. The accompanying appendix passages describe the racing coordinate frame, vehicle models, MPC formulation, and parameter settings.
6 Limitations
- ZipMPC inherits limitations of its differentiable MPC method, including convex-approximation inaccuracies and exact penalties for state inequality constraints.The authors expect these limitations to lessen with future developments in differentiable MPC.Source: §6 · p. 9
- Sampling infeasible initial states can make training sensitive, and approximating the feasible region may be harder for more complex problem descriptions.The authors suggest detecting infeasible states with a parallel standard solver and omitting those samples.Source: §6 · p. 9
- The nonconvex imitation loss may converge to highly suboptimal local minima; the authors observed no such issue with the kinematic model and used best-lap model selection for Pacejka.Source: §6 · p. 9
- ZipMPC cannot be assumed to inherit the stability and recursive-feasibility guarantees of long-horizon MPC because its approximation is imperfect; these properties are shown empirically.Quantifying approximation error is identified as future work.Source: §6 · p. 9
A.1 Frenet Frame
- The Frenet frame represents position relative to a trajectory using progress σ, lateral deviation d, and orientation ϕ.The state vector is x = [σ, d, ϕ].Source: §A.1 · p. 13
A.2 Car Dynamics
- The racing application models car dynamics with either a kinematic bicycle or Pacejka model and uses progress-dependent curvature κ(σ) as context.Tracks have constant width 2ω; the car’s rear length and center-of-mass-to-front-axle distance are denoted lr and lf.Source: §A.2 · p. 13
A.2.1 Pacejka Model used in Simulation
- The Pacejka model targets high-velocity applications but can have numerical difficulties at low velocities, whereas the kinematic bicycle model is computationally cheaper and suited to small-to-medium velocities.The models use different control inputs and state descriptions.Source: §A.2.1 · p. 13, §A.2.3 · p. 14
A.3 MPC for Racing
- The racing MPC uses quadratic costs and polytopic constraints, including track boundaries represented as two-sided half-space constraints for constant track width.The appendix reports separate manual cost-vector settings for kinematic simulation, Pacejka simulation, and hardware experiments.Source: §A.3 · p. 15, §A.4 · p. 15, Table 5 · p. 15
B Experiment Setup
The section introduces the learning framework and hardware setup, then discusses limitations of the selected setup.
B Experiment Setup
- The experiment-setup section covers the learning framework, hardware setup, and limitations of the selected setup.Source: B Experiment Setup · p. 16
B.1 Learning Framework Setup and Implementation Details
The learning framework feeds track curvature and selected vehicle state variables into a neural network that predicts MPC cost parameters. Training compares ZipMPC trajectories with long-horizon MPC, while hardware experiments use a motion-capture-controlled miniature car.
B.1 Learning Framework Setup and Implementation Details
- The neural-network input combines a horizon of upcoming track-curvature samples with velocity v, lateral deviation d, and orientation ϕ, excluding progress σ to avoid track-specific overfitting.The curvature horizon covers the maximum progress possible in the long-horizon MPC optimization.Source: §B.1 · p. 16
- A convolutional feature extractor and fully connected layers produce a fixed MPC-cost component and time-varying modulation components for P and Q.The modulation output has dimensions 2 × NS × (n + m), and its values are scaled to a specified range.Source: §B.1 · pp. 16–17
- Training minimizes weighted state and control mean-squared errors against long-horizon MPC over only the first ND trajectory steps, then selects the model with the best lap performance on a fixed training-track initial state.The authors limit the loss horizon to simplify optimization and because initial trajectory steps are most important under receding-horizon control.Source: §B.1 · p. 17
B.2 Hardware Setup
- Hardware tests use a 1/28-scale car whose motion-captured position and orientation are sent to a server that returns control inputs over Wi-Fi.The car races on a predefined track.Source: §B.2 · p. 17, Figure 9 · p. 17
B.3 Setup Limitations
The setup addresses numerical mismatch in differentiable MPC and instability in Frenet coordinates at large lateral deviations.
B.3 Setup Limitations
- Gradient computation excludes samples when differentiable MPC and standard-solver solutions differ beyond an arbitrary tolerance.State hard constraints are implemented as a deterministic high penalty in the differentiable MPC cost, which can yield slightly different solutions from standard solvers.Source: §B.3 · p. 17
- Large lateral deviations make the Frenet transformation increasingly susceptible to singularities, so the maximum deviation was tightened.This restricts the car’s range to reduce the risk of approaching unstable regions.Source: §B.3 · pp. 17–18
C Supplementary Results
Supplementary results examine lap times as MPC horizons increase and compare ZipMPC’s execution time with short-horizon MPC.
C.1 Lap time with manual cost MPC
- Lap times decrease and appear to converge as horizon length increases for both the kinematic and Pacejka models on the training track.The comparisons use the same manual cost as the MPC NS and MPC NL methods in the main-text tables.Source: §C.1 · p. 18, Table 9 · p. 18, Table 10 · p. 18
C.2 MPC Execution time
- ZipMPC’s inference time is highly comparable to the corresponding short-horizon MPC across tested horizon combinations and both models.The authors attribute this mainly to fast neural-network inference; the execution-time experiments use IPOPT.Source: §C.2 · p. 18
C.3 Visualizing the learning process
The supplementary results visualize learning across initial states and horizon ratios, reporting closer trajectory alignment and improved learning with context.
C.3 Visualizing the learning process
- As training iterations increase, ZipMPC trajectories progressively align more closely with the long-horizon MPC target across varied Pacejka-model initial states.The plotted stages include 0, 20, 50, and 100 iterations.Source: §C.3 · pp. 18–19
- Context-aware ZipMPC improves learning performance over context-free ZipMPC in all selected scenarios across the displayed short-to-long horizon ratios.The full validation learning curves use NL = 20 for the kinematic model.Source: §C.3 · p. 19, Figure 10 · p. 19
C.4 Additional hardware results
Hardware comparisons show ZipMPC completing a lap in a setting where short-horizon MPC stalls, alongside tests where both methods complete laps.
C.4 Additional hardware results
- With NS = 20 and NL = 40, both ZipMPC and MPC NS successfully complete a lap in the hardware comparison with MPC NL.Figure 12 shows ZipMPC and MPC NL; the text states both ZipMPC and MPC NS complete the lap.Source: §C.4 · p. 19, Figure 12 · p. 20
- With NS = 10 and NL = 25, ZipMPC completes the lap while MPC NS gets stuck after four seconds in the third corner.The comparisons are shown against MPC NS and MPC NL in Figures 13 and 14.Source: §C.4 · pp. 19–20, Figure 13 · p. 20, Figure 14 · p. 20