PURE: Prompt Evolution with Graph ODE for Out-of-distribution Fluid Dynamics Modeling

Hao Wu, Changhu Wang, Fan Xu, Jinbao Xue, Chong Chen, Xian-Sheng Hua, Xiao Luo

TL;DR

Machine learning models for fluid dynamics often fail when real-world conditions (like pressure or viscosity) shift away from their training data. This paper introduces PURE, a novel framework that uses time-evolving "prompts" guided by Graph ODEs to adapt forecasting models to new, out-of-distribution environments on the fly. By decoupling environmental context from core physical observations, PURE significantly boosts the accuracy and robustness of existing fluid dynamics models.

The Challenge of Out-of-Distribution Fluid Dynamics

Deep learning has become a powerful tool for simulating fluid dynamics—essential for weather forecasting, aerodynamics, and disease transmission modeling—offering massive speedups over traditional numerical solvers. However, these models typically assume the training and testing data share the exact same distribution.

In the real world, dynamical systems suffer from two major types of distribution shifts:

  1. Parameter-based shifts: Changes in the underlying physical rules, such as different viscosity coefficients or pressures in a fluid system.
  2. Temporal shifts: As a model predicts further into the future (auto-regressive forecasting), the input data distribution naturally drifts away from the initial state.

When faced with these out-of-distribution (OOD) scenarios, standard neural operators and grid-based models experience severe performance degradation. The authors set out to build a framework that can adapt existing forecasting models to these shifting environments without requiring complete retraining.

Introducing PURE: Prompt Evolution with Graph ODE

The authors propose PURE, which cleverly adapts "prompt learning"—a technique popular in Large Language Models—to physical dynamical systems. Instead of text, a "prompt" here is a learned embedding that represents the current physical environment.

The PURE framework architecture, illustrating the initialization of prompt embeddings and their evolution via Graph ODEs before integration into a basic forecasting model.

PURE acts as a plug-in enhancement for basic forecasting models (like Fourier Neural Operators or Vision Transformers) and operates in three main steps:

  1. Multi-view Context Exploration: PURE initializes prompt embeddings by extracting spatio-temporal features from historical observations and physical parameters. It uses attention mechanisms and Fast Fourier Transforms (FFT) to capture this context in both the spatial and frequency domains.
  2. Time-Evolving Prompts via Graph ODE: A static prompt isn't enough for a fluid system that changes over time. PURE uses a continuous Graph Ordinary Differential Equation (Graph ODE), combined with interpolated observation sequences, to model how these prompts evolve. This allows the prompt to update dynamically based on interactions between neighboring spatial points.
  3. Invariant Model Adaptation: The evolving prompts are concatenated with standard observation embeddings and fed into the base forecasting model. Crucially, the authors use adversarial learning to minimize the mutual information between the prompt and the observation embeddings. This forces the observation embeddings to learn robust, environment-invariant physical rules, while the prompt handles the specific environmental shifts.

Datasets and Evaluation

The authors evaluated PURE across five diverse physical benchmarks:

  • Prometheus: A large-scale fluid dynamics dataset simulating tunnel and pool fires with varying heat release rates and ventilation speeds.
  • 2D Navier-Stokes Equations: Simulates viscous fluid motion under varying viscosity coefficients.
  • Spherical Shallow Water Equations (Spherical-SWE): Simulates large-scale atmospheric and oceanic flows on a spherical surface.
  • 3D Reaction-Diffusion Equations: Models the diffusion and reaction rates of chemicals in 3D space.
  • ERA5: A real-world global atmospheric reanalysis dataset (weather data) from the ECMWF.

Key Results

PURE acts as a highly effective "plug-and-play" module. Adding PURE improved the performance of almost all baseline models tested, including U-Net, ResNet, FNO, and DGODE.

Benchmark results comparing PURE against various baselines across five datasets, highlighting significant performance gains in out-of-distribution (OOD) settings.
  • State-of-the-Art Accuracy: On the Prometheus dataset (OOD setting), PURE achieved a Mean Squared Error (MSE) of 0.0328, an 8.63% improvement over the next best state-of-the-art model (DGODE). On the 2D Navier-Stokes dataset, it achieved an OOD MSE of 0.0763, a massive 26.07% improvement.
  • Zero-shot Super-resolution: PURE demonstrated strong spatial generalization. It successfully trained on low-resolution grids (64x64) and accurately predicted fluid dynamics on much higher-resolution grids (512x512) without retraining.
  • Robustness to Sparsity: PURE maintained significantly lower error rates than baselines even when tested on highly sparse data (up to 75% missing data) and data injected with noise.

Limitations and Future Work

While highly effective, the framework still assumes that the underlying training and test data are independent and identically distributed (IID) at a macro level; extreme, sudden physical shifts might still break the model. Additionally, the inclusion of the Graph ODE introduces high computational complexity, requiring significant memory and time to train.

In the future, the authors plan to optimize the algorithm to improve computational efficiency. They also aim to extend the PURE framework to other real-world dynamical systems outside of fluids, such as rigid body dynamics and traffic flow forecasting.

Summary updated

BibTeX
@inproceedings{wu2024pure,
  author = {Hao Wu and Changhu Wang and Fan Xu and Jinbao Xue and Chong Chen and Xian-Sheng Hua and Xiao Luo},
  title = {{PURE: Prompt Evolution with Graph ODE for Out-of-distribution Fluid Dynamics Modeling}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=z86knmjoUq},
}
Figure