NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Fine-Tuning of Neural Network Approximate MPC without Retraining via Bayesian Optimization

Henrik Hose, Paul Brunzema, Alexander von Rohr, Alexander Gräfe, Angela P. Schoellig, Sebastian Trimpe

TL;DR

Approximate Model Predictive Control (AMPC) replaces computationally heavy online optimization with fast neural network inference, but deploying it to real hardware usually requires tedious retraining whenever physical parameters change. This paper combines parameter-adaptive AMPC—which uses neural networks to approximate both control inputs and their parameter sensitivities—with local Bayesian optimization (TuRBO). The result is an automated, data-efficient pipeline that fine-tunes policies on physical hardware in just 20 trials (10–15 minutes) without retraining a single neural network.

What Problem Does This Paper Address?

Model Predictive Control (MPC) delivers optimal trajectories while respecting physical constraints, but solving its nonlinear optimization problem online is often too slow for fast robotics on low-power microcontrollers.

Approximate MPC (AMPC) bypasses this by training a neural network (NN) offline via imitation learning to map states directly to optimal control actions. However, classical AMPC suffers from a severe practical bottleneck: real hardware rarely matches nominal simulation models (due to unmodeled friction, varying payloads, or manufacturing variances). Changing even one physical parameter in classical AMPC typically requires regenerating millions of data points (costing tens of thousands of CPU core hours) and retraining the network.

Recent work introduced parameter-adaptive AMPC, which uses a secondary neural network to predict the sensitivities (gradients) of optimal actions relative to system parameters, allowing real-time linear parameter adaptation without retraining. Yet, manually tuning these parameters on hardware is unintuitive and time-consuming, especially in higher dimensions.

Methods

The authors automate the parameter search by wrapping parameter-adaptive AMPC inside a Bayesian Optimization (BO) loop:

  1. Parameter-Adaptive AMPC Policy:
    The policy is parameterized around nominal parameters $\theta_{\text{nom}}$ using a first-order Taylor expansion: $$\pi_{\text{AMPC}}(s, \theta) = \tilde{\pi}_{\text{MPC}}(s) + \tilde{\pi}_{\nabla \text{MPC}}(s)(\theta - \theta_{\text{nom}})$$ Here, $\tilde{\pi}_{\text{MPC}}$ predicts the nominal control action, while $\tilde{\pi}_{\nabla \text{MPC}}$ predicts the action sensitivities $\left.\frac{\partial \pi_{\text{MPC}}}{\partial \theta}\right|_{\theta_{\text{nom}}}$.

  2. Local Bayesian Optimization (TuRBO):
    Instead of manually selecting $\theta$, the authors formulate a black-box policy search problem $\theta^* = \arg\max_\theta R(\theta)$ evaluated on the physical system. They apply TuRBO (Trust Region Bayesian Optimization), fitting a Gaussian process to noisy episodic rewards and constraining exploration to a dynamic local trust region.

  3. Embedded Execution:
    The NN forward passes run on low-cost onboard CPUs at high control frequencies (e.g., 200 Hz on an embedded Cortex-A72), while the BO optimization runs asynchronously on an external host laptop between trials.

       +---------------------------------------------+
       | Parameter-Adaptive Policy:                  |
s(k) ->|   π(s, θ) = π_nom(s) + π_∇(s)·(θ - θ_nom)   |-> a(k) -> [ Physical Robot ]
       +---------------------------------------------+                  |
                             ^                                          v
                             | θ_{i+1}                         Reward R(θ_i)
                             |                                          |
                      [ Bayesian Opt ] <--------------------------------+

Datasets

  • Offline Training Sets:
  • Cartpole: Synthesized offline from an MPC formulation parameterized by mass and friction coefficients.
  • Reaction Wheel Unicycle ("Wheelbot"): A newly synthesized dataset containing 3.5 million samples of states, optimal actions, and sensitivities computed via CasADi and IPOPT. Generating this dataset required 86,000 CPU core hours on Intel Xeon processors.
  • Evaluation Benchmarks:
    Evaluated on 100 randomized simulated instances for each system and validated on two physical hardware platforms: an inverted pendulum cartpole and the Wheelbot.

Key Insights and Ideas

  • Decoupling Action Inference from Parameter Search: High-rate control requires sub-millisecond execution, while adaptation can happen across episodes. By leveraging analytical MPC sensitivities, the search space for BO is compressed down to the physical/cost parameter dimension (e.g., 5D or 11D) rather than the millions of NN weights.
  • Support for Non-MPC-Friendly Rewards: In classical MPC, stage costs typically must be smooth and differentiable (e.g., quadratic). Using BO on the outer loop allows the system to be tuned against sparse, non-differentiable, or non-Markovian objectives (e.g., penalizing robot tip-over or threshold-based upright timing) that MPC cannot directly optimize.
  • Model-Based Exploration: Because the sensitivities define physically meaningful gradient directions, BO optimizes performance drastically faster than blind black-box search methods like quasi-random Sobol sampling.

Key Results

  • Fast Embedded Inference: On the Wheelbot's Raspberry Pi CM4 (1.5 GHz quad-core Cortex-A72), evaluation of both the input and sensitivity networks took less than 300 µs, easily supporting a 200 Hz control loop.
  • Rapid Hardware Convergence: Across both experimental platforms, BO consistently converged to high-performing policies in 20 physical rollouts (equivalent to 10–15 minutes of hardware interaction).
  • Cartpole Swing-Up & Balancing (5 Parameters): BO rapidly eliminated rail oscillations and reduced swing-up time compared to the nominal baseline.
  • Wheelbot Yaw Control (11 Parameters): The Wheelbot is linearly uncontrollable in yaw and relies entirely on nonlinear gyroscopic coupling from an orthogonal reaction wheel. BO fine-tuning significantly dampened driving wheel oscillations and eliminated overshoot during $90^\circ$ yaw step maneuvers.

Limitations and Future Work

  • Local Validity of Sensitivities: Because parameter adaptation relies on a first-order linear Taylor series around nominal parameters, performance degrades if the actual hardware deviates drastically from nominal dynamics.
  • Dimensionality of System States: While the method scales well to an 11-dimensional parameter space, synthesizing the offline AMPC sensitivity datasets remains intractable for high-dimensional systems (e.g., vision-based policies or hundreds of state dimensions).
  • Time-Invariant Assumption: The current formulation assumes physical parameters remain constant throughout tuning. The authors highlight the need for time-varying or event-triggered BO to handle real-world wear and tear or shifting payloads during operation.

Summary updated

BibTeX
@inproceedings{hose2024fine,
  author = {Henrik Hose and Paul Brunzema and Alexander von Rohr and Alexander Gräfe and Angela P. Schoellig and Sebastian Trimpe},
  title = {{Fine-Tuning of Neural Network Approximate MPC without Retraining via Bayesian Optimization}},
  booktitle = {SAFE-ROL @ CoRL},
  year = {2024},
  url = {https://openreview.net/forum?id=lSah6an1Ar},
}
Figure