- The paper introduces an amortized MPC framework using a residual-corrector architecture to approximate nonlinear programs with a tractable QP surrogate.
- It employs a hybrid analytic-learning strategy with a differentiable QP layer, achieving over 21× faster solution times and near-optimal performance within 4.7% of IPOPT.
- The method guarantees strict constraint satisfaction in input-affine systems, making it ideal for high-frequency and embedded real-time control applications.
Amortized Nonlinear Model Predictive Control: An Expert Analysis
Introduction and Motivation
Model Predictive Control (MPC) is a standard paradigm for handling constrained optimal control problems by solving a finite-horizon optimal control program at each time step. While convex parametric cases are computationally tractable, the high on-line computational overhead of nonlinear programs (NLPs) for nonlinear MPC remains a fundamental limitation, especially for high-frequency or embedded applications. Traditional approaches—including real-time iteration (RTI) schemes—employ Newton-type methods but can still be prohibitive for systems with tight real-time or hardware constraints.
This paper introduces an amortized approach leveraging the input-affine structure prevalent in many robotics and engineering systems. It proposes a hybrid analytic-learning architecture that predicts a quadratic program (QP) approximating the NLP at each time step, balancing the need for computational efficiency and constraint satisfaction.
Residual-Corrector QP Architecture
The central innovation is a residual-corrector architecture, which combines a state-dependent analytic baseline with a neural network that learns only residual corrections to the QP parameters. For input-affine models,
xk+1​=f(xk​)+G(xk​)uk​,
the first control input of the optimal sequence can be approximated as the solution to a QP whose cost and constraint matrices are parametric in the state and reference. The analytic baseline is derived from a first-order linearization of the cost-to-go, while the neural correction captures nonlinear, horizon, and modeling effects that are not accounted for by the local approximation.
Figure 1: Residual-corrector architecture for amortized input-affine MPC, where a network predicts corrections to an analytic baseline, and a differentiable QP layer ensures constraint satisfaction for the first control action.
The architecture feeds the current state and reference into a multi-layer perceptron (MLP), which outputs residual updates to the Cholesky decomposition of the cost matrix and linear term. These corrected parameters define the QP, which is solved by a differentiable interior-point layer. Crucially, this separation ensures that state and input constraints are strictly enforced, while the learning is focused on fitting the projection of the horizon cost-to-go into the QP form.
Training via Hybrid KKT Loss
The network is trained offline on data generated from full NLP solutions, minimizing a composite loss comprising four components:
- Supervised Loss: Direct imitation of the first optimal control computed by an NLP solver.
- KKT Stationarity Residual: Penalizes violations of first-order optimality on the full NLP induced by the predicted QP solution.
- Fischer–Burmeister Complementarity: Enforces feasibility and complementarity residuals for active constraints.
- Regularization: Penalizes deviation from the analytic baseline, promoting stability and generalization.
The KKT and FB residuals are evaluated at a mixed solution, where the first input and next state are taken from the network, and the remainder from the NLP. This first-order consistency strategy efficiently regularizes the network around the analytic approximation and physical constraints of the true system.
Experimental Validation
A comprehensive case study is performed on a three-link planar robotic arm with nonlinear dynamics subjected to various physical constraints. The cost incorporates Cartesian end-effector tracking and quadratic penalties on states and inputs. The resulting input-affine system is used to derive both the analytic baseline and constraints for the amortized QP.
Closed-loop evaluations compare the proposed amortized QP controller to state-of-the-art RTI (acados), full-horizon IPOPT NLP (ground truth), and a direct MLP policy with no QP layer (pure data-driven).
Figure 2: End-effector trajectories in the workspace for amortized QP, RTI, IPOPT, and direct MLP policies; only amortized QP closely matches the optimal IPOPT trajectory.
The amortized QP policy achieves:
Theoretical and Practical Implications
The approach demonstrates that, for input-affine nonlinear systems, the computational burden of nonlinear MPC can be shifted predominantly offline. By leveraging a physically-motivated analytic baseline and only learning residuals, the burden on the neural network is reduced, improving data efficiency and reliability under extrapolation. Embedding a QP layer enforces hard constraints exactly—something unattainable with standard black-box neural policies.
The hybrid KKT training strategy regularizes the solution to honor first-order optimality and feasibility, providing a degree of physical correctness unmatched by pure data-fitting. The small QP size (in state/input dimension) means the online computation is highly predictable and amenable to hardware acceleration in embedded environments.
This method contrasts with warm-starting and explicit MPC approaches [chen2018approximating, vaupel2020accelerating, masti2019learning]. Whereas warm-start networks provide initial guesses to iterative solvers, the amortized residual-corrector approach directly parameterizes a tractable surrogate QP, and uses a differentiable solver to close the loop. While differentiable MPC and neural convex layers have been previously explored [amos2017optnet, amos2018differentiable], those works typically address the convex case or require full end-to-end gradient flow through the entire NL solver, whereas here the learning is regularized with hybrid physics-informed loss without the prohibitive computational cost of differentiating through large-scale NLP solvers.
Future Directions
This strategy can be extended beyond input-affine systems via embedding richer parametrizations or by augmenting the analytic baseline to capture more structure. Generalization to underactuated or uncertain systems, as well as the incorporation of learning-based model uncertainties in the QP formulation, are promising areas. Extensions to MPC with safety filters [wabersich2021predictive] or explicit stability/contraction constraints are immediate next steps.
Further investigation is warranted into regularizing the network and loss composition to guarantee closed-loop stability and recursive feasibility, especially in the presence of modeling mismatch or non-stationary references.
Conclusion
The amortized nonlinear MPC framework provides a practical approach for combining first-principles modeling with learning-based residual correction in input-affine nonlinear systems. Superior computational efficiency and reliable constraint satisfaction are achieved by embedding a state- and reference-dependent QP parameterized by a residual-corrector network. Offline training with a hybrid physics-informed loss captures both imitation and feasibility objectives, yielding fast, high-quality control in nonlinear, constrained settings. The results indicate that amortized MPC strategies with constrained optimization layers offer a highly promising solution for real-time nonlinear control tasks.
(2606.05840)