Use a fine-tuned language model plus spatiotemporal patching to predict 2D unsteady fluid flow faster and with lower error than prior ML sur

June 6, 20246 min

Overview

Production Readiness

0.6

Novelty Score

0.6

Cost Impact Score

0.5

Citation Count

5

Authors

Max Zhu, Adrián Bazaga, Pietro Liò

Links

Abstract / PDF

Why It Matters For Business

FLUID-LLM can cut multi-step prediction error for 2D CFD tasks and adapt from short context histories, helping engineering teams get fast, accurate surrogates without full solver runs.

Summary TLDR

FLUID-LLM converts 2D CFD states into patch tokens, adds learned spatiotemporal embeddings, feeds them into a pretrained OPT language model, and decodes predictions with a small GNN. On two standard datasets (Cylinder, Airfoil) the 2.7B-parameter FLUID-OPT2.7b cuts multi-step RMSE versus baselines and versus a smaller 125M variant. The method also shows in-context and few-shot learning for short histories and synthetic wave tasks. The approach trades mesh-native modeling for a regular-grid tokenization and relies on LoRA-style fine-tuning.

Problem Statement

Solving Navier–Stokes simulations is compute-heavy. Can a pretrained LLM, augmented with spatial and temporal embeddings and a grid decoder, predict unsteady 2D fluid states faster and with competitive accuracy compared to mesh-based GNNs and CNNs?

Main Contribution

FLUID-LLM: pipeline that tokenizes 2D CFD states into 16×16 patches, adds learned spatiotemporal embeddings, fine-tunes a pretrained OPT LLM, and decodes with a small GNN.

Show that scaling the LLM (125M → 2.7B) substantially reduces multi-step RMSE on Cylinder and Airfoil benchmarks.

Demonstrate in-context and few-shot adaptation: using short histories improves prediction on shifted parameter regimes and a synthetic wave PDE.

Key Findings

Scaling the LLM reduced long-horizon error on the Cylinder dataset.

NumbersRMSE at 150 steps: FLUID-OPT125m=0.102 → FLUID-OPT2.7b=0.059 (≈42% reduction)

On a harder Airfoil (transonic) dataset, FLUID-OPT2.7b halves error versus the best baseline at long horizons.

NumbersRMSE at 150 steps: MeshGraphNets=0.958 vs FLUID-OPT2.7b=0.457 (~52% lower)

Language pretraining improves short-horizon accuracy versus a randomly initialized LLM.

NumbersCylinder N=1: Random-OPT125m=0.029 vs FLUID-OPT125m=0.002

Simple in-context history reduces error modestly for cross-domain generalization.

NumbersAirfoil 50-step RMSE drops ~3% when context length τ_init increases from 1 to 6

Results

RMSE (Cylinder, N=1)

ValueFLUID-OPT2.7b=0.002

BaselineMeshGraphNets=0.003

RMSE (Cylinder, N=150)

ValueFLUID-OPT2.7b=0.059

BaselineFLUID-OPT125m=0.102

RMSE (Airfoil, N=150)

ValueFLUID-OPT2.7b=0.457

BaselineMeshGraphNets=0.958

RMSE (Airfoil, N=50 vs context)

Value≈3% relative RMSE reduction when τ_init increases 1→6

Baselineτ_init=1

Who Should Care

What To Try In 7 Days

Run FLUID-OPT125m on a small 2D CFD case you control (e.g., cylinder flow) to compare prediction speed vs your solver.

Swap the LLM backbone (if you have a different pretrained model) to check accuracy-vs-cost trade-offs.

Test short-context in-place adaptation: feed 3–6 recent states and measure 50-step RMSE changes.

Optimization Features

Token Efficiency

  • Patch-based tokenization (16×16 patches) to reduce sequence length

Model Optimization

  • LoRA

System Optimization

  • Use AdamW with scheduled LR decay

Training Optimization

  • FlashAttention-2 used to speed training and inference
  • Train smaller encoder/decoder while keeping LLM mostly frozen

Inference Optimization

  • Predict N patches in parallel via autoregressive chunking to speed inference

Reproducibility

Data Available

Open Source Status

  • partial

Risks & Boundaries

Limitations

  • Projects irregular meshes to a regular grid; may lose mesh-specific details important for some CFD tasks.
  • Evaluations are 2D; 3D performance and conservation properties not shown.
  • Decoder GNN has local message radius (3 layers), so very long-range spatial features must be learned by the LLM.

When Not To Use

  • High-fidelity 3D CFD where mesh topology and conservation laws must be strictly preserved.
  • Problems requiring exact enforcement of boundary conditions or physical invariants not encoded by loss.
  • When compute budget cannot support multi-billion parameter LLMs.

Failure Modes

  • Smaller LLM variant produces blurry or diverging predictions at long horizons.
  • Interpolation from regular grid back to irregular mesh can introduce metric noise if grid cropping is inappropriate.
  • Model relies on pretrained sequence priors; random initialization performs much worse.

Core Entities

Models

  • FLUID-OPT125m
  • FLUID-OPT2.7b
  • Random-OPT125m
  • OPT-125m
  • OPT-2.7b
  • MeshGraphNets
  • DilResNet
  • GAT2Conv

Metrics

  • RMSE
  • N-RMSE

Datasets

  • Cylinder
  • Airfoil
  • Synthetic wave evolution (2D)

Benchmarks

  • N-step RMSE