Table of Contents
Fetching ...

LLM4Fluid: Large Language Models as Generalizable Neural Solvers for Fluid Dynamics

Qisong Xiao, Xinhai Chen, Qinglin Wang, Xiaowei Guo, Binglin Wang, Weifeng Chen, Zhichao Wang, Yunfei Liu, Rui Xia, Hang Zou, Gencheng Liu, Shuai Li, Jie Liu

TL;DR

This work tackles the challenge of generalizing data-driven fluid dynamics models to unseen flow conditions by introducing LLM4Fluid, which couples physics-informed disentangled reduced-order modeling with a large language model as a temporal processor. A physics-informed disentanglement mechanism yields near-orthogonal latent axes, while a modality-alignment strategy bridges semantic prompts and physical sequences; an LLM-based temporal solver autoregressively predicts future latent states and reconstructs the flow fields. The approach demonstrates state-of-the-art accuracy with a compact, generalizable model, exhibiting strong zero-shot and in-context learning capabilities across five 2D flow datasets and enabling cross-scenario generalization without retraining. It also shows significant efficiency advantages over prior LLM-based methods and supports adaptive tuning via LoRA for dataset-specific performance gains. Together, these contributions advance practical, scalable neural solvers for fluid dynamics in settings with varying boundary conditions and domain geometries.

Abstract

Deep learning has emerged as a promising paradigm for spatio-temporal modeling of fluid dynamics. However, existing approaches often suffer from limited generalization to unseen flow conditions and typically require retraining when applied to new scenarios. In this paper, we present LLM4Fluid, a spatio-temporal prediction framework that leverages Large Language Models (LLMs) as generalizable neural solvers for fluid dynamics. The framework first compresses high-dimensional flow fields into a compact latent space via reduced-order modeling enhanced with a physics-informed disentanglement mechanism, effectively mitigating spatial feature entanglement while preserving essential flow structures. A pretrained LLM then serves as a temporal processor, autoregressively predicting the dynamics of physical sequences with time series prompts. To bridge the modality gap between prompts and physical sequences, which can otherwise degrade prediction accuracy, we propose a dedicated modality alignment strategy that resolves representational mismatch and stabilizes long-term prediction. Extensive experiments across diverse flow scenarios demonstrate that LLM4Fluid functions as a robust and generalizable neural solver without retraining, achieving state-of-the-art accuracy while exhibiting powerful zero-shot and in-context learning capabilities. Code and datasets are publicly available at https://github.com/qisongxiao/LLM4Fluid.

LLM4Fluid: Large Language Models as Generalizable Neural Solvers for Fluid Dynamics

TL;DR

This work tackles the challenge of generalizing data-driven fluid dynamics models to unseen flow conditions by introducing LLM4Fluid, which couples physics-informed disentangled reduced-order modeling with a large language model as a temporal processor. A physics-informed disentanglement mechanism yields near-orthogonal latent axes, while a modality-alignment strategy bridges semantic prompts and physical sequences; an LLM-based temporal solver autoregressively predicts future latent states and reconstructs the flow fields. The approach demonstrates state-of-the-art accuracy with a compact, generalizable model, exhibiting strong zero-shot and in-context learning capabilities across five 2D flow datasets and enabling cross-scenario generalization without retraining. It also shows significant efficiency advantages over prior LLM-based methods and supports adaptive tuning via LoRA for dataset-specific performance gains. Together, these contributions advance practical, scalable neural solvers for fluid dynamics in settings with varying boundary conditions and domain geometries.

Abstract

Deep learning has emerged as a promising paradigm for spatio-temporal modeling of fluid dynamics. However, existing approaches often suffer from limited generalization to unseen flow conditions and typically require retraining when applied to new scenarios. In this paper, we present LLM4Fluid, a spatio-temporal prediction framework that leverages Large Language Models (LLMs) as generalizable neural solvers for fluid dynamics. The framework first compresses high-dimensional flow fields into a compact latent space via reduced-order modeling enhanced with a physics-informed disentanglement mechanism, effectively mitigating spatial feature entanglement while preserving essential flow structures. A pretrained LLM then serves as a temporal processor, autoregressively predicting the dynamics of physical sequences with time series prompts. To bridge the modality gap between prompts and physical sequences, which can otherwise degrade prediction accuracy, we propose a dedicated modality alignment strategy that resolves representational mismatch and stabilizes long-term prediction. Extensive experiments across diverse flow scenarios demonstrate that LLM4Fluid functions as a robust and generalizable neural solver without retraining, achieving state-of-the-art accuracy while exhibiting powerful zero-shot and in-context learning capabilities. Code and datasets are publicly available at https://github.com/qisongxiao/LLM4Fluid.
Paper Structure (21 sections, 20 equations, 21 figures, 7 tables)

This paper contains 21 sections, 20 equations, 21 figures, 7 tables.

Figures (21)

  • Figure 1: Comparison between existing methods (top) and our generalizable LLM4Fluid framework (bottom). (a) Feature Disentanglement: Unlike standard encoder–decoder architectures that produce entangled and chaotic spatial features in the latent space, our physics-informed disentanglement mechanism yields near-orthogonal and physics-disentangled representations while preserving essential flow structures. (b) Modality Alignment: Instead of prefix prompting, we embed textual prompts as position embeddings (PEs) to align the semantic and physical representations, bridging the modality gap and preventing prediction degradation. (c) Universal Generalization: Empowered by these mechanisms and pretrained sequence priors of LLMs, LLM4Fluid overcomes the limitations of scenario-specific methods, achieving robust generalization across diverse flow scenarios.
  • Figure 2: Overall architecture of the proposed LLM4Fluid framework. LLM4Fluid operates in two stages: (1) disentangled reduced-order modeling that compresses high-dimensional flow fields into near-orthogonal and physics-disentangled latent representations; and (2) an LLM-based temporal processor that tokenizes physical sequences, incorporates predefined prompts as positional embeddings, and autoregressively predicts future latent states. The predicted physical sequences are finally decoded to reconstruct the future flow fields.
  • Figure 3: Overview of zero-shot and in-context prediction. Trained on a source scenario, the processor performs autoregressive prediction on a target scenario either using only the lookback sequence (zero-shot) or additionally with physical sequence prompts (in-context).
  • Figure 4: Visualization of flow fields across five datasets.
  • Figure 5: Correlation matrices of the latent representations under different disentanglement weights on the High-Re dataset.
  • ...and 16 more figures