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

Environment Inference for Learning Generalizable Dynamical System

Shixuan Liu, Yue He, Haotian Wang, Wenjing Yang, Yunfei Wang, Peng Cui, Zhong Liu

TL;DR

DynaInfer is a novel framework that enables machine learning models to generalize across different physical environments—such as varying fluid viscosities or predator-prey rates—without needing explicit labels for those environments. By treating neural networks as "centroids" in an iterative, K-means-style process, it automatically clusters trajectories by their underlying dynamics, often matching or even outperforming models that have access to ground-truth labels.

The Missing Label Problem in Dynamical Systems

Data-driven emulators (neural networks trained to simulate complex physics) are becoming essential tools in fields ranging from climatology to robotics. However, most of these models rely on the "Independent and Identically Distributed" (I.I.D.) assumption, meaning they expect training and testing data to come from the exact same distribution.

In the real world, physics changes. A robot arm might move differently depending on the weight of the object it holds, and a fluid behaves differently as temperature shifts.

The challenge of missing environment labels in mixed trajectory datasets.

While "multi-environment" learning techniques exist to handle these variations, they almost always require environment labels (e.g., "this data was recorded at 20°C, this at 30°C"). In large-scale public datasets or privacy-sensitive domains like healthcare, these labels are often missing, unrecorded, or intentionally obscured. This paper tackles the challenge of learning generalizable dynamical systems from a "mixed bag" of unlabeled trajectories.

Methods: The DynaInfer Framework

The authors introduce DynaInfer, a framework that treats environment discovery as an unsupervised clustering problem. The core innovation is a dual iterative strategy that mirrors the logic of the K-means algorithm:

The DynaInfer alternating optimization framework.
  1. The K-means Analogy: In standard K-means, points are assigned to the nearest spatial centroid. In DynaInfer, the "points" are trajectories of a dynamical system, and the "centroids" are neural networks representing different environments.
  2. Step 1: Bias-aware Inference: The model takes a set of fixed neural networks. For every trajectory in the dataset, it calculates the prediction error across all networks. It then assigns that trajectory to the "environment" (the specific neural network) that produces the lowest error.
  3. Step 2: Assignment-driven Optimization: Once trajectories are assigned, the model updates the parameters of the neural networks to better fit their assigned data.

By alternating between these two steps, the model simultaneously learns the latent environment labels and the specific physical laws governing each environment. The authors provide a theoretical proof ensuring that this alternating optimization consistently reduces the overall loss.

Key Insights and Results

The researchers evaluated DynaInfer across three simulated systems—Lotka-Volterra (predator-prey ODE), Gray-Scott (reaction-diffusion PDE), and Navier-Stokes (fluid dynamics PDE)—as well as a real-world Robot Motion dataset.

  • Prediction Error as a Distance Metric: The most elegant insight is the realization that a model's inability to predict a trajectory is a perfect proxy for environmental distance. If Network A predicts Trajectory X better than Network B, it’s highly likely Trajectory X belongs to Environment A.
  • Beating the "Oracle": Surprisingly, DynaInfer occasionally outperformed the "Oracle" baseline (a model trained with perfect knowledge of environment labels). This suggests that the algorithm might be finding more "dynamically consistent" groupings than human-provided labels, which can be noisy or capture irrelevant metadata.
  • Robustness to Overestimation: You don't need to know the exact number of environments beforehand. If you assume there are 20 environments but there are actually only 9, DynaInfer effectively ignores the redundant networks and still converges to the correct underlying labels.
  • Rapid Convergence & Generalization: In experiments, DynaInfer’s environment assignments converged to the true labels very early in the training process. Across all test cases, it significantly outperformed standard baselines like treating all data as one environment or using random assignment.

Limitations and Future Work

While highly effective, the authors note a few limitations. Mean Squared Error (MSE) is a poor metric for chaotic systems where tiny changes lead to massive divergence; future work should explore metrics like the Sliced Wasserstein distance. Additionally, the current model struggles with systems involving complex or changing boundary conditions. Finally, while DynaInfer identifies that environments are different, it doesn't yet explicitly map those differences back to interpretable physical constants (like specific viscosity values), which remains an exciting avenue for future research.

Summary updated

BibTeX
@inproceedings{liu2025environment,
  author = {Shixuan Liu and Yue He and Haotian Wang and Wenjing Yang and Yunfei Wang and Peng Cui and Zhong Liu},
  title = {{Environment Inference for Learning Generalizable Dynamical System}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=2M5dTDdGxl},
}
Figure