LEADS: Learning Dynamical Systems that Generalize Across Environments

Yuan Yin, Ibrahim Ayed, Emmanuel de Bézenac, Nicolas Baskiotis, Patrick Gallinari

Introduction

In the ideal world of machine learning textbooks, data is assumed to be independent and identically distributed (i.i.d.). In the real world of physics and biology, however, this is rarely true. A predator-prey model might follow the same basic rules in two different forests, but varying climates or terrain will inevitably change the specific dynamics.

Current approaches to modeling these systems usually fall into two traps:

  1. One-For-All: Training a single, monolithic model on all available data. This results in a "biased average" that performs poorly in any specific environment.
  2. One-Per-Env: Training a separate model for every environment. This ignores underlying commonalities, requires massive amounts of data for every new location, and fails to generalize to unseen settings.

LEADS (LEarning Across Dynamical Systems) is a novel framework designed to tackle this challenge. It models complex systems by splitting their behavior into two parts: a shared component that captures universal laws, and an environment-specific component for local variations. By forcing the shared model to do the heavy lifting, LEADS achieves superior generalization and can adapt to entirely new environments with remarkably little data.

The LEADS Methodology

The core of the LEADS framework is an additive decomposition of the system's dynamics:

$$f_e = f + g_e$$

  • $f$ (The Shared Component): This is the "universal" part of the model, trained across all available environments. It aims to capture the underlying physics or common patterns.
  • $g_e$ (The Specific Component): This is a small "residual" model unique to environment $e$. It captures the discrepancies—the specific local variations that make this environment different.

The "secret sauce" of LEADS is its training objective. The authors introduce a penalty term, $\Omega(g_e)$, which acts as a complexity bottleneck. By penalizing $g_e$, the optimization process is forced to push as much information as possible into the shared model $f$.

For neural networks, this penalty is instantiated using a combination of the $L_\infty$ norm (to keep the output magnitude small) and the Lipschitz semi-norm (to keep the function smooth). This ensures that $g_e$ only models what $f$ absolutely cannot explain.

Datasets and Evaluation

The authors evaluated LEADS on three representative families of nonlinear dynamical systems:

  • Lotka-Volterra (LV): A classic ODE system modeling predator-prey interactions, with environments varying based on growth and death rate parameters.
  • Gray-Scott (GS): A complex reaction-diffusion PDE known for generating intricate spatiotemporal patterns.
  • Navier-Stokes (NS): The gold standard for incompressible fluid dynamics, representing a highly challenging PDE where environments were defined by different constant forcing terms.

Demonstrating the framework's versatility, they used a variety of architectures, including standard MLPs for the ODEs, ConvNets for Gray-Scott, and Fourier Neural Operators (FNO) for the Navier-Stokes equations.

Key Insights and Ideas

Counter-intuitively, the theory and experiments show that as you add more distinct environments, the sample complexity for the shared model $f$ actually improves. Seeing more "variations on a theme" helps the model isolate the "theme" more accurately.

Test MSE and Generalization Error Bound vs. Number of Training Environments, highlighting the impact of the penalty term.

By intentionally making the environment-specific part ($g_e$) "simple" through regularization, the system is forced to discover the true, complex underlying commonalities in $f$. Because $f$ captures the heavy-duty physics, adapting to a brand-new environment becomes a "few-shot" problem. You only need to fit a new, simple $g_e$ while keeping the pre-trained $f$ fixed.

Key Results

LEADS demonstrates significant improvements in both accuracy and data efficiency:

  • Superior Accuracy: On the Lotka-Volterra dataset, LEADS reduced the test Mean Squared Error (MSE) by over 85% compared to the "One-Per-Env" baseline, and over 60% compared to an unregularized version of LEADS (without the complexity penalty).
  • Data Efficiency: LEADS significantly outperformed baselines in "low-data regimes," where only a few trajectories were available per environment.
  • Generalization to the Unseen: When presented with a novel environment, a LEADS model with a frozen shared component converged much faster and reached a lower error than a model trained from scratch.
Phase portraits comparing LEADS against baselines (One-Per-Env, FT-NODE) and ground truth trajectories.

In the Navier-Stokes experiments, LEADS outperformed state-of-the-art baselines like FT-NODE and FT-RNN by 15-90% in test error, closely tracking the ground truth dynamics where other models drifted.

Limitations and Future Work

While highly effective, the current LEADS formulation assumes deterministic systems. Real-world data is often noisy or stochastic, which the framework doesn't yet explicitly model. Additionally, while the PDEs used are complex, the validation was performed on simulated data. Testing on "messy" real-world observational data (e.g., actual climate sensor data) remains a crucial next step.

Overall, LEADS provides a principled way to move beyond the i.i.d. assumption in physical modeling, offering a promising path toward AI that can truly understand the "universal laws" of a system while respecting its local quirks.

Summary updated

BibTeX
@inproceedings{yin2021leads,
  author = {Yuan Yin and Ibrahim Ayed and Emmanuel de Bézenac and Nicolas Baskiotis and Patrick Gallinari},
  title = {{LEADS: Learning Dynamical Systems that Generalize Across Environments}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure