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

Meta-Learning Dynamics Forecasting Using Task Inference

Rui Wang, Robin Walters, Rose Yu

Deep learning has shown immense promise in modeling dynamical systems, with applications ranging from climate science to epidemiology. However, these models typically suffer from a significant "generalization gap." A model trained to forecast fluid flow at a specific viscosity or buoyancy often fails when applied to a system with even slightly different parameters.

In the real world, physical laws are universal, but the specific conditions—such as external forces, boundary constraints, and constants of motion—vary wildly. Standard models treat every new environment as a completely new task, requiring extensive retraining. To address this, researchers have proposed DyAd (Dynamic Adaptation Network), a novel meta-learning framework designed to forecast complex physical dynamics across diverse, heterogeneous environments without the need for constant retraining.

The DyAd Framework

DyAd tackles the challenge of meta-learning for dynamics by creating a single model that can efficiently infer the "hidden rules" of a specific environment from a short sequence of observations, adapting its predictions accordingly. It is a model-based meta-learning approach consisting of two primary components:

1. The Encoder ($g$)

This module takes a sequence of past states and infers a time-invariant latent representation ($z$) of the specific task or environment. To ensure $z$ captures meaningful physics rather than arbitrary noise, the authors utilize a multi-part loss function:

  • Weak Supervision: If some physical parameters (like average vorticity or buoyancy) are known, they are used to guide the encoder.
  • Time-Shift Invariance: Because physical constants should not change during a single simulation, the encoder is penalized if its output $z$ fluctuates over time.

2. The Forecaster ($f$)

This serves as the "backbone" predictive model (e.g., a ResNet or U-Net architecture). It is conditioned on the encoder’s latent vector $z$ through two specialized layers:

  • AdaIN (Adaptive Instance Normalization): Borrowed from neural style transfer in computer vision, this layer scales and shifts feature channels based on $z$. This effectively "tunes" the model's internal physics to match the current environment.
  • AdaPad (Adaptive Padding): A novel contribution that uses $z$ to learn and apply boundary conditions as padding. This is critical because boundary interactions often drive the most complex dynamics in physical systems.

Unlike gradient-based meta-learning methods (such as MAML), DyAd adapts during a single forward pass (inference). This makes it significantly faster and more stable for high-dimensional physical data.

Datasets and Evaluation

The model was evaluated on three highly challenging datasets that exhibit complex spatial and temporal dynamics:

  1. Synthetic Turbulent Flow: Generated using the PhiFlow simulator, featuring 25 distinct tasks with varying buoyancy factors that drastically change the degree of turbulence.
  2. Sea Surface Temperature (SST): Real-world data sourced from the NEMO ocean engine, partitioned into 25 subregions of the Pacific Ocean.
  3. Ocean Currents: Velocity field data from the same NEMO regions, which are notoriously difficult to forecast due to unknown and highly variable external forces.
Visualization of complex fluid dynamics, representative of the turbulent flow tasks modeled by DyAd.

Key Insights

The success of DyAd relies on several conceptual breakthroughs:

  • Physics as "Style": The core innovation is treating physical parameters (like the Reynolds number or buoyancy) as a "style" that can be injected into a general forecasting backbone. Just as style transfer can turn a standard photo into a "Van Gogh," DyAd turns a general fluid model into a specialized "High-Buoyancy Fluid Model."
  • Boundaries Matter: Most neural networks default to zero-padding or circular padding. The authors realized that for physical systems, the boundaries are often the defining feature of the task. AdaPad allows the model to dynamically learn whether a boundary acts as a solid wall, an open ocean, or a heat source.
  • Temporal Consistency as a Regularizer: By forcing the encoder to produce the identical latent vector for different time windows of the same simulation, the model learns to ignore transient noise and focus purely on underlying physical constants.

Results and Performance

DyAd consistently outperformed both standard deep learning models and existing meta-learning baselines across the evaluated tasks.

Another state of turbulent flow, highlighting the varying internal physics and boundary conditions DyAd must adapt to.
  • Superior Generalization: On the turbulent flow dataset, DyAd achieved a Root Mean Square Error (RMSE) of 0.42, a stark improvement compared to 0.86 for a standard U-Net and 0.63 for MAML.
  • Physical Consistency: In ocean current forecasting, the authors measured the Energy Spectrum Error (ESE). DyAd achieved the lowest ESE (0.54), indicating that its predictions didn't just visually resemble the target—they obeyed the statistical laws of fluid energy distribution better than competing models.
  • Zero-Shot Adaptation: The model successfully generalized to "domain test sets"—tasks with physical parameters it had never encountered during training—demonstrating true out-of-distribution robustness.

Limitations and Future Work

While highly effective, the current implementation of DyAd relies on convolutional architectures, meaning it is inherently designed for data on regular grids (like images or rectangular maps). The authors suggest that future iterations could extend DyAd to non-grid data, such as flows on spheres (for global weather forecasting) or irregular meshes (for engineering parts), likely by integrating Graph Neural Networks (GNNs).

Additionally, while the encoder aims for time-shift invariance, it is currently only "practically" invariant because boundary frames change as the observation window slides. Developing refined architectures for perfect invariance remains an open avenue for further improving performance.

Summary updated

BibTeX
@inproceedings{wang2022meta,
  author = {Rui Wang and Robin Walters and Rose Yu},
  title = {{Meta-Learning Dynamics Forecasting Using Task Inference}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=BsSP7pZGFQO},
}
Figure