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 · DOI

Abstract

Approximate Model Predictive Control (AMPC) leverages neural networks to imitate computationally intensive MPC policies, enabling real-time control on low-power hardware. However, adapting these networks to physical parameter changes or model mismatches typically requires expensive data generation and retraining. This paper presents a novel framework that combines parameter-adaptive neural networks with Bayesian Optimization (BO) to fine-tune control policies directly on hardware. By utilizing sensitivity-based linear approximations, the controller can be adjusted instantly. Experimental results on an inverted cartpole and a balancing unicycle (Mini Wheelbot) demonstrate that optimal performance can be achieved within 20 hardware trials, effectively bridging the gap between simulation and real-world deployment.

Introduction

Model Predictive Control (MPC) is a gold standard for robotics due to its ability to handle nonlinear dynamics and constraints. However, its high computational cost often necessitates the use of Approximate MPC (AMPC), where a neural network (NN) is trained to replicate the MPC's control law. A significant challenge arises when the physical parameters of the robot change or when there is a mismatch between the simulation model and the real hardware. Traditional approaches require generating massive new datasets and retraining the NN, which is time-consuming and computationally expensive. This work introduces a method to automatically fine-tune AMPC policies on real hardware without retraining, using a combination of parameter-adaptive NNs and Bayesian Optimization.

Methodology

The proposed approach relies on two primary components: Parameter-Adaptive AMPC and Bayesian Optimization.

  1. Parameter-Adaptive AMPC: Instead of a static policy, the system employs a dual-NN architecture. The first network approximates the nominal control action, while the second approximates the sensitivities (gradients) of the control action with respect to system parameters. This allows for a linear adjustment of the control policy: $$\pi(s, \theta) \approx \text{Nominal Action} + \text{Sensitivity} \times (\text{Parameter Change})$$ This mathematical shortcut enables the policy to adapt to new parameters $\theta$ instantaneously, bypassing the need for retraining.

  2. Bayesian Optimization (BO): To determine the optimal parameter adjustments, the authors utilize TuRBO (Trust Region Bayesian Optimization). BO treats the robot's performance as a noisy "black-box" function and efficiently searches for the best parameter configuration over successive hardware trials.

Overview of the closed-loop hardware experiment and fine-tuning loop using Bayesian Optimization.

Experiments and Results

The framework was evaluated on two physical systems: an inverted cartpole and the Mini Wheelbot, a reaction-wheel unicycle. For the Wheelbot, a synthetic dataset of 3.5 million samples was generated offline (requiring 86,000 CPU core-hours) to train the initial adaptive NN.

Key findings include:

  • Sample Efficiency: Both systems reached satisfactory performance within 20 hardware experiments, representing approximately 15 minutes of wall-clock time.
  • Handling Model Mismatch: The BO-tuned policy successfully compensated for unmodeled physics, such as friction and battery voltage drops, which were absent in the original training data.
  • High-Dimensional Tuning: The system efficiently tuned 11 parameters for the Wheelbot, a task that is impractical for manual tuning. BO found configurations that significantly reduced oscillations compared to the initial design.
  • Real-time Performance: The resulting NN controllers executed in under 300 microseconds on embedded ARM Cortex-M4 and Raspberry Pi processors, proving viability for high-frequency robotics.
The Mini Wheelbot performing yaw control, a highly nonlinear task successfully managed by the fine-tuned AMPC.

Discussion and Conclusion

This research demonstrates a practical path for deploying high-performance MPC on low-power hardware. By decoupling the reward function from the MPC cost and using sensitivity-based adaptation, the method allows robots to adapt to real-world conditions quickly and efficiently.

While effective, the sensitivity-based approach is a linear approximation; significant deviations from the training data may still require full retraining. Future work will explore scaling to higher-dimensional "end-to-end" learning and handling time-varying parameters through event-triggered optimization to account for hardware wear and tear.

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