Towards Safe Learning-Based Non-Linear Model Predictive Control through Recurrent Neural Network Modeling

Mihaela-Larisa Clement, Mónika Farsang, Agnes Poks, Johannes Edelmann, Manfred Plöchl, Radu Grosu, Ezio BartocciarXiv 2026

TL;DR

This paper introduces Sequential-AMPC (Seq-AMPC), a recurrent neural network (RNN) policy that approximates computationally heavy Nonlinear Model Predictive Control (NMPC) by generating control sequences recursively. By embedding this policy within a safety-augmented fallback wrapper, the authors achieve significantly higher trajectory feasibility, better sample efficiency, and superior closed-loop safety compared to standard feedforward network baselines.

What Problem Does This Paper Address?

Nonlinear Model Predictive Control (NMPC) is a powerful framework for controlling safety-critical systems like autonomous vehicles and robotics because it directly handles complex constraints and system nonlinearities. However, NMPC requires solving a challenging nonlinear optimization problem online at every single time step. This is often too computationally expensive for embedded hardware with tight latency budgets, especially when dealing with long prediction horizons or high-dimensional systems.

To bypass this online bottleneck, researchers often train neural networks offline to mimic the NMPC policy (Approximate MPC, or AMPC). The standard approach uses standard Multi-Layer Perceptrons (MLPs). However, MLPs suffer from two major flaws in this context:

  1. Parameter Explosion: As the prediction horizon ($N$) grows, the MLP's output layer must expand linearly to predict the entire future control sequence at once, leading to massive network sizes.
  2. Lack of Temporal Awareness: MLPs treat future control outputs as conditionally independent given a shared latent state, ignoring the sequential, causal nature of physical dynamics. This leads to poor data efficiency and low feasibility rates when deployed.

Methods

The authors propose Sequential-AMPC (Seq-AMPC) to align the neural network's architecture with the sequential nature of control problems.

Instead of predicting the entire control horizon simultaneously, Seq-AMPC utilizes a shared, simple RNN cell to recursively generate candidate control inputs step-by-step across the horizon. Because parameters are shared across time steps, the network's parameter count remains constant ($O(1)$) relative to the horizon length, whereas a standard MLP scales linearly ($O(N)$).

Proposed Sequential Approximate MPC (Seq-AMPC) architecture with safety-augmented online evaluation.

To guarantee safety during deployment, Seq-AMPC is wrapped in a Safe Online Evaluation mechanism (Algorithm 1):

  • At each time step, the RNN generates a candidate control sequence.
  • This sequence is checked online for state/input feasibility and cost.
  • If the sequence is safe and outperforms a backup option, it is executed.
  • If it fails any safety or performance checks, the system falls back to a safe candidate sequence derived from the previous step's solution combined with a terminal controller.

Datasets

The method was evaluated on three high-performance control benchmarks using datasets generated by an NMPC expert:

  1. Quadcopter Model: A 10-dimensional state, 3-dimensional input system. The dataset consists of 9.6 million feasible initial conditions.
  2. Kinematic Single-Track Vehicle: A 4-dimensional state ground vehicle navigating around obstacles. The dataset contains 55,000 expert demonstrations.
  3. Dynamic Single-Track Vehicle: An 8-dimensional state vehicle model capturing complex tire forces and yaw-rate coupling. The dataset contains 116,000 expert demonstrations.

Key Insights and Ideas

  • Temporal Inductive Bias: By mirroring the Markovian structure of physical systems (where the next state depends sequentially on the current state and action), the RNN architecture possesses a natural inductive bias. This structural alignment dramatically reduces the hypothesis space the network needs to search during training.
  • Overcoming Stagnation: In complex tasks like the dynamic vehicle model, MLPs often suffer from stagnating or diverging validation loss during training. Seq-AMPC exhibits much healthier learning dynamics, continuously improving validation performance to achieve lower overall loss.
Learning curves comparing AMPC (MLP) and Seq-AMPC (RNN) on vehicle tasks.

Key Results

  • Higher Feasibility with Less Data: On the quadcopter benchmark, naive Seq-AMPC achieved an open-loop feasibility rate of 83.6% compared to the MLP's 72%, while requiring ~97% fewer training epochs.
  • Data Scaling: When trained on just 1/10th of the quadcopter dataset, Seq-AMPC still achieved 82.8% closed-loop safety, nearly matching the MLP baseline trained on the full dataset (84.8%).
  • Closed-Loop Safety: Across all benchmarks, Safe Seq-AMPC consistently improved the percentage of fully safe rollouts. For instance, on the highly complex dynamic vehicle model, safety increased from 54.1% (MLP) to 58.7% (RNN).
Example of a vehicle obstacle-avoidance task comparing a naive controller (which crashes) to the safety-augmented controller.

Limitations and Future Work

Despite the architectural improvements, the authors note that intervention rates remain high on the difficult obstacle-avoidance vehicle tasks (reaching up to 95% on the dynamic model). This means the controller still frequently relies on the safe fallback mechanism rather than the neural network's proposals.

An analysis of the failure modes revealed that the primary bottleneck is not obstacle violation, but rather terminal-set attainment—the network struggles to ensure the predicted horizon ends cleanly within a mathematically verifiable safe terminal region. Future work will focus on designing terminal-aware loss functions, sampling more heavily near the terminal boundaries during training, and aligning the network's loss directly with the NMPC value function.

Summary updated

BibTeX
@misc{clement2026towards,
  author = {Mihaela-Larisa Clement and Mónika Farsang and Agnes Poks and Johannes Edelmann and Manfred Plöchl and Radu Grosu and Ezio Bartocci},
  title = {{Towards Safe Learning-Based Non-Linear Model Predictive Control through Recurrent Neural Network Modeling}},
  year = {2026},
  eprint = {2603.24503},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.24503},
}
Figure