PDEformer-2: A Versatile Foundation Model for Two-Dimensional Partial Differential Equations

Zhanhong Ye, Zining Liu, Bingyang Wu, Hongjie Jiang, Leheng Chen, Minyan Zhang, Xiang Huang, Qinghe Meng, Jingyuan Zou, Hongsheng Liu, Bin DongarXiv 2025 · OpenReview

Abstract

Partial differential equations (PDEs) play a central role in describing many physical phenomena. Various scientific and engineering applications demand a versatile and differentiable PDE solver that can quickly generate solutions with adequate accuracy, and limitations of the traditional solvers and specialized neural operators motivate the development of foundation models for solving PDEs. This paper introduces PDEformer-2, a versatile foundation model for two-dimensional PDEs. Based on our previous one-dimensional PDEformer-1 model, PDEformer-2 receives the PDE form as network input via computational graph representation, which has the flexibility to encode most common PDEs. The mesh-free predicted solutions can be directly queried at arbitrary spatio-temporal coordinates. A large (40TB) diverse dataset is employed to pretrain the current model, making it capable of simultaneously addressing PDEs with different symbolic forms, domain shapes, boundary conditions, number of variables, and time-dependency. Accurate zero-shot prediction is allowed for PDEs that resemble the pretraining ones. When adapted to new unseen PDEs, PDEformer-2 demonstrates faster learning than many specialized models, and has smaller errors given limited (less than 100) samples. Additionally, PDEformer-2 can be employed in the inverse problems thanks to its fast and differentiable nature and produces reasonable results in our experiments to recover coefficient scalars and fields of a PDE.

Introduction: The Need for Versatile PDE Solvers

In science and engineering, solving PDEs is essential for everything from aircraft design to climate modeling. However, researchers usually face a "pick two" trade-off between speed, accuracy, and versatility.

Comparison of PDE solver types across speed, differentiability, and versatility.

Traditional solvers are highly accurate and versatile but computationally expensive and difficult to integrate into differentiable machine learning workflows. Conversely, specialized neural operators (e.g., FNO, DeepONet) are extremely fast and differentiable but "brittle"—they are typically specialized for one specific equation and require retraining from scratch if the physics or boundary conditions change. PDEformer-2 aims to bridge this gap by creating a foundation model for PDEs that can handle various types of 2D PDEs out-of-the-box, even when the symbolic form of the equation is modified.

Methodology: Encoding Physics as Graphs

The core innovation of PDEformer-2 is how it "reads" physics. Instead of being hard-coded for a specific equation, it uses a Computational Graph Representation to interpret the symbolic form of the equation itself as a network input.

The PDEformer-2 architecture, featuring graph construction, a Graph Transformer encoder, and an INR decoder.

The model pipeline consists of three primary components:

  • Input Encoding: The symbolic expression of the PDE and its boundary conditions are converted into a Directed Acyclic Graph (DAG). Numeric information, such as initial conditions or coefficient fields, is embedded into the nodes of this graph using specialized scalar and function encoders (CNNs).
  • Graph Transformer: A Transformer architecture (specifically based on Graphormer) processes this graph to capture the intricate interplay between the mathematical operators and the numeric parameters.
  • Implicit Neural Representation (INR) Decoder: Instead of outputting a fixed grid of values, the model uses an INR decoder. This allows the solution to be "mesh-free," meaning it can be queried at any arbitrary spatio-temporal coordinate $(t, x, y)$. This flexibility makes it compatible with irregular domain shapes and various discretization schemes.

Data and Evaluation

The authors curated a massive 40 TB pretraining dataset containing 3.29 million samples. This dataset covers eight generic PDE families, including Diffusion-Convection-Reaction (DCR), Wave equations, Navier-Stokes (via the DC-DCR category), Elasticity, and Generalized shallow-water equations (G-SWE). For evaluation and adaptation, they used specialized benchmarks like Sine-Gordon, INS-Pipe (fluid flow in a pipe with no-slip boundaries), and Wave-C-Sines (wave equations on disk-shaped domains).

Key Insights and Results

PDEformer-2 demonstrates significant advantages in generalization and robustness:

  • Zero-Shot & Few-Shot Success: On in-distribution tasks like the Sine-Gordon equation, PDEformer-2 achieved high accuracy without any training. On out-of-distribution tasks like fluid flow in a pipe, it converged in merely ten seconds with fewer than 100 samples, whereas specialized models were often an order of magnitude slower to adapt.
  • Cross-Equation Generalization: Because the model is trained on a vast diversity of symbolic forms, it develops a preliminary understanding of PDE structures, allowing for zero-shot inference on equations composed of known physical mechanisms.
  • Robustness and Extrapolation: The model proved robust against numerical artifacts in its training data and demonstrated reasonable accuracy when tested on systems with five variables, despite the training data only including up to four.
  • Differentiability for Inverse Problems: Because the entire model is differentiable, it can be used as a "surrogate solver" to solve inverse problems—such as recovering unknown coefficients or source fields from noisy observations—using standard gradient-based optimization.

Conclusion: Limitations and Future Work

While PDEformer-2 offers unprecedented versatility, it has some limitations. The mesh-free INR design is slower for generating full space-time solutions compared to grid-based neural operators. Additionally, while superior in low-data regimes, it does not always outperform specialized models when an unlimited amount of data is available for a single specific PDE. Future work will focus on extending the architecture to 3D PDEs and exploring model distillation to improve inference speed.

Summary updated

BibTeX
@misc{ye2025pdeformer,
  author = {Zhanhong Ye and Zining Liu and Bingyang Wu and Hongjie Jiang and Leheng Chen and Minyan Zhang and Xiang Huang and Qinghe Meng and Jingyuan Zou and Hongsheng Liu and Bin Dong},
  title = {{PDEformer-2: A Versatile Foundation Model for Two-Dimensional Partial Differential Equations}},
  year = {2025},
  eprint = {2507.15409},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.15409},
}
Figure