AMR-Transformer: Enabling Efficient Long-range Interaction for Complex Neural Fluid Simulation

Zeyi Xu, Jinfan Liu, Kuangxu Chen, Ye Chen, Zhangli Hu, Bingbing Ni

Introduction

Simulating fluid dynamics (CFD) is a cornerstone of engineering, but it is notoriously computationally expensive. While deep learning models like Convolutional Neural Networks (CNNs) and Graph Neural Networks (GNNs) offer speed advantages over traditional solvers, they often suffer from a limited receptive field. This limitation makes it difficult for these models to capture how local disturbances propagate and affect global flow patterns—a critical requirement for accurate long-range interaction modeling.

Transformers offer a natural solution for global modeling due to their self-attention mechanism. However, they face a significant hurdle in high-resolution physics: quadratic complexity. A standard Transformer's memory and compute requirements grow with the square of the number of grid points ($O(N^2)$). For a high-fidelity $1024 \times 1024$ simulation, the token count becomes prohibitive. The AMR-Transformer addresses this "efficiency vs. global context" trade-off by introducing a physics-aware tokenizer that focuses computational resources where they are most needed.

Methodology

The AMR-Transformer framework consists of two primary components: an AMR Tokenizer and a Transformer-based Neural Solver.

AMR Tokenizer

Instead of treating every pixel in a uniform grid as a token, the model employs a quadtree-based Adaptive Mesh Refinement (AMR). The process begins with a coarse representation and progressively subdivides cells into finer patches only in regions where the physical phenomena are complex.

Physics-Aware Pruning

The subdivision process is guided by a "pruning" module that leverages Navier-Stokes (N-S) constraints. By evaluating four key physical properties, the model identifies regions requiring higher resolution:

  • Velocity Gradient: Captures sharp changes such as shock fronts.
  • Vorticity: Resolves swirling eddies and turbulent structures.
  • Momentum: Tracks high-flow jets within the domain.
  • Kelvin-Helmholtz (KH) Instability: Identifies shear-driven instabilities at fluid interfaces.
Overview of the AMR-Transformer architecture, illustrating the state transition from $t$ to $t+\Delta t$ through physics-aware pruning and progressive subdivision.

Transformer Neural Solver

The multi-scale patches generated by the tokenizer are converted into tokens and fed into an encoder-only Transformer. By pruning redundant, "quiet" regions of the flow, the token count remains low enough for the Transformer to perform global self-attention efficiently, enabling the model to capture long-range interactions without the typical quadratic cost of dense grids.

Experimental Setup

The model was evaluated on several rigorous benchmarks:

  • CFDBench: Classic fluid problems including flow around a cylinder, dam breaks, and cavity flows.
  • PDEBench: Diffusion-reaction equations and inhomogeneous incompressible flow.
  • Shockwave Dataset: A new high-resolution ($128 \times 128$) dataset based on the 2D Riemann problem, featuring compressible flow with sharp discontinuities and complex small-scale vortices.

Results

The AMR-Transformer demonstrates significant improvements in both accuracy and efficiency compared to state-of-the-art (SOTA) baselines.

Accuracy and Fidelity

On the "Dam" problem, the model achieved a 91% relative improvement in Mean Squared Error (MSE) over DeepONet. It consistently outperformed models like FNO and U-Net across various benchmarks. As shown in Figure 1, the AMR approach maintains high visual fidelity and low MSE even in highly complex scenarios like shock waves and explosions, where regular grids of similar resolution fail to capture fine-scale details.

Visual comparison and error analysis of AMR-Transformer on Shock Wave and Explosion datasets. The AMR method achieves significantly lower MSE than regular grids by focusing resolution on critical features.

Computational Efficiency

Compared to a standard Vision Transformer (ViT), the AMR-Transformer pipeline achieved up to a 60x reduction in FLOPs. The tokenizer effectively reduced token counts by factors of 2 to 10 across different problems with negligible impact on simulation accuracy. This efficiency allows the model to handle $1024 \times 1024$ simulations that would otherwise be computationally infeasible for standard Transformers.

Discussion and Limitations

The AMR-Transformer treats fluid simulation as a sparse signal processing problem, using physical constraints as a sparsity prior. This allows for native multi-scale reasoning, where the Transformer "sees" both large-scale structures and fine-grained details simultaneously.

However, some limitations remain. The pruning module relies on threshold hyperparameters ($t_G, t_\omega$, etc.) that currently require manual tuning or sampling. Automating this selection could improve robustness. Additionally, while the quadtree approach generalizes to 3D octrees, current experiments are limited to 2D domains. Future work will focus on scaling to 3D and ensuring long-term temporal stability over extended rollout periods.

Summary updated

BibTeX
@inproceedings{xu2025amr,
  author = {Zeyi Xu and Jinfan Liu and Kuangxu Chen and Ye Chen and Zhangli Hu and Bingbing Ni},
  title = {{AMR-Transformer: Enabling Efficient Long-range Interaction for Complex Neural Fluid Simulation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.00545},
}
Figure