Abstract
We introduce FLEX (FLow EXpert), a backbone architecture for generative modeling of spatio-temporal physical systems using diffusion models. FLEX operates in the residual space rather than on raw data, a modeling choice that we motivate theoretically, showing that it reduces the variance of the velocity field in the diffusion model, which helps stabilize training. FLEX integrates a latent Transformer into a U-Net with standard convolutional ResNet layers and incorporates a redesigned skip connection scheme. This hybrid design enables the model to capture both local spatial detail and long-range dependencies in latent space. To improve spatio-temporal conditioning, FLEX uses a task-specific encoder that processes auxiliary inputs such as coarse or past snapshots. Weak conditioning is applied to the shared encoder via skip connections to promote generalization, while strong conditioning is applied to the decoder through both skip and bottleneck features to ensure reconstruction fidelity. FLEX achieves accurate predictions for super-resolution and forecasting tasks using as few as two reverse diffusion steps. It also produces calibrated uncertainty estimates through sampling. Evaluations on high-resolution 2D turbulence data show that FLEX outperforms strong baselines and generalizes to out-of-distribution settings, including unseen Reynolds numbers, physical observables (e.g., fluid flow velocity fields), and boundary conditions.
Introduction
Simulating complex physical systems—such as turbulent fluid flows or global weather patterns—is a fundamental challenge in scientific computing. While diffusion models have emerged as a powerful tool for generative modeling, standard architectures often struggle to balance local spatial accuracy with the global context required for long-range dependencies in physical systems. Conventional U-Nets, while effective at capturing local textures, often lack the receptive field for global interactions. Conversely, Vision Transformers (ViTs) capture global context but can be computationally prohibitive and may lose fine-scale details.
The FLEX Architecture
To address these challenges, we introduce FLEX (FLow EXpert), a hybrid backbone designed for diffusion-based modeling of spatio-temporal physics. FLEX integrates a latent Transformer into a U-Net architecture, utilizing standard convolutional ResNet layers for local feature extraction while employing a Transformer bottleneck for global communication.
Key Architectural Innovations
- Hybrid U-Net/Transformer Design: FLEX uses a U-Net structure for local features but replaces the central bottleneck with a latent Transformer. By using a patch size of 1, the Transformer treats every spatial location as a token, enabling global "all-to-all" attention without sacrificing spatial resolution.
- Residual Space Modeling: Rather than generating raw data from scratch, FLEX operates in the residual space, predicting the difference (residual) between a baseline (e.g., an upsampled low-resolution input) and the ground truth. This approach prevents the model from having to re-learn basic physics already present in the input.
- Velocity-Based Parameterization: Moving beyond standard noise prediction, FLEX predicts a velocity field. Theoretical analysis shows that combining residual modeling with velocity prediction significantly reduces the variance of the training target, leading to more stable training.
- Hierarchical Conditioning: FLEX employs a task-specific encoder for auxiliary inputs. It utilizes a "weak conditioning" strategy (via shallow skips) to the shared encoder to maintain generative diversity and "strong conditioning" (via bottleneck features and deep skips) to the decoder to ensure reconstruction fidelity.
Experimental Evaluation
FLEX was rigorously evaluated on several challenging datasets, including SuperBench (NSKT) for high-resolution 2D turbulence, PDEBench for testing generalization across different boundary conditions, and ERA5 global weather data. Unlike many "black box" models, FLEX produces calibrated uncertainty estimates, showing higher uncertainty in regions of complex vortex interactions where chaotic systems are naturally less predictable.
Results and Generalization
FLEX achieves state-of-the-art performance in fluid dynamics tasks. Notably, FLEX-SR (super-resolution) consistently outperforms strong baselines like SwinIR and HAT, particularly in high-Reynolds-number regimes characterized by intense chaos.
A significant strength of FLEX is its zero-shot generalization. A model trained exclusively on vorticity fields successfully performed super-resolution on velocity fields without retraining. Furthermore, it generalized from periodic boundary conditions to the more complex Dirichlet boundaries. FLEX is also highly efficient, producing high-fidelity results in as few as two reverse diffusion steps, making it significantly faster than traditional iterative diffusion samplers.
Conclusion and Future Work
FLEX provides a robust and efficient backbone for modeling complex spatio-temporal physical systems. By combining the local processing power of convolutions with the global reach of Transformers, FLEX achieves superior accuracy and remarkable generalization. While accuracy can degrade over very long-term forecasting due to compounding errors, the architecture represents a major step forward. Future work will explore extending FLEX to 3D physical systems and further optimizing its computational efficiency.
Summary updated