Real-time optimal control with shallow recurrent decoder networks

Matteo Tomasetto, Francesco Braghin, J. Nathan Kutz, Andrea Manzoni

TL;DR

This paper introduces a lightweight, data-driven framework called SHRED-ROM that enables real-time, closed-loop optimal control of high-dimensional, parametric dynamical systems using only a few sparse sensor readings. By combining long short-term memory (LSTM) networks with shallow decoders and proper orthogonal decomposition (POD), the method successfully mimics expert control behaviors while bypassing expensive online optimization. Additionally, a novel latent sensor forecaster allows the controller to maintain high performance even during severe sensor dropouts or communication delays.

What Problem Does This Paper Address?

Many complex physical systems—such as autonomous vehicles, plasma reactors, and fluid flows—are governed by partial differential equations (PDEs). Controlling these systems in real-time requires solving Optimal Control Problems (OCPs), which traditionally demand repeated, computationally heavy simulations to adapt to changing parameters or external disturbances.

While reduced-order models (ROMs) can speed things up, traditional projection-based ROMs require complete physical knowledge of the system and struggle with strong non-linearities. On the other hand, deep learning-based ROMs often require full parametric knowledge of the operating scenario. This creates a major bottleneck for safety-critical applications with strict latency requirements. The authors address this challenge by designing a controller that operates in real-time, generalizes across multiple unseen scenarios, and relies strictly on limited, localized sensor history rather than full state or parameter knowledge.

Methods

The proposed framework, SHRED-ROM (SHallow REcurrent Decoder networks-based Reduced Order Modeling), relies on an imitation learning (behavioral cloning) paradigm. It learns to mimic an "expert demonstrator" (e.g., a high-fidelity full-order OCP solver) using a three-part architecture:

  1. Trajectory Encoding (LSTM): A long short-term memory network takes a time-lagged sequence of sparse sensor measurements and encodes it into a low-dimensional latent state. Thanks to Takens' embedding theorem, this history of localized measurements contains enough mathematical information to reconstruct the global system dynamics.
  2. Dimension Reduction (POD): To make training computationally tractable on standard hardware, high-dimensional state and control snapshots are compressed into a lower-dimensional subspace using Proper Orthogonal Decomposition (POD).
  3. Shallow Decoder Network (SDN): The SDN maps the LSTM's latent representation directly to the POD coefficients of the optimal control actions (and optionally, the full state variables).
Graphical summary of sensor-based feedback control with SHRED-ROM.

Latent Feedback Loop

To mitigate sensor failures, the authors introduce a latent sensor forecaster ($\varphi_z$). If a sensor malfunctions or experiences communication delays, this autoregressive LSTM predicts future sensor readings at the latent level using past sensor history and past latent control variables, effectively closing the feedback loop without interrupting control.

Graphical summary of sensor-based feedback control with a latent feedback loop during sensor failure.

Datasets

The framework was evaluated on three simulated high-dimensional parametric PDE problems:

  • Fluidic Pinball: A density control problem governed by an advection-diffusion PDE, where a Gaussian density is transported around three rotating cylinders ($N_y = 7,525$; $N_u = 59,344$).
  • Unsteady Flow Control: A fluid flow problem in a rectangular channel with a circular obstacle governed by the unsteady Navier-Stokes equations ($N_v = 46,874$; $N_u = 54$).
  • Double Gyre Flow Tracking: An incompressible fluid tracking problem aiming to minimize the distance to a time-dependent, chaotic double-gyre flow field ($N_v = N_u = 40,602$).

For each case, 100 optimal trajectories generated via high-fidelity full-order solvers were split 80:10:10 for training, validation, and testing.

Key Insights and Ideas

  • Parameter-Agnostic Control: SHRED-ROM does not need explicit knowledge of the scenario parameters ($\mu$). Because the physical parameters alter the sensor trajectories, the temporal history of the sensors implicitly embeds all the parametric information the network needs.
  • Robustness via Latent Forecasting: Operating the sensor forecaster directly within the latent space allows the controller to tolerate massive data loss. The system can continue steering accurately even if sensors are completely offline for extended periods.
  • Low-Data Efficiency: By training on top of a POD-reduced space, the model can be trained efficiently on laptop-level hardware while still outputting complex, distributed control fields.

Key Results

The SHRED-ROM controller demonstrated excellent generalization to completely unseen parameters across all test cases:

  • Fluidic Pinball: The controller effectively minimized density dispersion and boundary collisions, matching the performance of the full-order target optimal solutions.
  • Unsteady Flow Control: SHRED-ROM successfully suppressed vortex shedding in the cylinder wake. It achieved a mean relative error of 2.68% for control prediction and 2.38% for fluid velocity reconstruction. The latent sensor forecaster achieved an error of just 0.19%. Even with a simulated 50% sensor failure probability, the closed-loop controller significantly reduced energy dissipation compared to the uncontrolled baseline.
  • Double Gyre Flow Tracking: The model rapidly steered the fluid from a single vortex into the chaotic double-gyre reference flow, yielding a mean relative error of 7.47% for control and 3.00% for velocity.
FIG. 3: Fluidic pinball. Uncontrolled state (first row), optimal target state (second row), controlled state with SHRED-ROM policy (third row), target optimal control (fourth row), and SHRED-ROM control prediction (fifth row) in two different test scenarios related to µ = [−0.06, 0.06, −0.70]⊤and µ = [−0.74, 0.01, 0.83]⊤at t = 10 and t = 30 seconds. The mobile sensor trajectories are depicted in orange. The control velocity fields on Ωare depicted through vector fields, with the underlying colors corresponding to their magnitude.

Limitations and Future Work

The primary limitation of SHRED-ROM is its dependence on imitation learning, meaning it requires a pre-existing expert demonstrator to generate optimal training examples. If the full-order OCP solver is too expensive or fails to converge for certain scenarios, gathering training data becomes difficult.

The authors suggest several future directions to build on this work:

  1. Incorporating uncertainty quantification to handle noisy sensors and identify when the controller shouldn't be trusted.
  2. Utilizing latent dynamics modeling to improve predictions over longer time horizons in extrapolation regimes.
  3. Integrating reinforcement learning to fine-tune the control policy online or train it directly without relying on an expert demonstrator.

Summary updated

BibTeX
@inproceedings{tomasetto2025real,
  author = {Matteo Tomasetto and Francesco Braghin and J. Nathan Kutz and Andrea Manzoni},
  title = {{Real-time optimal control with shallow recurrent decoder networks}},
  booktitle = {DiffSys @ EurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=C3l0Vf2RDi},
}
Figure