A Generalizable Physics-Enhanced State Space Model for Long-Term Dynamics Forecasting in Complex Environments

Yuchen Wang, Hongjue Zhao, Haohong Lin, Enze Xu, Lifang He, Huajie Shao

Introduction

Accurately predicting the long-term evolution of complex dynamical systems—ranging from autonomous drone flight to the spread of infectious diseases—remains a fundamental challenge in computational science. Real-world data is frequently characterized by noise, irregular sampling intervals, and missing observations. While modern deep learning models like Transformers and State Space Models (SSMs) excel at capturing long-range dependencies in sequence data, they often struggle with physical consistency, leading to "hallucinated" trajectories that violate the laws of nature. Conversely, traditional physics-informed methods often require complete knowledge of governing equations, which is rarely available in practice.

This paper introduces Phy-SSM, a novel architecture designed to bridge this gap. By embedding partially known physical laws directly into structured SSMs through a specialized matrix decomposition and masking technique, Phy-SSM achieves superior long-term forecasting and extrapolation capabilities even when the underlying physics are only partially understood.

Methodology: Integrating Physics into State Space Models

The Phy-SSM framework addresses the limitations of existing Physics-Enhanced Machine Learning (PEML) by treating physical laws as hard constraints rather than soft penalties. The architecture is built upon three primary pillars:

1. Dynamics Decomposition

The system's governing equations are decomposed into known and unknown components. By extending state variables to account for non-linearities, the authors represent the system in a linear state-space format. This allows the model to leverage the efficient sequence-modeling properties of SSMs while maintaining a clear interface for physical priors.

2. The Phy-SSM Unit and Knowledge Masking

Unlike standard neural networks that may overwrite physical constants during training, Phy-SSM employs a knowledge mask. This binary matrix (composed of 1s and 0s) is applied to the learned dynamics. The mask "freezes" the parameters corresponding to known physical terms, ensuring that established laws are strictly enforced as hard constraints. The deep SSM component is then tasked solely with learning the residual, unknown dynamics from the data.

3. Physics State Regularization

To ensure the model generalizes beyond the training distribution, a regularization term is added to the loss function. This term penalizes the Euclidean distance between the latent states predicted by the encoder and the trajectories dictated by the physical dynamics. This forcing of the latent space to respect physical laws prevents the model from simply memorizing training trajectories, which is crucial for robust extrapolation.

Experimental Evaluation

The researchers evaluated Phy-SSM across four diverse environments, testing its ability to handle noise, irregular sampling, and long-term forecasting:

  • Drone State Prediction: Utilizing a real-world quadrotor dataset, the model tracked angular velocity and acceleration in a high-frequency, noisy environment.
  • COVID-19 Epidemiology: Using data from Johns Hopkins University, the model predicted Susceptible, Infected, and Removed populations, even with 10% of daily records missing.
  • Vehicle Motion Prediction: Tested on the nuScenes autonomous driving benchmark, the task involved predicting vehicle trajectories with 5% missing agent observations.
  • Video Pendulum: A simulated environment featuring a pendulum with unknown friction, processed directly from noisy video frames.

Key Results and Insights

Phy-SSM consistently outperformed both purely data-driven models (such as S5 and Contiformer) and existing physics-enhanced baselines (such as GOKU and PI-VAE).

  • Superior Extrapolation: In drone state prediction, Phy-SSM achieved a Mean Absolute Error (MAE) of 2.733, significantly lower than the physics-enhanced GOKU (3.456) and the data-driven S5 (8.426).
  • Epidemiological Accuracy: In the COVID-19 dataset, Phy-SSM recorded an MAE of 1.998, outperforming the next best model (S5 at 4.560) by a wide margin.
  • Out-of-Domain Generalization: On the nuScenes dataset, Phy-SSM achieved an Average Displacement Error (ADE) of 6.206, surpassing specialized models like Wayformer (8.842).

The results highlight that enforcing hard physical constraints is significantly more effective than the soft penalties used in many PINN-based approaches. Furthermore, the ablation studies confirmed that physics state regularization is vital; without it, models tend to interpolate well but fail during long-term extrapolation.

Conclusion

Phy-SSM represents a significant advancement in the modeling of complex dynamical systems. By combining the sequence-modeling strengths of SSMs with a robust mechanism for enforcing partial physical knowledge, it provides a reliable framework for long-term forecasting in noisy, real-world environments. While the model requires some initial mathematical formulation of the known physics, its ability to learn unknown dynamics while respecting physical boundaries makes it a powerful tool for autonomous systems and beyond.

Summary updated

BibTeX
@inproceedings{wang2025generalizable,
  author = {Yuchen Wang and Hongjue Zhao and Haohong Lin and Enze Xu and Lifang He and Huajie Shao},
  title = {{A Generalizable Physics-Enhanced State Space Model for Long-Term Dynamics Forecasting in Complex Environments}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=9NrUIaH1sx},
}
Figure