Skip to content
AIAI Wranglers

35 Generative Models for PDE-Based Simulation

The Grand Challenge: Simulating Nature

“Since Newton, mankind has come to realise that the laws of physics are always expressed in the language of differential equations.” - Steven Strogatz

Imagine you are an engineer designing the wing of a next-generation aircraft. Before a single rivet is hammered, before a single sheet of aluminium is cut, you must answer a deceptively simple question: will this wing fly? More precisely, you need to know the pressure distribution, the lift-to-drag ratio, the onset of turbulence over the wing surface at cruising altitude, and how these quantities change under gusts, varying angles of attack, and different flight Mach numbers. The physical laws governing these phenomena-the compressible Navier–Stokes equations-have been known since the nineteenth century. Writing them down takes a single line. Solving them, however, can consume millions of CPU-hours on the world's largest supercomputers.

This is the central paradox of computational physics: the equations are simple, but their solutions are staggeringly complex. A turbulent flow at a Reynolds number of 106 contains eddies spanning six orders of magnitude in spatial scale, and the computational grid must resolve every one of them for a faithful simulation. Direct Numerical Simulation (DNS) of the Navier–Stokes equations at industrially relevant Reynolds numbers remains out of reach for all but the simplest geometries, even on exascale hardware.

And yet, nature solves these equations effortlessly. Every ocean wave, every wisp of smoke curling from a candle, every heartbeat pushing blood through your arteries is an instantaneous, massively-parallel computation performed by the universe itself. The question that drives this chapter is: can we train neural networks to approximate the solutions of partial differential equations (PDEs) at a fraction of the computational cost of traditional solvers, while faithfully capturing the rich, multi-scale physics?

The answer, as we shall see, is a resounding-and increasingly precise-yes.

Why this chapter, and why now?

The marriage of deep learning and differential equations is not entirely new. Physics-Informed Neural Networks (PINNs), introduced by Raissi, Perdikaris, and Karniadakis in 2019, showed that one can embed PDE residuals directly into a neural network's loss function and obtain mesh-free approximate solutions. But PINNs, for all their elegance, are single-instance solvers: you train a network to solve one specific PDE with one specific set of initial and boundary conditions. Change the initial temperature distribution, the shape of the domain, or the viscosity coefficient, and you must start over.

The breakthrough of the last five years has been the shift from solving one PDE instance to learning the operator that maps PDE parameters to solutions. Neural operators-most famously the Fourier Neural Operator (FNO) and DeepONet-learn mappings between infinite-dimensional function spaces, so that a single trained model can produce solutions for an entire family of PDEs, evaluated at any desired resolution.

But even neural operators have a fundamental limitation: they are deterministic. They output a single “best guess” solution, typically the conditional mean under a squared-error loss. For many physical systems, especially turbulent flows, chaotic dynamics, and ill-posed inverse problems, the conditional mean is not a physically meaningful quantity. It is a blurred average of many possible states, much as the average face of all humans looks like no one in particular.

Key Idea.

From Deterministic Surrogates to Generative PDE Solvers The key conceptual leap of this chapter is the realisation that PDE solving can be cast as a generative modelling problem. Instead of predicting a single solution u(𝐱,t), we learn the distribution p(u|θ) over solution fields conditioned on PDE parameters θ (initial conditions, boundary conditions, coefficients, domain geometry). Sampling from this distribution yields diverse, physically plausible solution fields, each respecting the governing equations. This perspective unifies forward simulation, inverse problems, data assimilation, and uncertainty quantification under a single probabilistic umbrella.

The two generative architectures that have proven most powerful in this context are Transformers and diffusion models:

  • Transformers bring global self-attention over discretised fields, enabling the resolution of long-range spatial dependencies and the handling of irregular, non-Cartesian geometries that defeat convolutional approaches.

  • Diffusion/score-based models cast PDE solving as an iterative denoising process governed by stochastic differential equations, naturally producing distributions over solution fields and enabling plug-and-play conditioning on sparse observations and physics constraints.

The evolution from classical PDE solvers to generative PDE solvers. Each step represents a conceptual leap: from grid-bound to mesh-free, from single-instance to operator-level, and from deterministic to probabilistic.

A roadmap for this chapter

This chapter is designed to be largely self-contained. We assume familiarity with basic PDE concepts (the heat equation, the wave equation, boundary conditions) at the level of a first undergraduate course, and with the deep learning fundamentals covered in Chapter ch:deeplearning of this book. Everything else-PINNs, neural operators, Transformer variants, diffusion formulations on function spaces-is developed from scratch with full mathematical detail, worked examples, and TikZ illustrations.

Here is what lies ahead:

  1. A First Look at PDEs and Why They Matter (Section A First Look at PDEs and Why They Matter): We recall the classification of PDEs into elliptic, parabolic, and hyperbolic types, and motivate each class with a flagship physical application. We introduce the Navier–Stokes equations and the associated Clay Millennium Prize Problem-one of the seven greatest unsolved problems in mathematics.

  2. The Computational Bottleneck (Section The Computational Bottleneck): We quantify why classical solvers are expensive, what the “curse of dimensionality” means for parametric PDEs, and why repeated-query settings (design optimisation, uncertainty quantification, Bayesian inversion, real-time control) demand fundamentally new approaches.

  3. Physics-Informed Neural Networks (Section Physics-Informed Neural Networks): We develop the PINN framework rigorously, derive the physics-informed loss, discuss automatic differentiation for computing PDE residuals, and analyse the failure modes (spectral bias, gradient pathologies, multi-term loss balancing). We cover causality-aware training and gradient-rebalancing remedies.

  4. Neural Operator Learning (Section Neural Operator Learning): We formalise the concept of a solution operator 𝒢:𝒜𝒰 mapping input functions to output functions, develop DeepONet and the Fourier Neural Operator from first principles, and discuss theoretical approximation guarantees.

  5. Transformer-Based PDE Solvers (Section Transformer-Based PDE Solvers): We cover Galerkin Transformers, GNOT, Transolver, HAMLET, PiT, physics-attention, PDE-conditional Transformers (Unisolver), and foundation-model pretraining approaches (MPP, CoDA-NO, ICON, PDEformer).

  6. Diffusion and Score-Based Models for PDEs (Section Diffusion and Score-Based Models for PDE Simulation): We develop the theory of diffusion models on function spaces, derive physics-informed diffusion (PIDMs), discuss DiffusionPDE, conditional diffusion for forecasting and data assimilation, CoCoGen, and flow-matching approaches for fast sampling.

  7. Applications by PDE Family (Sections Poisson and Laplace-Type Elliptic PDEsCoupled and Multiphysics PDE Systems): We walk through each major PDE class-Poisson/Laplace, Burgers, Navier–Stokes, shallow water, Helmholtz, Maxwell, Stefan, Cahn–Hilliard, Schrödinger, and coupled multiphysics systems-showing how Transformers and diffusion models have been applied, with results, figures, and critical analysis.

  8. Turbulence and Generative Modelling (Section Generative Modelling for Turbulence): A dedicated treatment of the turbulence problem, including GAN-era approaches, diffusion for turbulent flow generation, CoNFiLD, GenCFD, and the interplay between spectral accuracy and generative diversity.

  9. Inverse Problems and Uncertainty Quantification (Section PDE-Constrained Inverse Problems): We formalise PDE-constrained inverse problems, develop plug-and-play diffusion priors, RED-DiffEq for full waveform inversion, and InverseBench as a community benchmark.

  10. Benchmarks and Evaluation (Section Benchmarks and Evaluation Practice): We survey PDEBench, PINNacle, and emerging evaluation standards, discussing metrics beyond L2 (energy norms, spectral fidelity, conservation residuals).

  11. Open Problems and the Road Ahead (Section Open Problems and Future Challenges): We discuss the Clay Millennium Prize Problem on Navier–Stokes existence and smoothness, the role of ML in conjecture generation for PDEs, and frontier challenges including discretisation-agnostic generation, real-time turbulence, and generative PDE foundation models.

  12. Exercises (Section Pen-and-Paper Exercises): A comprehensive collection of exercises ranging from pen-and-paper derivations to coding projects.

Remark 1 (Notation).

Throughout this chapter, we denote the spatial domain by Ωd, its boundary by Ω, the solution field by u:Ω×[0,T] (or m for systems), and the PDE parameters (coefficients, source terms, boundary data) collectively by θ. We write , , and 2=Δ for the gradient, divergence, and Laplacian operators, respectively. Neural network parameters are denoted by ϕ or ψ to distinguish them from PDE parameters θ.

A First Look at PDEs and Why They Matter

Partial differential equations are the mathematical language of continuum physics. Wherever a quantity varies smoothly in space and time-temperature, pressure, electric potential, probability density-its evolution is typically governed by a PDE\@. In this section, we revisit the three fundamental types of second-order linear PDEs (elliptic, parabolic, hyperbolic), introduce their flagship physical incarnations, and build toward the Navier–Stokes equations that will serve as the running example throughout this chapter.

The three archetypes

Consider a general second-order linear PDE in two independent variables (x,y): (General2nd)A2ux2+2B2uxy+C2uy2+(lower-order terms)=0. The discriminant ΔPDE=B2AC classifies the equation:

  • Elliptic (ΔPDE<0): steady-state problems, e.g., the Laplace equation 2u=0. Solutions are smooth and encode equilibrium configurations.

  • Parabolic (ΔPDE=0): diffusion and heat conduction, e.g., tu=κ2u. Information propagates at infinite speed but is smoothed over time.

  • Hyperbolic (ΔPDE>0): wave propagation, e.g., ttu=c22u. Information propagates at finite speed along characteristics; discontinuities (shocks) can form.

The three archetypes of second-order linear PDEs and their physical incarnations. The Navier–Stokes equations are a nonlinear system with both parabolic (viscous diffusion) and hyperbolic (advective transport) character.

Example 1 (The Poisson equation in electrostatics).

The electric potential ϕ(𝐱) generated by a charge distribution ρ(𝐱) in a domain Ω satisfies the Poisson equation: (Poisson)2ϕ(𝐱)=ρ(𝐱)ε0,𝐱Ω, with boundary conditions ϕ=g on Ω (Dirichlet) or ϕ/n=h on Ω (Neumann). This is an elliptic PDE\@. Its solutions are smooth in Ω (analytic, in fact, if ρ is smooth), and uniqueness follows from the maximum principle.

From a machine learning perspective, the interesting problem is the parametric Poisson equation: given a family of charge distributions {ρθ}θΘ, learn the operator 𝒢:ρθϕθ mapping source terms to potentials. This is exactly the setting where neural operators shine.

Example 2 (The heat equation).

The temperature u(𝐱,t) in a conducting medium with thermal diffusivity κ>0 evolves according to: (HEAT)ut=κ2u+f(𝐱,t),(𝐱,t)Ω×(0,T], with initial condition u(𝐱,0)=u0(𝐱) and appropriate boundary conditions. This is a parabolic PDE\@. The solution smooths out any initial irregularities as time progresses-a property that will become important when we discuss why deterministic surrogates tend to “blur” their predictions.

Example 3 (The wave equation).

The displacement u(𝐱,t) of a vibrating membrane or acoustic medium satisfies: (WAVE)2ut2=c22u,(𝐱,t)Ω×(0,T], with wave speed c>0. This is a hyperbolic PDE\@. Unlike the heat equation, discontinuities in the initial data propagate without smoothing-they travel as waves at speed c.

The Navier–Stokes equations: beauty and terror

The incompressible Navier–Stokes equations govern the motion of a viscous, incompressible fluid: (Momentum)𝐮t+(𝐮)𝐮=1ρp+ν2𝐮+𝐟,𝐮=0, where 𝐮(𝐱,t)d is the velocity field, p(𝐱,t) is the pressure, ρ is the (constant) density, ν is the kinematic viscosity, and 𝐟 represents external body forces. Equation is the momentum equation (Newton's second law for a fluid element), and Equation is the incompressibility constraint (conservation of mass for a constant-density fluid).

The nonlinear advection term (𝐮)𝐮 is what makes the Navier–Stokes equations simultaneously beautiful and terrifying. It couples the velocity field to itself, creating feedback loops that can amplify small perturbations into the chaotic, multi-scale structures we call turbulence.

Definition 1 (Reynolds number).

The Reynolds number is the dimensionless ratio of inertial to viscous forces: (Reynolds)Re=ULν, where U is a characteristic velocity scale, L is a characteristic length scale, and ν is the kinematic viscosity. At low Re (creeping flow), viscosity dominates and flow is laminar. At high Re (e.g., Re104 for pipe flow), inertia dominates and flow transitions to turbulence.

Flow regimes as a function of the Reynolds number. At industrially relevant Reynolds numbers (Re106 for an aircraft wing), the flow is fully turbulent with energy cascades spanning many orders of magnitude.

Kolmogorov's theory of turbulence

In 1941, Andrey Kolmogorov proposed a statistical theory of fully-developed turbulence that remains one of the most profound insights in fluid dynamics. His key hypotheses:

  1. Energy cascade: Energy is injected into the flow at large scales (the integral scale ), cascades through a hierarchy of progressively smaller eddies, and is finally dissipated by viscosity at the Kolmogorov microscale η.

  2. Universal scaling: In the inertial range (scales between and η), the energy spectrum follows the celebrated 5/3 power law: (Kolmogorov)E(k)ε2/3k5/3, where k is the wavenumber and ε is the mean energy dissipation rate per unit mass.

The Kolmogorov microscale is given by: (Kolmogorov ETA)η=(ν3ε)1/4, and the ratio of the largest to smallest scales goes as /ηRe3/4. In three dimensions, the number of grid points needed for DNS scales as: (DNS COST)Ngrid(η)3Re9/4. For an aircraft wing at Re107, this gives Ngrid1015.755.6×1015 grid points-far beyond current computational capabilities.

Insight.

Why Generative Models Matter for Turbulence The Kolmogorov energy cascade reveals a fundamental mismatch between deterministic neural surrogates and turbulent flows. A network trained with L2 loss learns the conditional mean, which averages out the fine-scale fluctuations that carry much of the physically relevant information (drag, mixing rates, noise generation). Generative models, by learning the full conditional distribution p(u|θ), can sample individual realisations that preserve the correct energy spectrum, including the 5/3 law in the inertial range.

The Clay Millennium Prize Problem

In the year 2000, the Clay Mathematics Institute announced seven Millennium Prize Problems, each carrying a reward of $1,000,000. The Navier–Stokes problem is among them:

Conjecture 1 (Navier–Stokes existence and smoothness).

For the three-dimensional incompressible Navier–Stokes equations on 3, with smooth, divergence-free initial data 𝐮0 of finite energy: 3|𝐮0(𝐱)|2d𝐱<, does there exist a smooth solution 𝐮(𝐱,t) for all t>0? Or can singularities (blow-up) develop in finite time?

What makes this problem so difficult? The nonlinear advection term (𝐮)𝐮 can amplify vorticity through the vortex stretching mechanism. In two dimensions, vortex stretching is absent, and global regularity was proven by Ladyzhenskaya in the 1960s. In three dimensions, vortex stretching can potentially concentrate vorticity to a point, creating a singularity. Despite decades of effort by the world's best analysts, neither existence nor blow-up has been proven in general.

Remark 2 (What ML can and cannot do).

Machine learning cannot solve the Millennium Prize Problem in its mathematical sense-the question demands a rigorous proof, not a numerical experiment. However, ML-based simulations can:

  1. Generate high-resolution flows that probe near-singular behaviour, providing evidence for or against blow-up scenarios.

  2. Discover new scaling laws and invariants in turbulent flows that might inspire analytical approaches.

  3. Assist in formal theorem proving for PDE regularity results (connecting to the topics in the chapter on Generative Models for Mathematics).

We revisit this in Section Open Problems and Future Challenges.

The Computational Bottleneck

We have seen that DNS of turbulent flows is prohibitively expensive. But the computational bottleneck extends far beyond turbulence. In this section, we examine three settings where classical PDE solvers become a fundamental limitation, motivating the need for neural surrogates and generative alternatives.

The many-query problem

In many scientific and engineering workflows, one needs to solve not one PDE but a family of PDEs, parametrised by varying inputs:

  • Design optimisation: Finding the wing shape that minimises drag involves evaluating the Navier–Stokes equations for thousands of candidate geometries. Each evaluation requires a full PDE solve.

  • Uncertainty quantification (UQ): If the material properties (e.g., permeability in a porous medium) are uncertain, one must propagate this uncertainty through the PDE solver. Monte Carlo sampling requires 𝒪(103)𝒪(106) PDE solves.

  • Bayesian inversion: Estimating subsurface geological properties from seismic measurements requires evaluating the forward PDE model at every step of an MCMC chain.

  • Real-time control: Active flow control (e.g., reducing drag on a vehicle) requires evaluating the PDE model in milliseconds, far faster than any classical solver can operate.

In all these settings, the PDE solver is called inside a loop, and the total computational cost is: (Total COST)Total cost=Nqueries×Csolver, where Csolver is the cost of a single solve and Nqueries can range from hundreds to millions.

Key Idea.

Amortised Computation via Neural Operators The fundamental promise of neural operators is amortised computation: invest a large upfront cost to train the model on representative PDE instances, then enjoy near-instant evaluation for any new input. If training costs Ctrain and inference costs CinferCsolver, the break-even point is: (Breakeven)Nqueries=CtrainCsolverCinfer. For turbulent CFD, Csolver can be hours while Cinfer is milliseconds, making the break-even point remarkably low.

The curse of dimensionality

Classical PDE solvers discretise the domain Ω into a mesh with N degrees of freedom. For a d-dimensional domain with n grid points per dimension, N=nd. The cost of a single solve typically scales as:

  • 𝒪(N) for explicit time-stepping (e.g., forward Euler),

  • 𝒪(NlogN) for spectral methods with FFT,

  • 𝒪(N1+α) for sparse direct solvers (α0.51 depending on dimension and method).

When the PDE is parametric-i.e., we want solutions for all θ in some parameter space Θp-the effective dimensionality of the problem is d+p. For high-dimensional parameter spaces (e.g., uncertain spatially-varying coefficients κ(𝐱) discretised on a grid), p can be in the thousands, and traditional methods like sparse grids or polynomial chaos expansions break down.

Cumulative computational cost as a function of the number of PDE queries. Classical solvers have zero upfront cost but high per-query cost; neural operators have high training cost but near-zero inference cost. The break-even point Nqueries is often reached after a few hundred queries.

What classical solvers do well-and where they fall short

Before we dive into neural alternatives, it is important to acknowledge what classical numerical methods excel at:

  1. Rigorous error bounds: Finite element methods come with a priori and a posteriori error estimates in well-defined norms (H1, L2, etc.).

  2. Conservation properties: Finite volume methods conserve mass, momentum, and energy by construction.

  3. Mesh adaptivity: Adaptive mesh refinement (AMR) can concentrate resolution where it is needed (e.g., near shocks or boundary layers).

  4. Decades of engineering validation: These methods have been tested and trusted in safety-critical applications (aircraft certification, nuclear reactor design, weather prediction).

Neural surrogates do not (yet) provide rigorous error bounds, do not conserve physical quantities by construction, and have limited track records in safety-critical settings. The goal is not to replace classical solvers but to complement them-using neural models for fast exploration and reserving classical solvers for final validation.

Caution.

Never deploy a neural PDE surrogate in a safety-critical application without careful validation against classical solvers or experimental data. Neural surrogates can fail silently and catastrophically on out-of-distribution inputs.

The landscape of neural approaches to PDEs

The neural PDE solving landscape can be organised along two axes:

  1. Single-instance vs. operator learning: Does the model solve one specific PDE (PINNs) or learn the solution operator for a family (neural operators)?

  2. Deterministic vs. generative: Does the model output a single solution (point estimate) or a distribution over solutions?

The landscape of neural approaches to PDE solving, organised by scope (single instance vs. operator) and output type (deterministic vs. generative). This chapter focuses on the highlighted quadrant: generative operator learning.

Table Table 1 provides a quantitative comparison of the key approaches along several dimensions.

MethodScopeOutputMesh-free?UQ?Inverse?
PINNsSingleDeterministicYesLimitedLimited
FNOOperatorDeterministicNoNoNo
DeepONetOperatorDeterministicYesNoNo
TransolverOperatorDeterministicYesNoNo
DiffusionPDEOperatorGenerativeNoYesYes
PIDMsOperatorGenerativeNoYesYes
FunDPSOperatorGenerativeYesYesYes
FNO has “zero-shot super-resolution” on uniform grids but does not handle unstructured meshes.
Comparison of neural PDE solving paradigms.

Exercise 1.

Consider a Darcy flow problem (elliptic PDE) on a 256×256 grid. A finite element solver takes 2 seconds per solve on a single CPU core. A trained FNO takes 5 milliseconds per inference on a GPU\@. Training the FNO requires 10,000 PDE solutions (generated offline) and 4 hours of GPU time.

  1. What is the break-even number of queries Nqueries, assuming the offline data generation is the dominant training cost?

  2. An engineer needs to run a Bayesian inversion with 50,000 MCMC steps. How much wall-clock time does this take with (a) the FE solver and (b) the FNO?

  3. Discuss the trade-offs: what might go wrong with the FNO approach?

Physics-Informed Neural Networks

We now arrive at one of the most influential ideas in scientific machine learning: using a neural network as a trial function for a PDE, and training it by penalising the PDE residual evaluated at random collocation points. This simple but powerful idea-the Physics-Informed Neural Network (PINN)-was popularised by Raissi, Perdikaris, and Karniadakis (2019) and has since spawned an enormous literature.

The core idea

Suppose we wish to solve a PDE of the general form: (General)𝒩[u](𝐱,t)=0,(𝐱,t)Ω×(0,T], subject to initial condition u(𝐱,0)=u0(𝐱) and boundary condition [u](𝐱,t)=0 for 𝐱Ω. Here 𝒩 is a (possibly nonlinear) differential operator and encodes boundary conditions (Dirichlet, Neumann, Robin, periodic, etc.).

The PINN approach is breathtakingly simple:

  1. Represent u by a neural network: Let uϕ(𝐱,t) be a multilayer perceptron (MLP) with parameters ϕ, taking (𝐱,t) as input and returning the predicted solution value.

  2. Compute PDE residuals via automatic differentiation: The partial derivatives uϕ/t, 2uϕ/xixj, etc. are computed exactly (up to floating-point precision) using the chain rule through the network's computational graph. No finite differences or mesh are needed.

  3. Minimise a physics-informed loss: The loss function penalises the PDE residual, boundary residual, and initial condition residual at randomly sampled collocation points: (LOSS)(ϕ)=λrr(ϕ)+λbb(ϕ)+λ00(ϕ), where: (LOSS Residual)r(ϕ)=1Nri=1Nr|𝒩[uϕ](𝐱ir,tir)|2,b(ϕ)=1Nbi=1Nb|[uϕ](𝐱ib,tib)|2,0(ϕ)=1N0i=1N0|uϕ(𝐱i0,0)u0(𝐱i0)|2.

Architecture of a Physics-Informed Neural Network (PINN). The network uϕ takes (𝐱,t) as input and outputs the predicted solution. Automatic differentiation computes the required partial derivatives, which are assembled into PDE, boundary, and initial-condition residuals. The total loss is minimised via gradient descent.

Example 4 (PINN for the 1D Burgers equation).

Consider the viscous Burgers equation on [1,1]×[0,1]: (Burgers)ut+uux=ν2ux2, with ν=0.01/π, initial condition u(x,0)=sin(πx), and boundary conditions u(1,t)=u(1,t)=0.

The PINN loss is: (ϕ)=1Nri|uϕt(xi,ti)+uϕ(xi,ti)uϕx(xi,ti)ν2uϕx2(xi,ti)|2+b+0.

For small ν, the solution develops a sharp shock around t0.3, and this is precisely where standard PINNs struggle (see Section Failure modes of PINNs).

Automatic differentiation for PDE residuals

The magic of PINNs lies in automatic differentiation (AD). Unlike finite differences, which introduce truncation errors and require a mesh, AD computes exact derivatives through the computational graph.

For a network uϕ(𝐱,t) with L layers: (MLP)uϕ(𝐱,t)=WLσ(WL1σ(σ(W1[𝐱;t]+b1))+bL1)+bL, where σ is the activation function. The key observation is that each partial derivative uϕ/xj can be computed by the chain rule: (Chainrule)uϕxj=uϕh(L)h(L)h(L1)h(1)xj, where h(k) denotes the hidden representation at layer k. Higher-order derivatives (needed for PDEs like the heat equation or Navier–Stokes) require multiple applications of this chain rule.

Remark 3 (Computational cost of higher-order AD).

Computing k-th order derivatives via AD requires k passes through the computational graph. For the Cahn–Hilliard equation (which involves 4u), this means four nested differentiation passes, each multiplying the computational cost and potentially accumulating floating-point errors. This is one reason why higher-order PDEs are particularly challenging for PINNs.

Failure modes of PINNs

Despite their elegance, PINNs suffer from several well-documented failure modes that limit their applicability to challenging PDEs. Understanding these failures is essential both for improving PINNs and for appreciating why generative alternatives are needed.

Spectral bias

Neural networks with smooth activations (tanh, sigmoid, softplus) have an intrinsic preference for low-frequency functions. This spectral bias causes PINNs to learn the low-frequency components of the solution first and converge extremely slowly (or not at all) on high-frequency features such as:

  • Sharp shocks in Burgers' equation,

  • Rapidly oscillating solutions of the Helmholtz equation,

  • Fine-scale turbulent structures.

Mathematically, the Neural Tangent Kernel (NTK) of an MLP with smooth activations has eigenvalues that decay rapidly with frequency. For a target function with significant high-frequency content, the corresponding NTK eigenvalues are small, and the gradient flow converges slowly along those directions.

Theorem 1 (Spectral bias in the NTK regime, informal).

For an MLP with smooth activations in the infinite-width (NTK) regime, the rate of convergence of the k-th Fourier mode of the residual is proportional to the k-th eigenvalue λk of the NTK\@. For smooth activations, λk0 rapidly as k, implying exponentially slow learning of high-frequency features.

Spectral bias: the NTK eigenvalues decay rapidly with frequency, causing PINNs to learn low-frequency solution components quickly but struggle with high-frequency features.

Multi-term loss balancing

The PINN loss is a weighted sum of multiple terms. The weights λr, λb, λ0 are hyperparameters that dramatically affect convergence. If λb is too small, the network may satisfy the PDE in the interior but violate boundary conditions; if λr is too small, the network may interpolate the initial/boundary data but ignore the physics.

Definition 2 (Gradient-statistics-based rebalancing).

Wang et al. (2021) proposed dynamically adjusting the weights based on gradient statistics: (Rebalance)λ^k=maxϕ|ϕr||ϕk|,k{b,0}, where the numerator is the maximum gradient magnitude of the residual loss and the denominator is the mean gradient magnitude of the k-th loss term. The weights are updated with exponential moving average: λk(n+1)=(1α)λk(n)+αλ^k(n), with α(0,1) controlling the smoothing rate.

Gradient pathologies

A deeper issue is that the gradients ϕr and ϕb can point in conflicting directions. Stiff PDEs (where the PDE residual varies by many orders of magnitude across the domain) exacerbate this: the optimiser may oscillate between reducing the interior residual and the boundary residual, making net progress extremely slow.

Wang, Teng, and Perdikaris (2021) provided a systematic analysis of these gradient pathologies, showing that the condition number of the effective Hessian of the PINN loss can be astronomically large for stiff systems, leading to training failure.

Causality violation

For time-dependent PDEs, collocation points are typically sampled uniformly over the entire spatiotemporal domain Ω×[0,T]. This means the optimiser simultaneously tries to fit the solution at t=0 (where the initial condition is known) and at t=T (where the solution must be propagated through the dynamics). The network may “cheat” by fitting later times without correctly propagating from the initial condition, resulting in solutions that are smooth and low-residual but physically meaningless.

Definition 3 (Causal training).

Wang, Sankaran, and Perdikaris (2022) introduced causal training, which reweights the temporal collocation points to enforce a causal ordering: (Causal)rcausal(ϕ)=k=1Ntwk1Nxi=1Nx|𝒩[uϕ](𝐱i,tk)|2, where the causal weights wk are defined as: (Causal Weights)wk=exp(ϵj=1k11Nxi=1Nx|𝒩[uϕ](𝐱i,tj)|2), with ϵ>0 controlling the causal strictness. When the residual at earlier times is large, wk for later times is exponentially suppressed, forcing the optimiser to first fit the solution at early times before moving to later times.

Causal training weights for PINNs. Time steps with large residuals suppress the weights for all subsequent time steps, enforcing the physical causality of the solution.

Remedies and extensions

The failures of vanilla PINNs have spurred an impressive body of work on improved training strategies. We highlight several:

  1. Fourier feature embeddings: Replacing the raw input (𝐱,t) with random Fourier features [sin(B𝐱);cos(B𝐱)] (where B is a random matrix) alleviates spectral bias by mapping the input to a higher-dimensional space where all frequencies are equally accessible. This is closely related to the random Fourier features kernel approximation.

  2. Adaptive activation functions: Jagtap and Karniadakis (2020) introduced learnable parameters in the activation function (e.g., σ(nax) where n is a scaling factor and a is learnable), allowing the network to adapt its frequency response during training.

  3. Domain decomposition (XPINNs): The domain Ω is divided into subdomains, each with its own PINN, with interface conditions enforced via additional loss terms. This reduces the effective complexity each network must capture.

  4. Time-stepping PINNs: Instead of solving over the entire time interval [0,T] at once, the interval is divided into windows [tk,tk+1], and a PINN is trained sequentially on each window, using the previous solution as the initial condition.

  5. Curriculum learning: Start training on an easier version of the PDE (e.g., higher viscosity) and gradually increase the difficulty, allowing the network to build up its representation incrementally.

Key Idea.

PINNs as a Stepping Stone PINNs demonstrated a fundamental principle: physics can be encoded as a soft constraint in a neural network's loss function. This idea transcends PINNs and permeates the entire field of physics-informed machine learning, including the generative models we will study later. Physics-informed diffusion models, for instance, add PDE residuals as “virtual observables” during diffusion training-a direct descendant of the PINN philosophy.

From single instances to operators: the limits of PINNs

The fundamental limitation of PINNs is that they are single-instance solvers. A PINN trained to solve the Burgers equation with ν=0.01/π and initial condition u0(x)=sin(πx) cannot, without retraining, solve the same equation with ν=0.1 or u0(x)=exp(x2).

Proposition 1 (PINN retraining cost).

For a parametric PDE family {𝒩θ[u]=0}θΘ with |Θ| parameter configurations, the total PINN training cost is: CPINN=|Θ|×Csingle, where Csingle is the cost of training a single PINN\@. This linear scaling in |Θ| is unacceptable for design optimisation or UQ, where |Θ| can be 103106.

This limitation motivates the operator learning paradigm, which we develop in the next section: instead of learning the solution u for fixed parameters θ, we learn the operator 𝒢:θu that maps parameters to solutions across the entire family.

Exercise 2.

Implement a PINN for the 1D Burgers equation (Example Example 4) using PyTorch or JAX\@.

  1. Train with Nr=10,000 interior collocation points, Nb=200 boundary points, and N0=200 initial condition points.

  2. Plot the learned solution uϕ(x,t) as a heatmap and compare with the analytical solution (obtainable via the Cole–Hopf transformation).

  3. Experiment with the loss weights λr, λb, λ0. What happens when λb is set to zero?

  4. Implement causal training (Definition Definition 3) and compare the convergence with and without causality enforcement for ν=0.001/π (a regime where shocks are sharp).

Exercise 3 (Spectral bias experiment).

Consider the 1D Poisson equation u(x)=f(x) on [0,1] with u(0)=u(1)=0 and f(x)=sin(2πx)+10sin(20πx).

  1. Train a PINN with a [1,64,64,64,1] architecture and tanh activation. Plot the residual spectrum (Fourier transform of uϕ(x)uexact(x)) at epochs 100, 1000, and 10000. Which frequencies converge first?

  2. Repeat with Fourier feature embeddings γ(x)=[sin(2πBx);cos(2πBx)] where B𝒩(0,σ2) with σ=10. How does the convergence change?

Neural Operator Learning

In the previous section we saw how PINNs embed physics into a neural network's loss function to solve one PDE instance at a time. Each new set of initial conditions, boundary conditions, or coefficients requires retraining from scratch. This is rather like hiring a brilliant chef who can cook exactly one dish: delicious, but impractical for running a restaurant.

The conceptual leap of neural operator learning is to move from learning a single function u:Ω to learning the operator 𝒢:𝒜𝒰 that maps an input function (coefficient field, initial condition, forcing term) to the corresponding solution function. Once 𝒢 is learned, we can evaluate it on any new input function at inference time with a single forward pass-no retraining, no iterative solver, no mesh.

Key Idea.

Operator Learning: Amortised PDE Solving Traditional solvers and PINNs spend all their computational effort on a single PDE instance. Operator learning amortises this cost over a family of PDE instances: a large offline training cost is paid once, after which each new instance is solved in milliseconds. This is the same amortisation principle that underlies variational autoencoders (Chapter ch:vaes), normalising flows (Chapter 18), and amortised variational inference more broadly.

This section develops the mathematical foundations of operator learning, presents the two most important architectures-DeepONet and the Fourier Neural Operator-derives key theoretical guarantees, and concludes by identifying the fundamental limitations that motivate the generative approaches of the remaining sections.

The Operator Learning Problem

Function spaces and the solution operator

We begin by formalising the setting. Let Ωd be a bounded domain, and consider a parametric family of PDEs: (Parametric)𝒩a[u]=0in Ω,subject to boundary conditions on Ω, where a:Ωda is an input function that parametrises the PDE. The input a could be:

  • A spatially varying coefficient field (e.g., the permeability in Darcy flow),

  • An initial condition (e.g., u(𝐱,0)=a(𝐱) for the heat equation),

  • A forcing term (e.g., the right-hand side f(𝐱) in Poisson's equation),

  • A combination of the above.

For each admissible input a, the PDE has a unique solution u=ua.1 The solution operator is the mapping that sends a to ua:

Definition 4 (Solution Operator).

The solution operator of the parametric PDE family is the mapping (GMAP)𝒢:𝒜𝒰,aua, where 𝒜 and 𝒰 are Banach spaces of functions on Ω. Typically 𝒜=L2(Ω;da) or a Sobolev space Hs(Ω), and 𝒰=H01(Ω) or C(Ω), depending on the regularity of the PDE.

The superscript denotes the true (data-generating) operator; the goal of operator learning is to find an approximation 𝒢θ𝒢, parametrised by learnable parameters θ.

Remark 4 (Infinite-dimensional input and output).

Unlike standard supervised learning, where both input xn and output ym are finite-dimensional vectors, operator learning maps between infinite-dimensional spaces. This is the fundamental challenge: the input a is a function with uncountably many degrees of freedom, and so is the output ua. Any practical implementation must discretise both a and ua onto a finite grid or point cloud, but the architecture should-ideally-be independent of the discretisation resolution.

The data-driven formulation

In practice, we are given a training dataset of N input–solution pairs: (Dataset)𝒟={(a(i),u(i))}i=1N,u(i)=𝒢(a(i)), where each pair is generated by running a classical PDE solver (finite elements, finite volumes, spectral methods) on the input a(i). The functions a(i) are drawn from some distribution μ on 𝒜 (e.g., a Gaussian random field), and both a(i) and u(i) are observed on discrete grids.

The operator learning problem is then: (Objective)minθ𝔼aμ[𝒢θ(a)𝒢(a)𝒰2]1Ni=1N𝒢θ(a(i))u(i)2, where the norm is approximated by a discrete quadrature rule on the observation grid.

The operator learning problem. The true solution operator 𝒢 (solid arrow) maps input functions in the Banach space 𝒜 to solution functions in 𝒰. The goal is to learn a parametric approximation 𝒢θ (dashed arrow) from a finite training set of input–solution pairs. Note that both spaces are infinite-dimensional; the sample curves represent individual functions.

Universal approximation for operators

The theoretical foundation for operator learning was laid remarkably early-long before the deep learning revolution-by Chen and Chen in 1995.

Theorem 2 (Universal approximation for operators - Chen & Chen, 1995).

Let 𝒜 be a compact subset of a Banach space 𝒳, and let 𝒢:𝒜C(𝒴) be a continuous (nonlinear) operator, where 𝒴d is compact. Then for every ε>0, there exist positive integers p and m, constants ck,ξkj,ζk,wkj,bk (for k=1,,p and j=1,,m), and points x1,,xm𝒴 such that (CHEN CHEN)supa𝒜supy𝒴|𝒢(a)(y)k=1pckσ(j=1mξkja(xj)+ζk)σ(j=1dwkjyj+bk)|<ε, where σ is any continuous non-polynomial activation function.

This theorem says two profound things:

  1. Any continuous operator can be approximated to arbitrary accuracy by a finite-rank architecture involving two sub-networks, one acting on the input function a (evaluated at fixed sensor locations x1,,xm) and one acting on the output query point y.

  2. The input function a need only be observed at finitely many sensor locations-we do not need the entire function, only its values at m representative points.

Historical Note.

From Kolmogorov to Chen–Chen The Chen–Chen theorem can be seen as an operator-valued extension of Cybenko's theorem (1989) for universal approximation of functions by neural networks, which is itself inspired by Kolmogorov's superposition theorem (1957). The progression is elegant: Kolmogorov showed that any continuous function of n variables can be represented as a superposition of continuous functions of one variable; Cybenko showed that shallow neural networks are universal function approximators; and Chen–Chen showed that a particular two-sub-network architecture universally approximates continuous operators between function spaces. This chain of ideas-from Hilbert's 13th problem (1900) to modern neural operators-spans over a century of mathematics.

DeepONet

The Chen–Chen theorem provides an existence result, but it took until 2019–2021 for Lu, Jin, Pang, Zhang, and Karniadakis to transform it into a practical deep learning architecture: DeepONet (Deep Operator Network).

Architecture

DeepONet is a direct realisation of equation . It consists of two sub-networks:

  1. Branch network 𝐛θbr:mp: Takes as input the values of the input function a at m fixed sensor locations {x1,,xm} and outputs a vector of p coefficients (b1(a),,bp(a)).

  2. Trunk network 𝐭θtr:dp: Takes as input a query location y𝒴 and outputs a vector of p basis function values (t1(y),,tp(y)).

The output is their inner product:

Definition 5 (DeepONet).

The DeepONet approximation of the solution operator is: (Deeponet)𝒢θ(a)(y)=k=1pbk(a)tk(y)=𝐛θbr(a(x1),,a(xm))𝐭θtr(y), where θ=(θbr,θtr) are the combined parameters of the branch and trunk networks.

The beauty of this factorisation is its interpretability: the trunk network learns a set of p basis functions {tk}k=1p for the output space, while the branch network learns the coefficients of the expansion as a function of the input a. This is precisely a learned generalisation of classical basis expansions such as Fourier series, proper orthogonal decomposition (POD), and reduced basis methods.

Insight.

DeepONet as a Learned Basis Expansion In classical reduced-order modelling, one computes a fixed orthonormal basis {ϕk}k=1p (e.g., via SVD/POD of the solution snapshots) and approximates ua(y)k=1pαk(a)ϕk(y), where the coefficients αk(a) are found by projection. DeepONet replaces the fixed basis with a learnable one (the trunk network) and replaces linear projection with a nonlinear encoder (the branch network). This added flexibility allows DeepONet to capture phenomena that require many POD modes with far fewer “neural basis functions.”

Architecture of DeepONet. The branch network encodes the input function a (via its values at m fixed sensor locations) into a coefficient vector (b1,,bp). The trunk network maps a query point y to a basis-function vector (t1,,tp). The output is their inner product, yielding a scalar prediction 𝒢θ(a)(y) at the query point.

Training procedure

Training DeepONet requires a dataset of input–solution pairs {(a(i),u(i))}i=1N, where each u(i) is observed at (possibly different) query locations {yj(i)}j=1Qi. The loss is the mean squared error over all observations: (LOSS)(θ)=1Ni=1N1Qij=1Qi|𝒢θ(a(i))(yj(i))u(i)(yj(i))|2.

Key practical considerations include:

  • Sensor placement. The m sensor locations {x1,,xm} are fixed across all training samples and must be chosen before training. A uniform grid is a common default, but adaptive or random sensor placement can improve performance for problems with localised features.

  • Query point sampling. The query points {yj(i)} can be sampled randomly from Ω at each training iteration, acting as a form of data augmentation and stochastic quadrature.

  • Data generation. Each training pair requires a full PDE solve. For expensive PDEs, this can be the bottleneck. Common strategies include using coarser meshes for training data, multi-fidelity approaches, or augmenting with physics-informed losses.

  • Number of basis functions p. Increasing p gives more capacity but also more parameters. In practice, p[50,200] works well for many benchmark problems.

Physics-informed DeepONet

Just as PINNs augment data losses with PDE residuals, we can create a physics-informed DeepONet (PI-DeepONet) by adding a residual penalty. Since the trunk network maps a query point y to the output value, we can differentiate the DeepONet output with respect to y using automatic differentiation and penalise the PDE residual: (PI Deeponet)PI(θ)=data(θ)+λr1Ni=1N1Mj=1M|𝒩a(i)[𝒢θ(a(i))](yjr)|2.

This hybrid approach reduces the amount of labelled data needed by injecting known physics, and is particularly valuable when full-field solution data is expensive to generate.

Caution.

Differentiating Through the Branch Network In PI-DeepONet, automatic differentiation is applied to the trunk network's contribution (since we differentiate with respect to the spatial coordinate y), not the branch network's contribution. However, because the output is a product bk(a)tk(y), differentiating with respect to y acts only on the trunk: y[𝒢θ(a)(y)]=kbk(a)ytk(y). The branch coefficients bk(a) are treated as constants with respect to the spatial derivatives, which simplifies the implementation considerably.

Worked example: DeepONet for Darcy flow

Example 5 (DeepONet for steady-state Darcy flow).

Consider the two-dimensional Darcy flow equation on the unit square Ω=[0,1]2: (Darcy)(a(𝐱)u(𝐱))=f(𝐱),𝐱Ω, with Dirichlet boundary conditions u=0 on Ω. Here a(𝐱)>0 is the permeability field and f is a fixed forcing (say, f1). We want to learn the operator 𝒢:aua.

Data generation. We draw N=1000 permeability fields from a Gaussian random field: aψ𝒩(0,(Δ+τ2I)α), where ψ(x)=12 if x0 and ψ(x)=3 otherwise (creating a two-phase piecewise-constant field), with τ=3 and α=2.5. Each permeability is discretised on a 64×64 grid, giving m=4096 sensor values. Solutions are computed using a second-order finite element solver on the same grid.

Architecture. The branch network is a CNN with four convolutional layers (since the input is a 64×64 image), producing a vector 𝐛(a)128. The trunk network is an MLP with four hidden layers of width 128, taking y2 and outputting 𝐭(y)128.

Training. We minimise the loss using Adam with learning rate 103, decayed by a factor of 0.5 every 100 epochs, for 500 epochs total. At each iteration, 256 random query points are sampled per input function.

Results. On a held-out test set of 200 permeability fields, the trained DeepONet achieves a relative L2 error of approximately 1.8%, with each evaluation taking 2,ms on a single GPU-a speedup of roughly 104 compared to the finite element solver.

Variants and extensions

Several important extensions of the basic DeepONet architecture have been proposed:

  • POD-DeepONet. Replace the learnable trunk with the leading POD modes of the training solutions: tk(y)=ϕk(y) are fixed, and only the branch network is trained. This reduces the parameter count and can improve accuracy when the solution manifold is well-approximated by a linear subspace.

  • MIONet (Multiple-Input Operator Network). Extends DeepONet to handle multiple input functions (e.g., both an initial condition and a forcing term) via separate branch networks whose outputs are combined by a tensor product: (Mionet)𝒢θ(a1,a2)(y)=k1,k2bk1(a1)ck2(a2)tk1,k2(y).

  • Stacked DeepONet. For time-dependent problems, the output u(𝐱,t) at time tn+1 is predicted using the solution at tn as input: 𝒢θ(un)un+1. This autoregressive approach enables long time horizon predictions, though error accumulation remains a challenge.

Fourier Neural Operator

While DeepONet builds on the Chen–Chen universal approximation theorem, the Fourier Neural Operator (FNO), introduced by Li, Kovachki, Azizzadenesheli, Liu, Bhatt, Stern, and Anandkumar (2021), takes an entirely different-and arguably more elegant-route. The key insight is both simple and powerful: if the PDE solution operator involves convolutions and global interactions, why not parameterise the integral kernel directly in Fourier space?

The key insight: convolutions in Fourier space

Many PDEs-particularly linear ones-have solution operators that can be expressed as integral transforms: (Integral)(𝒦v)(x)=Ωκ(x,y)v(y)dy, where κ is the Green's function or integral kernel. For translation-invariant kernels (κ(x,y)=κ(xy)), this becomes a convolution, and the convolution theorem tells us: (CONV Theorem)[κv](ξ)=κ^(ξ)v^(ξ), where denotes the Fourier transform and ^ the Fourier coefficients. Convolution in physical space becomes pointwise multiplication in Fourier space.

This is the founding observation of FNO: instead of learning the kernel κ in physical space (which requires O(N2) parameters for an N-point discretisation), we directly learn the Fourier-space weights Rϕ(ξ), which requires only O(k) parameters if we truncate to k Fourier modes.

Key Idea.

Parameterising Kernels in Fourier Space The FNO replaces the expensive O(N2) integral kernel in physical space with a learnable Fourier-space filter: a complex-valued matrix Rϕ(ξ) that multiplies the Fourier coefficients of the hidden representation. Since physical solutions of PDEs are typically smooth, the Fourier spectrum decays rapidly, and truncating to the lowest kmax modes introduces negligible error while reducing the parameter count from O(N2) to O(kmaxddv2), where dv is the hidden channel dimension.

The Fourier layer

The FNO consists of a sequence of Fourier layers, each performing a spectral convolution combined with a pointwise nonlinearity. A single Fourier layer maps a function v:Ωdv to v+1:Ωdv as follows:

Definition 6 (Fourier Layer).

Let v:Ωdv be the input to the -th layer. The Fourier layer is defined by: (Layer)v+1(x)=σ(Wv(x)+b+(𝒦v)(x)), where:

  • Wdv×dv and bdv define a pointwise linear transformation (local “bypass”),

  • σ is a pointwise nonlinear activation (typically GeLU),

  • 𝒦 is the spectral convolution operator: (Spectral CONV)(𝒦v)(x)=1(Rϕ[v])(x).

Here Rϕdv×dv×kmax is a learnable complex-valued tensor that acts by matrix–vector multiplication on each retained Fourier mode separately.

Let us unpack the spectral convolution step by step:

  1. Forward FFT: Compute v^(ξ)=[v](ξ) for all retained modes |ξ|kmax.

  2. Fourier-space multiplication: For each retained mode ξ, apply the learnable weight: w^(ξ)=Rϕ(ξ)v^(ξ), where Rϕ(ξ)dv×dv.

  3. Mode truncation: Set all Fourier modes with |ξ|>kmax to zero. This is both a regulariser and the source of the model's efficiency.

  4. Inverse FFT: Compute (𝒦v)(x)=1[w^](x), returning to physical space.

The pointwise linear term Wv(x) plays a crucial role: it captures local, high-frequency interactions that are lost due to Fourier mode truncation. Together, the spectral convolution handles global structure while the pointwise term handles local features.

Full FNO architecture

The complete FNO pipeline consists of three stages:

  1. Lift: A pointwise linear layer lifts the input from the physical dimension da to a higher-dimensional hidden representation of dimension dv: (LIFT)v0(x)=Pa(x)+p0,Pdv×da,p0dv.

  2. Fourier layers: A stack of L Fourier layers (typically L=4): (Stack)v01v12v23v34v4.

  3. Project: A pointwise MLP projects from the hidden dimension dv back to the output dimension (typically 1): (Project)uθ(x)=QvL(x)+q0,Q1×dv,q0.

Top: the full FNO architecture, consisting of a pointwise lifting layer, a stack of four Fourier layers, and a pointwise projection layer. Bottom: internal structure of a single Fourier layer, showing the parallel spectral (FFT multiply IFFT) and pointwise (Wv+b) branches, followed by summation and nonlinear activation.

Zero-shot super-resolution

One of the most remarkable properties of FNO is its discretisation invariance: because the learnable parameters Rϕ(ξ) live in Fourier space and are indexed by frequency rather than grid point, the same trained model can be evaluated on grids of any resolution.

Proposition 2 (Zero-shot super-resolution).

Let 𝒢θ(N) denote the FNO evaluated on an N-point discretisation. If the FNO is trained on resolution N, it can be evaluated at resolution M>N without retraining by:

  1. Computing the FFT on the finer M-point grid,

  2. Applying the same Fourier-space weights Rϕ(ξ) to the retained modes (zero-padding any modes between kmax and M/2),

  3. Computing the inverse FFT on the M-point grid.

The additional high-frequency modes (kmax<|ξ|M/2) pass through unchanged (or are set to zero), preserving the spectral content learned during training.

This zero-shot super-resolution is impossible for grid-based methods like standard CNNs, which have a fixed input/output resolution determined by their architecture.

Remark 5 (Resolution transfer in practice).

While zero-shot super-resolution is theoretically exact for band-limited functions, in practice there is some accuracy degradation when transferring to much higher resolutions, because: (i) the training data distribution at resolution N may not fully represent the fine-scale features visible at resolution M, and (ii) aliasing effects during training can introduce biases. Nevertheless, FNO typically maintains reasonable accuracy at 2× to 4× resolution transfer, which is a significant advantage over grid-based methods.

Complexity analysis

Let us compare the computational cost of different approaches for an operator on a d-dimensional domain discretised with N points per dimension (total grid size Nd):

1.3

MethodComplexity per layerNotes
Dense integral kernelO(N2d)Full kernel κ(x,y)
Standard convolution (CNN)O(NdKd)Local kernel size K
Graph Neural OperatorO(NdKnn)Knn neighbours
FNO (Fourier layer)O(NdlogNd)FFT-based

Proposition 3 (FNO complexity).

A single Fourier layer of the FNO with grid size Nd, hidden dimension dv, and kmax retained modes per dimension has:

  • Computational cost: O(dvNdlogN+dv2kmaxd), dominated by the FFT (O(NdlogN) per channel) for large N, and by the Fourier-space multiplication (O(dv2kmaxd)) for small N.

  • Parameter count: O(dv2kmaxd+dv2)-independent of the grid resolution N.

This should be contrasted with a dense integral operator, which requires O(N2ddv2) parameters and O(N2ddv) operations. For a 2D problem with N=64 and kmax=12, the FNO parameters scale as dv2144 rather than dv216,777,216-a reduction of five orders of magnitude.

FNO for benchmark PDEs

The FNO has been benchmarked on several canonical PDE problems. We highlight two here.

Example 6 (FNO for 2D Darcy flow).

Consider again the steady-state Darcy flow equation on [0,1]2. The input is a piecewise-constant permeability field on a 421×421 grid (sub-sampled to 64×64 for training), and the output is the pressure field u.

Setup. N=1000 training pairs, 200 test pairs. FNO with L=4 Fourier layers, dv=32, kmax=12 modes in each spatial dimension. Trained with Adam (lr=103) for 500 epochs.

Results. Relative L2 test error: 𝟎.𝟖𝟑% (versus 2.26% for a standard CNN and 1.8% for DeepONet on the same data). Inference time: 0.005,s per sample on GPU. Resolution transfer: the model trained on 64×64 achieves 1.14% error when evaluated on 128×128 without retraining.

Example 7 (FNO for 2D Navier–Stokes).

Consider the 2D incompressible Navier–Stokes equations in vorticity form on the periodic torus [0,1]2: (NS)ωt+𝐮ω=νΔω+f,𝐮=0, where ω is the vorticity, 𝐮 is recovered from ω via the Biot–Savart law, and f is a fixed forcing.

Task. Given the vorticity field at the first T0=10 time steps, predict the vorticity at the next T=10 steps (i.e., the operator maps [ω(,1),,ω(,T0)] to [ω(,T0+1),,ω(,T0+T)]).

Results at ν=103 (mildly turbulent):

1.2

MethodRelative L2 error (%)
U-Net19.8
Truncated FNO-2D15.6
FNO-3D (space + time)1.56

The FNO-3D variant treats the temporal dimension as a third spatial dimension and applies the Fourier layer in all three dimensions simultaneously, achieving dramatically better results.

FNO variants

The success of FNO has inspired a rich family of extensions:

  • U-FNO. Adds U-Net-style skip connections between Fourier layers at different resolutions, improving multi-scale modelling.

  • Geo-FNO. Extends FNO to non-rectangular domains by learning a diffeomorphism that maps the irregular domain to a regular one where FFT can be applied.

  • Factorised FNO (F-FNO). Factorises the d-dimensional Fourier convolution into d one-dimensional convolutions along each axis, reducing complexity from O(kmaxd) to O(dkmax).

  • Adaptive FNO. Learns which Fourier modes to retain rather than using a fixed truncation, adapting the spectral representation to the problem structure.

  • Spherical FNO (SFNO). Replaces the Cartesian FFT with spherical harmonic transforms, enabling FNO on the sphere-crucial for weather and climate modelling. This variant has been central to recent breakthroughs in data-driven weather prediction.

Theoretical Foundations

Having seen the practical architectures, we now develop the theoretical machinery that underpins neural operator learning. The central questions are: Can neural operators approximate any continuous operator? How efficiently? And what are the fundamental limits?

Universal approximation revisited

We have already stated the Chen–Chen theorem (Theorem Theorem 2) for DeepONet-type architectures. The analogous result for FNO was established by Kovachki, Lanthaler, and Mishra (2021):

Theorem 3 (Universal approximation for FNO, informal).

Let 𝒢:L2(𝕋d;da)L2(𝕋d;) be a continuous operator on the d-dimensional torus 𝕋d=[0,1]d (i.e., with periodic boundary conditions). For every ε>0, there exist choices of L (number of Fourier layers), dv (hidden dimension), and kmax (number of retained modes) such that the FNO 𝒢θ satisfies: (Universal)supaK𝒢θ(a)𝒢(a)L2<ε, for any compact set KL2(𝕋d;da).

Remark 6 (Periodicity assumption).

The FNO universal approximation result requires periodic boundary conditions (the torus 𝕋d), because the discrete Fourier transform implicitly assumes periodicity. For non-periodic domains, Geo-FNO or domain-extension techniques are needed to maintain theoretical guarantees. This is an important caveat: naively applying FNO to a problem with Dirichlet boundary conditions can produce Gibbs-like oscillations near Ω.

Approximation rates

Universal approximation tells us that neural operators can approximate any continuous operator, but it says nothing about how many parameters are needed. Approximation rate theory addresses this crucial question.

Theorem 4 (Approximation rate for Lipschitz operators, simplified).

Suppose 𝒢:𝒜𝒰 is Lipschitz continuous with constant L𝒢, and the input distribution μ is supported on a compact set K𝒜 whose Kolmogorov n-width satisfies dn(K)Cns for some s>0. Then there exists a DeepONet (or FNO) with O(n) parameters in the branch (or Fourier modes) such that: (RATE)𝔼aμ[𝒢θ(a)𝒢(a)𝒰2]1/2Cns, where C depends on L𝒢, the ambient dimension, and the constant C.

The rate ns mirrors the decay of the Kolmogorov n-width, confirming the intuition that operator learning is easy when the solution manifold is effectively low-dimensional.

The Kolmogorov n-width

The Kolmogorov n-width is a fundamental concept from approximation theory that quantifies the “intrinsic dimensionality” of a set of functions.

Definition 7 (Kolmogorov n-width).

Let K be a compact subset of a Banach space 𝒳. The Kolmogorov n-width of K in 𝒳 is: (Nwidth)dn(K,𝒳)=infdim(Vn)=nsupfKinfgVnfg𝒳, where the outer infimum is over all n-dimensional linear subspaces Vn𝒳.

In plain English: dn(K) is the best worst-case error when approximating elements of K by elements of an optimal n-dimensional linear subspace. If dn(K) decays rapidly (e.g., exponentially), then K can be well-represented by a small number of basis functions, and operator learning is “easy.” If dn(K) decays slowly (e.g., algebraically), the solution manifold is inherently high-dimensional, and any method-classical or neural-faces fundamental difficulties.

Example 8 (Kolmogorov n-width for different PDE families).

  1. Elliptic PDEs (e.g., Darcy flow with smooth permeability): The solution manifold has exponentially decaying n-width: dn(K)Cecn1/d. This explains why both reduced basis methods and neural operators achieve excellent accuracy with modest numbers of basis functions/modes.

  2. Parabolic PDEs with smooth initial data (e.g., heat equation): Similar exponential decay, because the diffusion operator rapidly damps high-frequency components.

  3. Hyperbolic PDEs with shocks (e.g., Burgers' equation, Euler equations): The n-width decays only algebraically: dn(K)n1/2. The presence of shock discontinuities at varying locations makes it impossible to approximate the solution set well with any linear subspace. This is the Kolmogorov barrier, and it applies equally to POD, reduced basis methods, and-in a certain sense-to the linear component of neural operators.

Insight.

The Kolmogorov Barrier and Nonlinear Approximation The Kolmogorov n-width measures the best linear approximation. Neural operators, being nonlinear, can potentially bypass this barrier. For instance, a nonlinear encoder can learn to “register” or “align” shocks before projecting onto a low-dimensional subspace, achieving approximation rates that beat the linear n-width. This is one of the key theoretical motivations for using deep neural networks rather than linear methods for problems with moving discontinuities. However, the extent to which practical neural operators actually achieve this nonlinear bypass is still an active area of research.

Connection to reduced basis methods

Neural operators can be understood as nonlinear generalisations of classical reduced-order models (ROMs). The connection is illuminating:

1.3

Reduced Basis / PODNeural Operator
Basis functionsFixed {ϕk} from SVDLearned (trunk net / Fourier modes)
CoefficientsLinear projection u,ϕkNonlinear encoder (branch net / Fourier layers)
ApproximationLinear: uαkϕkNonlinear: u𝒢θ(a)
n-width barrierCannot beat dn(K)Can potentially beat dn(K)
Offline costModerate (SVD + Galerkin)High (training neural network)
Online costVery low (matrix solve)Very low (forward pass)

Remark 7 (When do neural operators outperform ROMs?).

Neural operators tend to outperform classical ROMs when:

  1. The solution manifold has slowly decaying Kolmogorov n-width (e.g., transport-dominated problems with moving shocks),

  2. The mapping from parameters to coefficients is highly nonlinear,

  3. The problem involves high-dimensional parameter spaces where interpolation-based ROMs suffer from the curse of dimensionality.

For problems with rapidly decaying n-width and smooth parameter-to-coefficient maps (e.g., coercive elliptic PDEs with smooth coefficients), classical ROMs can be competitive with or even superior to neural operators, particularly when interpretability and certified error bounds are desired.

Error decomposition

The total error of a neural operator can be decomposed into three sources:

Theorem 5 (Error decomposition for neural operators).

The total error of a trained neural operator 𝒢θ satisfies: (Error Decomp)𝔼aμ[𝒢θ(a)𝒢(a)2]total errorεapprox2approximation+εgen2generalisation+εopt2optimisation, where:

  • εapprox is the approximation error: the best error achievable within the neural operator's hypothesis class, regardless of data or training. This depends on the architecture (number of layers, modes, hidden dimension).

  • εgen is the generalisation error: the gap between the training loss and the population loss, arising from finite training data. By standard learning theory, this scales as O(parameters/N).

  • εopt is the optimisation error: the gap between the training loss achieved and the global minimum, arising from the non-convexity of the training landscape.

This decomposition guides architecture design: increasing model capacity (more layers, modes, channels) reduces εapprox but may increase εgen, while more data reduces εgen, and better optimisers (learning rate schedules, pre-training, curriculum learning) reduce εopt.

The bias–variance trade-off for neural operators. Increasing model capacity (more Fourier modes, wider hidden layers, deeper networks) decreases the approximation error εapprox but eventually increases the generalisation error εgen. The total error is minimised at an intermediate capacity, which depends on the training set size and the complexity of the target operator.

Limitations of Deterministic Neural Operators

Neural operators represent a transformative advance over classical solvers and PINNs for many applications. Yet they have fundamental limitations that no amount of architectural engineering can overcome. Understanding these limitations is essential for appreciating why generative approaches to PDE solving-the subject of the remaining sections of this chapter-are not merely interesting alternatives but, for many problems, a necessity.

Regression to the mean

The most severe limitation of deterministic neural operators is the regression-to-the-mean problem. When trained with a mean squared error (MSE) loss , the optimal predictor is the conditional mean: (COND MEAN)𝒢θ(a)=𝔼[u|a]=up(u|a)dμ(u).

For deterministic PDEs with unique solutions, this is perfectly fine-the conditional mean is the unique solution. But for chaotic or turbulent systems, the mapping from input to solution is effectively one-to-many: small perturbations in the input (below the measurement precision) lead to vastly different solutions. In such cases, the conditional mean is a blurry average of many possible states, and is not itself a physically realisable solution.

The regression-to-the-mean problem. Left: individual realisations of a turbulent flow are each physically valid but look very different. Right: the conditional mean under MSE training is a nearly flat, blurry function that resembles none of the individual realisations and violates important physical properties (energy spectra, intermittency statistics, etc.).

To make this more precise, consider the vorticity field ω of a turbulent flow. The energy spectrum E(k)k5/3 (Kolmogorov's 5/3 law) characterises the cascade of energy from large to small scales. The conditional mean ω=𝔼[ω|a] suppresses high-frequency fluctuations, leading to a steeper energy spectrum that violates the 5/3 scaling. This is not an artefact of poor training; it is a mathematical consequence of the MSE objective.

Proposition 4 (MSE suppresses variance).

Let u be a random field with conditional mean u=𝔼[u|a] and conditional variance Var(u|a). Then for any deterministic predictor u^(a), the MSE-optimal predictor is u^=u, and: (MSE Decomp)𝔼[uu^(a)2]=𝔼[uu2]+𝔼[uu^(a)2]=𝔼[Var(u|a)]+𝔼[uu^(a)2]. The first term is the irreducible error (aleatoric uncertainty) and cannot be reduced by any deterministic predictor. The only way to capture the variability in u is to produce a distribution over solutions.

No uncertainty quantification

A deterministic neural operator outputs a single point prediction u^=𝒢θ(a) with no accompanying measure of confidence. In safety-critical applications-structural engineering, nuclear reactor design, weather forecasting-practitioners need to know how uncertain the prediction is, not just the prediction itself.

There are post-hoc approaches to add uncertainty estimates to deterministic models:

  • Ensemble methods: Train M independent neural operators and use the spread of their predictions as a proxy for uncertainty. However, ensemble diversity may not correlate with true posterior variance, especially in out-of-distribution regions.

  • MC Dropout: Apply dropout at inference time and interpret the variation across forward passes as uncertainty. This is computationally cheap but often underestimates uncertainty.

  • Bayesian neural operators: Place priors on the network weights and perform (approximate) posterior inference. This is principled but computationally demanding for large-scale models.

None of these approaches produce calibrated, high-dimensional distributions over solution fields. Generating diverse, physically consistent samples from the solution distribution requires a fundamentally different approach: generative modelling.

Fixed discretisation for grid-based methods

While FNO enjoys discretisation invariance (via the Fourier representation), many other neural operators-particularly those based on CNNs, U-Nets, or graph neural networks-are tied to a specific mesh or grid resolution. Changing the resolution requires retraining or introduces interpolation errors. Even for FNO, the zero-shot super-resolution property degrades for large resolution jumps, as discussed in Remark Remark 15.

Training data requirements

Each training pair (a(i),u(i)) requires a full PDE solve, which can be expensive. For 3D time-dependent problems (e.g., turbulent Navier–Stokes), a single high-fidelity simulation may require hours on a GPU cluster. Generating thousands of such pairs for training can cost more than the savings gained at inference time, especially if the model is used for only a few evaluations.

The break-even point depends on the application:

  • Many-query settings (design optimisation, Bayesian inversion, real-time control): The offline training cost is amortised over thousands or millions of queries, making neural operators highly cost-effective.

  • Few-query settings: The upfront data generation and training cost may not be justified. This motivates physics-informed approaches that reduce or eliminate the need for labelled data.

Motivating generative approaches

The limitations above can be summarised in a single observation: deterministic neural operators learn the wrong quantity for stochastic, chaotic, or ill-posed problems. They learn the conditional mean 𝔼[u|a], when what we need is the conditional distribution p(u|a).

Key Idea.

From Deterministic Operators to Generative PDE Solvers The move from deterministic to generative PDE solving is motivated by three needs:

  1. Physical fidelity: Samples from p(u|a) are individually physical and respect the correct statistical structure (energy spectra, intermittency, spatial correlations), unlike the blurry conditional mean.

  2. Uncertainty quantification: The distribution p(u|a) provides calibrated uncertainty estimates over the entire solution field, not just point-wise confidence intervals.

  3. Downstream tasks: For risk assessment, rare-event estimation, and robust design, we need the tails of the distribution, which are invisible to conditional-mean predictors.

The generative modelling toolkit developed in the earlier chapters of this book-variational autoencoders, normalising flows, GANs, score-based diffusion models-provides exactly the machinery needed to learn and sample from p(u|a). The remaining sections of this chapter show how to adapt each of these frameworks to the infinite-dimensional, physics-constrained setting of PDE solving.

Exercises

Exercise 4 (DeepONet for the heat equation).

Consider the one-dimensional heat equation tu=κxxu on [0,1] with u(0,t)=u(1,t)=0 and initial condition u(x,0)=a(x).

  1. Write down the solution operator 𝒢T:au(,T) in terms of the eigenfunctions sin(nπx). How many eigenmodes contribute significantly for large T? Relate this to the Kolmogorov n-width of the solution set.

  2. Design a DeepONet architecture for this problem. How many sensor points m and basis functions p would you use? Justify your choices.

  3. How would a physics-informed DeepONet loss differ from the purely data-driven loss for this problem? Write down the explicit residual term.

  4. Argue that for large T, the operator 𝒢T is “easy” in the sense that a very small p suffices. What happens as T0+?

Exercise 5 (FNO mode selection).

Consider a family of solutions on [0,2π] of the form u(x)=k=1Ku^keikx where the Fourier coefficients satisfy |u^k|Cks for some s>1.

  1. If the FNO retains kmax modes, show that the truncation error satisfies: uukmaxL22C22s1kmax(2s1).

  2. For the Navier–Stokes equations at Reynolds number Re, the Kolmogorov dissipation scale is ηRe3/4, suggesting significant Fourier content up to wavenumber kRe3/4. How many FNO modes would you need to capture all physically relevant scales at Re=104?

  3. Compare the FNO parameter count (with the kmax from part (b)) to the parameter count of a dense kernel approach. At what Reynolds number does FNO become infeasible?

Exercise 6 (The conditional mean is not enough).

Let u(x,t) be the solution to the inviscid Burgers equation tu+uxu=0 on [π,π] with periodic boundary conditions and random initial condition u(x,0)=Asin(x+φ), where A is fixed and φUniform[0,2π] is a random phase.

  1. Show that for any t>0 such that no shock has yet formed, the conditional mean 𝔼[u(x,t)|A] is identically zero. (Hint: use the symmetry of the phase distribution.)

  2. Explain why this conditional mean is not a valid solution of the Burgers equation (except for the trivial u0).

  3. How would a generative model address this problem? What would a sample from the conditional distribution p(u|A) look like?

  4. Compute the MSE of the optimal deterministic predictor and compare it to the MSE of a generative model that produces a single sample. Which has lower expected MSE? Which produces more physically meaningful outputs?

Challenge 1 (From DeepONet to FNO: bridging the architectures).

Show that a single-layer FNO with kmax Fourier modes and no pointwise bypass (W=0) can be written in the DeepONet form 𝒢(a)(y)=k=1pbk(a)tk(y) for an appropriate choice of p, bk, and tk. What are the “trunk” basis functions? What role does the FFT play in computing the “branch” coefficients?

Hint: Expand the spectral convolution using the discrete Fourier basis and identify the branch outputs with the Fourier coefficients of the input, multiplied by the learnable weights.

Transformer-Based PDE Solvers

In the preceding sections we developed two families of neural PDE solvers: Physics-Informed Neural Networks (PINNs), which embed the PDE residual into the loss function of a single-instance neural network, and Neural Operators (FNO, DeepONet), which learn mappings between infinite-dimensional function spaces from data. Both families have achieved remarkable successes, yet both suffer from a common architectural limitation: they struggle to capture long-range spatial dependencies in the solution field.

PINNs use multilayer perceptrons (MLPs) whose receptive field is, in principle, global but whose spectral bias causes them to learn low-frequency components first and high-frequency details painfully slowly. The Fourier Neural Operator circumvents this by operating directly in spectral space, but at the cost of being restricted to uniform grids-a serious limitation for the complex, irregular geometries that arise in real-world engineering (airfoils, turbine blades, blood vessels, city-scale wind simulations).

Enter the Transformer. Originally developed for natural language processing, the Transformer's core mechanism-self-attention- computes pairwise interactions between all tokens in a sequence, regardless of their distance. When the “tokens” are discretisation points (or patches, or learned physical states) of a PDE domain, self-attention naturally captures the long-range, nonlocal interactions that PDEs encode: a pressure wave at one end of a pipe affects the velocity field everywhere; a vortex shed from the leading edge of an airfoil influences the wake far downstream.

Key Idea.

Transformers as Universal Nonlocal Operators The self-attention mechanism computes a weighted integral over the entire spatial domain at each point, making it a natural discrete approximation to the integral operators that appear throughout PDE theory (Green's functions, Fredholm operators, potential theory). This connection is not merely an analogy: as we shall prove in this section, attention can be viewed as a discretised Galerkin projection onto a data-dependent subspace.

This section provides a comprehensive and mathematically rigorous treatment of Transformer-based PDE solvers. We begin with the conceptual and mathematical motivations (Section Why Transformers for PDEs?), then proceed through the major architectures in roughly chronological order: the Galerkin Transformer (Section The Galerkin Transformer), GNOT (Section GNOT: General Neural Operator Transformer), Transolver (Section Transolver), HAMLET (Section HAMLET: Graph Transformer Neural Operator), and PiT (Section PiT: Position-induced Transformer). We then cover the emerging wave of PDE foundation models and conditioning strategies (Section PDE-Conditional Transformers and Foundation Models), in-context operator learning (Section In-Context Operator Learning), and finally the PINNsFormer architecture that replaces the MLP backbone of PINNs with a Transformer (Section PINNsFormer).

Why Transformers for PDEs?

To appreciate why Transformers have become the dominant architecture for PDE solving, we must understand three foundational insights: (i) self-attention captures long-range dependencies that local convolutions miss, (ii) attention operates on sets rather than grids, enabling natural handling of irregular meshes, and (iii) attention is intimately related to the integral operators that constitute the backbone of PDE theory.

Self-attention captures long-range dependencies

Consider an elliptic PDE such as the Poisson equation 2u=f on a domain Ω with Dirichlet boundary conditions. The solution at any interior point 𝐱 depends on the source term f and the boundary data everywhere in the domain, through the Green's function: (Green)u(𝐱)=ΩG(𝐱,𝐲)f(𝐲)d𝐲+ΩGn𝐲(𝐱,𝐲)g(𝐲)dS(𝐲), where G(𝐱,𝐲) is the Green's function of the Laplacian on Ω and g is the boundary data.

This integral representation reveals a fundamental nonlocality: the solution at 𝐱 depends on the values of f at every point 𝐲Ω. A convolutional neural network with a kernel of size k has a receptive field that grows only linearly with depth (or as 𝒪(kL) after L layers), and therefore requires very deep architectures to capture global interactions. The standard self-attention mechanism, by contrast, computes pairwise interactions between all input tokens in a single layer:

Definition 8 (Scaled dot-product attention).

Given query, key, and value matrices Q,KN×dk and VN×dv, the scaled dot-product attention is (Attention)Attn(Q,K,V)=softmax(QKdk)VN×dv. Each row of the output is a weighted average of all rows of V, where the weights depend on the pairwise similarities between queries and keys.

In the PDE context, we interpret the N rows as spatial discretisation points (mesh nodes, collocation points, or patches). The output at each point is a function of all other points, mediated by learned similarity weights. This is precisely the discrete analogue of the integral operator in equation .

Comparison of receptive fields. A CNN with a 3×3 kernel (left) sees only the immediate neighbourhood of each point; capturing global dependencies requires many stacked layers. A Transformer (right) connects every discretisation point to every other point through self-attention in a single layer, naturally modelling the nonlocal integral operators that underpin PDE solutions.

Irregular mesh handling

A second, equally important advantage is that attention operates on sets of tokens, not on regular grids. A convolutional layer assumes that its input lives on a regular Cartesian lattice; applying a CNN to an unstructured triangular mesh or a point cloud requires either interpolation to a regular grid (losing geometric fidelity) or specialised graph-convolutional layers (which reintroduce locality).

Self-attention has no such constraint. Given N points with arbitrary coordinates {𝐱1,,𝐱N}d, we simply encode each point into a query-key-value triplet and let attention determine the interaction weights. Positional information can be injected through positional encodings-either fixed (sinusoidal, random Fourier features) or learned-so that the model is aware of the spatial locations without requiring a grid structure.

Remark 8 (Positional encodings for PDE domains).

Unlike in NLP, where positional encodings encode a one-dimensional sequence order, PDE discretisations live in d for d=1,2,3 (and sometimes higher for parametric problems). Common choices include:

  1. Sinusoidal encodings applied independently to each coordinate: PE(𝐱)2k=sin(ωkxj), PE(𝐱)2k+1=cos(ωkxj), with frequencies ωk chosen as in the original Transformer.

  2. Random Fourier features: PE(𝐱)=[cos(B𝐱),sin(B𝐱)] with Bm×d drawn from a Gaussian, approximating a stationary kernel.

  3. Learned MLPs that map 𝐱d to an embedding vector, allowing the model to discover task-specific spatial representations.

Attention as an integral operator

The deepest reason that Transformers are well suited to PDE solving is that self-attention is a discretised integral operator. Consider a general kernel integral operator of the form (Integral OP)(𝒦v)(𝐱)=Ωκ(𝐱,𝐲)v(𝐲)d𝐲, where κ:Ω×Ω is a kernel function and v:Ω is the input function. This is a Fredholm integral operator of the second kind-precisely the form that appears in Green's function representations, boundary element methods, and the integral formulations of many PDEs.

Now discretise the domain with N points {𝐱1,,𝐱N} carrying quadrature weights {w1,,wN}. The discrete approximation is (Discrete Integral)(𝒦v)(𝐱i)j=1Nwjκ(𝐱i,𝐱j)v(𝐱j). Comparing with the attention output at position i: (ATTN Integral)Attn(Q,K,V)i=j=1Nexp(qikj/dk)exp(qik/dk)wjκ(𝐱i,𝐱j)vj, we see that the softmax-normalised attention weights play the role of the kernel κ evaluated at the discretisation points, and the value vectors vj play the role of the function values.

Proposition 5 (Attention as a discretised kernel integral).

Let κθ(𝐱,𝐲)=exp(WQψ(𝐱)WKψ(𝐲)/dk) be a parametric kernel, where ψ(𝐱)d is the feature representation of point 𝐱 and WQ,WKdk×d are learned projection matrices. Then the softmax attention output computes, for each discretisation point i, a Monte Carlo approximation to the normalised kernel integral: (Normalised Integral)Ωκθ(𝐱i,𝐲)(WVψ(𝐲))d𝐲Ωκθ(𝐱i,𝐲)d𝐲, where the integration measure is replaced by the empirical measure 1Nj=1Nδ𝐱j.

Proof.

Write qi=WQψ(𝐱i), kj=WKψ(𝐱j), vj=WVψ(𝐱j). Then the attention output at position i is Attni=j=1Nexp(qikj/dk)vjj=1Nexp(qikj/dk)=j=1Nκθ(𝐱i,𝐱j)vjj=1Nκθ(𝐱i,𝐱j), which is a normalised empirical average-precisely the Monte Carlo approximation to with the uniform empirical measure 1Njδ𝐱j.

Insight.

The connection between attention and integral operators is not just a mathematical curiosity. It suggests a principled design strategy: we can import decades of knowledge about numerical integration-quadrature rules, adaptive refinement, preconditioning- into the design of attention mechanisms for PDEs. This insight underpins several of the architectures we study in this section.

The quadratic bottleneck and its remedies

The elephant in the room is computational cost. Standard self-attention has 𝒪(N2) time and memory complexity, where N is the number of tokens (discretisation points). For a 2D PDE on a 256×256 grid, N=65,536, and the attention matrix has 4.3×109 entries-far too large for most GPUs.

This has motivated a rich line of work on efficient attention for PDE solving:

  • Linear attention: Replace softmax with a kernel factorisation ϕ(qi)ψ(kj) so that Attni=ϕ(qi)(jψ(kj)vj)/(ϕ(qi)jψ(kj)), reducing complexity to 𝒪(Nd2). This is the approach of the Galerkin Transformer.

  • Cross-attention with learned queries: Introduce MN learnable “slice” queries and compute cross-attention 𝒪(NM). This is the approach of Transolver.

  • Sparse or local attention: Restrict attention to local neighbourhoods plus a few global tokens, as in Longformer-style architectures.

  • Downsampling + global attention: Pool the discretisation to a coarser representation, apply global attention, and upsample. This multiscale strategy is used by GNOT and several others.

Caution.

Not all efficient attention variants are created equal for PDEs. Sparse local attention can miss precisely the long-range interactions that motivated the use of Transformers in the first place. Architectures that reduce the token count via physics-aware compression (e.g., Transolver's intrinsic physical states) tend to perform better than generic sparsification methods that are agnostic to the PDE structure.

The Galerkin Transformer

The Galerkin Transformer, introduced by Cao (NeurIPS 2021), was one of the first architectures to draw a rigorous connection between Transformer attention and classical numerical methods for PDEs. The key insight is that standard softmax attention approximates a Petrov–Galerkin projection, and that by choosing a different normalisation, one can obtain an attention mechanism that corresponds to a Galerkin projection-a cornerstone of finite element theory.

Background: the Galerkin method

Recall the classical Galerkin method for solving a linear PDE. Given an operator equation u=f in a Hilbert space H, we seek an approximate solution uN=j=1Ncjϕj in a finite-dimensional subspace VN=span{ϕ1,,ϕN} such that the residual is orthogonal to VN: (Galerkin Classical)uNf,ϕiH=0,i=1,,N. This yields the linear system 𝐀𝐜=𝐟 where Aij=ϕj,ϕi and fi=f,ϕi.

Definition 9 (Galerkin projection).

The Galerkin projection of a function uH onto VN with respect to a bilinear form a(,):H×H is the element uNVN satisfying (Galerkin PROJ)a(uN,v)=a(u,v),vVN. When a(u,v)=u,v, this reduces to orthogonal projection.

From softmax attention to Galerkin attention

Cao observed that standard softmax attention computes: (Softmax ATTN)Attnisoftmax=jexp(qikj/d)vjjexp(qikj/d), where the normalisation is row-wise: each query qi produces its own probability distribution over keys. This corresponds to a Petrov–Galerkin method where the test functions (queries) and trial functions (keys) live in different spaces.

The Galerkin Transformer replaces this with two alternative attention mechanisms:

Galerkin-type attention.

Instead of row-wise softmax normalisation, Galerkin-type attention normalises column-wise over the keys, corresponding to a symmetric Galerkin projection where test and trial functions come from the same space: (Galerkin ATTN)AttnGalerkin=1NQ(KV). Here KVdk×dv is computed first (at cost 𝒪(Ndkdv)), and then multiplied by Q (at cost 𝒪(Ndkdv)), giving an overall linear complexity of 𝒪(Ndkdv) instead of 𝒪(N2dv).

Fourier-type attention.

An alternative normalisation normalises column-wise over the queries: (Fourier ATTN)AttnFourier=1N(QK)V. The name “Fourier” comes from the observation that when the keys and values are Fourier basis functions, this computation reduces to computing Fourier coefficients-a discrete Fourier-like transform.

Theorem 6 (Galerkin attention as orthogonal projection).

Let VN=span{v1,,vN} denote the subspace spanned by the value vectors, and let ΠVN denote the orthogonal projection onto VN in the 2-inner product. Then the Galerkin attention output , when Q=K, computes (Galerkin PROJ THM)AttniGalerkin=1Nqi(j=1Nkjvj)=qiKV, where KV=1NKV is the empirical cross-covariance between keys and values. When the key vectors form an orthonormal basis (1NKK=Idk), this is exactly the orthogonal projection of qi onto the column space of V through the basis K.

Proof.

Write the attention output at row i: AttniGalerkin=1Nj=1N(qikj)vj=qi(1Nj=1Nkjvj). Define M=1NKV. When 1NKK=I, we have kj forming a discrete orthonormal system. The matrix M acts as a change-of-basis matrix from the K-representation to the V-representation. Multiplying qiM first computes the expansion coefficients of qi in the K-basis (inner products qikj) and then maps them to the V-basis, which is exactly the orthogonal projection onto the V-span through the K-basis.

Comparison of standard softmax attention and Galerkin attention. Standard attention (top) first computes the N×N attention matrix, incurring 𝒪(N2) cost. Galerkin attention (bottom) first computes the d×d cross-covariance M=KV/N, then multiplies by Q, achieving 𝒪(Nd2) complexity-linear in the number of discretisation points.

Architecture details

The full Galerkin Transformer architecture wraps the Galerkin attention mechanism in a standard Transformer encoder-decoder structure:

  1. Input encoding: The input function a(𝐱)𝒜 (e.g., initial condition, forcing term, or coefficient field) is evaluated at N discretisation points. Each point is encoded as hi(0)=MLP([a(𝐱i),𝐱i]) to produce a d-dimensional token.

  2. Galerkin attention layers: A stack of L layers, each consisting of Galerkin multi-head attention followed by a feed-forward network with residual connections and layer normalisation. In the multi-head variant, each head h computes: (Galerkin Multihead)headh=1NQh(KhVh),Qh=XWhQ,Kh=XWhK,Vh=XWhV, and the outputs are concatenated and projected: MHA(X)=[head1;;headH]WO.

  3. Output decoding: A pointwise MLP maps the final hidden representation to the predicted solution value at each discretisation point. Crucially, the output points need not coincide with the input points-the decoder can interpolate to any desired query location by using cross-attention between query positions and the encoded representation.

Example 9 (Galerkin Transformer for Darcy flow).

Consider the steady-state Darcy flow equation on the unit square Ω=[0,1]2: (Darcy)(a(𝐱)u(𝐱))=f(𝐱),𝐱Ω, with Dirichlet boundary conditions u|Ω=0. The operator learning task is: given the permeability field a(𝐱) (sampled from a Gaussian random field), predict the solution u(𝐱).

On the Darcy flow benchmark (from the FNO paper), the Galerkin Transformer achieves a relative L2 error of approximately 0.68% on 421×421 resolution test data, competitive with FNO (0.83%) while using roughly the same number of parameters (2.3M). Crucially, the Galerkin Transformer can be evaluated on resolutions different from the training resolution without retraining, since its attention mechanism is resolution-invariant.

Historical Note.

The connection between attention and Galerkin methods was anticipated by the numerical PDE community's long history of using integral operators and spectral methods. The Galerkin method itself dates back to Boris Galerkin's 1915 paper on elastic rods. The neural attention mechanism, introduced by Bahdanau, Cho, and Bengio in 2014 for machine translation, took nearly seven years to be formally connected to Galerkin projections by Cao (2021). This delay illustrates a recurring theme: deep learning and numerical analysis develop largely independently, and the most fruitful innovations come when researchers bridge the gap between the two communities.

GNOT: General Neural Operator Transformer

While the Galerkin Transformer elegantly reduces attention complexity and connects to classical numerical methods, it was primarily demonstrated on problems with a single input function on a regular grid. Many real-world PDE problems involve multiple heterogeneous inputs-an initial condition, a forcing term, boundary data, and possibly geometric parameters-evaluated on irregular, non-uniform meshes. The General Neural Operator Transformer (GNOT), introduced by Hao, Wang, and co-authors at ICML 2023, addresses these challenges through a carefully designed multi-input, multi-scale architecture.

Problem setup and challenges

GNOT considers the general operator learning problem: given a collection of input functions {a1(𝐱),,aP(𝐱)} and scalar parameters 𝝁p (e.g., Reynolds number, viscosity), learn the solution operator (GNOT Operator)𝒢:(a1,,aP,𝝁)u, where the input functions may be evaluated on different, irregular meshes. For instance, in a fluid–structure interaction problem, the fluid velocity might be known on a tetrahedral mesh while the structural displacement is given on a surface triangulation.

The key challenges are:

  1. Heterogeneous inputs: Different input types (functions on meshes, scalar parameters, boundary conditions on surface meshes) must be unified into a single representation.

  2. Irregular geometry: The discretisation points are not on a regular grid, precluding the use of FFT-based methods like FNO.

  3. Scale: Real-world meshes can have 104106 nodes, requiring efficient attention.

Heterogeneous attention

GNOT introduces a heterogeneous normalised attention mechanism that handles multiple input types within a unified framework.

Definition 10 (GNOT heterogeneous attention).

Given P input types, each producing key-value pairs (K(p),V(p))Np×d for p=1,,P, and query tokens QN×d from the current representation, GNOT computes: (GNOT Hetero ATTN)AttnGNOT(Q,{K(p),V(p)}p=1P)=p=1Pαpsoftmax(Q(K(p))d)V(p), where αp are learned mixing weights satisfying pαp=1 (enforced via softmax over a learnable parameter vector).

This heterogeneous attention allows the model to attend to different input modalities with different attention patterns while producing a unified output representation.

Multi-scale architecture

To handle large meshes efficiently, GNOT uses a multi-scale approach inspired by the Perceiver architecture:

  1. Encoding: Input tokens (from all input types) are projected to a common embedding dimension d. Scalar parameters are broadcast to all tokens via an additive bias.

  2. Cross-attention downsampling: A set of MN learnable latent tokens ZM×d attends to the full input via cross-attention: (GNOT Cross)Z=CrossAttn(Z,X)+Z, where XN×d is the concatenation of all input tokens. This reduces the sequence length from N to M.

  3. Self-attention on latent tokens: Multiple layers of self-attention are applied to the M latent tokens, at cost 𝒪(M2d)-much cheaper than 𝒪(N2) when MN.

  4. Cross-attention upsampling: The output tokens at the desired query locations attend back to the processed latent tokens: (GNOT Decode)Y=CrossAttn(Xquery,Zfinal)+Xquery.

The total complexity is 𝒪(NM+M2), which is linear in N when M=𝒪(N) or M=𝒪(1).

The GNOT architecture. Multiple heterogeneous inputs (initial conditions, boundary conditions, scalar parameters) are encoded and compressed into M latent tokens via cross-attention. Self-attention layers process the latent tokens at cost 𝒪(M2). The output at arbitrary query points is decoded via cross-attention from the latent tokens, giving total complexity 𝒪(NM+M2).

Handling multiple PDE settings

A distinctive feature of GNOT is its ability to handle multiple PDE settings within a single model. By conditioning on scalar parameters 𝝁 (e.g., Reynolds number, Mach number), the same GNOT model can produce solutions for:

  • Different PDE coefficients (varying viscosity in Navier–Stokes).

  • Different domain geometries (by encoding geometry as an input function, e.g., a signed distance field).

  • Different boundary conditions (by including boundary data as a separate input stream).

Proposition 6 (GNOT complexity).

For P input types with a total of N=pNp input tokens, M latent tokens, L self-attention layers, and embedding dimension d, the computational cost of GNOT is (GNOT Complexity)𝒪(NMd+LM2d+NqueryMd), which is linear in the total number of input and output points when M=𝒪(1) with respect to N.

Example 10 (GNOT for Navier–Stokes on complex geometries).

Consider the 2D incompressible Navier–Stokes equations on a domain with multiple obstacles (cylinders of varying radii at varying positions). The inputs are:

  • The signed distance field to the obstacles, evaluated on an irregular triangular mesh with 5,000 nodes.

  • The inlet velocity profile, specified on 200 boundary nodes.

  • The Reynolds number Re[100,500] as a scalar parameter.

GNOT with M=256 latent tokens and L=6 self-attention layers achieves a relative L2 error of 1.2% on the velocity field, compared to 1.8% for FNO (which requires interpolation to a regular grid) and 2.1% for DeepONet.

Transolver

The Transolver (Wu, Hao, Wang, et al., ICML 2024 Spotlight) represents a paradigm shift in how Transformers tokenise PDE domains. Rather than treating each mesh node as a token-which leads to 𝒪(N2) attention for N nodes-Transolver introduces the concept of intrinsic physical states: learned, compact representations that capture the underlying physics of different spatial regions. Attention is computed between these physical states rather than between individual mesh nodes, reducing complexity from 𝒪(N2) to 𝒪(NM) where MN is the number of physical states.

Motivation: physics-aware tokenisation

Consider a complex flow around an airfoil. From a physics perspective, the domain naturally decomposes into a few distinct regions:

  • The boundary layer (thin region of high shear near the airfoil surface).

  • The wake region (downstream of the trailing edge).

  • The freestream region (far from the airfoil, approximately uniform flow).

  • Stagnation and separation regions (near the leading edge and any flow separation points).

Within each region, the physics is relatively homogeneous: the solution has similar local structure and the governing balances (e.g., inertia vs. viscosity) are similar. This motivates grouping nearby mesh nodes with similar physical behaviour into a single “physical state” token, and computing attention at the level of these physical states.

Key Idea.

From Mesh Nodes to Physical States Traditional Transformer PDE solvers tokenise the mesh: each node becomes a token, and attention operates on N tokens. Transolver instead tokenises the physics: it learns to partition the domain into M regions of coherent physical behaviour, each represented by a single token. This is analogous to how domain decomposition methods in classical numerical analysis partition a domain into subdomains-but here the partition is learned from data rather than prescribed.

Physics-attention mechanism

The Transolver architecture has two main stages: (i) slice assignment, which maps each of the N mesh nodes to one of M physical states, and (ii) physics-attention, which computes attention among the physical states and then maps back to the original mesh nodes.

Step 1: Adaptive slice assignment.

Given the input representation XN×d (from the previous layer or the input embedding), compute a soft assignment matrix: (Transolver Assign)S=softmax(XWSτ)N×M, where WSd×M is a learnable projection and τ>0 is a temperature parameter. The column S,m gives the soft membership weights of all N nodes to the m-th physical state.

Step 2: Aggregate to physical states.

The intrinsic physical state for each slice m is computed by a weighted average: (Transolver Aggregate)zm=i=1NSimxii=1NSimd,m=1,,M. Stacking these gives ZM×d, the physics token matrix.

Step 3: Attention among physical states.

Standard multi-head self-attention is applied to the M physics tokens: (Transolver ATTN)Z=MHA(Z)+ZM×d. Since MN, this costs only 𝒪(M2d).

Step 4: Distribute back to mesh nodes.

The updated physics tokens are distributed back to all mesh nodes using the same assignment matrix: (Transolver Distribute)xi=m=1MSimzm,i=1,,N. A residual connection and feed-forward layer complete the block: x^i=FFN(xi+xi)+xi+xi.

Definition 11 (Physics-attention block).

A physics-attention block is the composition of slice assignment , aggregation , self-attention on physics tokens , and distribution . It maps XN×d to X^N×d with computational complexity 𝒪(NMd+M2d).

Theorem 7 (Transolver complexity reduction).

Let a standard Transformer PDE solver with L layers have complexity 𝒪(LN2d). The Transolver with M physical states has complexity (Transolver Complexity)𝒪(L(NMd+M2d))=𝒪(LNMd), since MN implies M2NM. The speedup factor is N/M, which for a typical setting of N=10,000 mesh nodes and M=64 physical states gives a 156× reduction in attention cost.

Proof.

The slice assignment costs 𝒪(NMd) (matrix multiplication plus softmax over M columns). Aggregation costs 𝒪(NMd) (weighted sum). Self-attention costs 𝒪(M2d). Distribution costs 𝒪(NMd). Summing over L layers gives the stated bound. Since M2NM whenever MN (which holds by assumption), the M2d term is dominated.

Transolver's physics-attention mechanism for flow around an airfoil. Left: The N mesh nodes are coloured by their learned slice assignment S, which groups nodes into M coherent physical regions (boundary layer, wake, freestream). Right: Self-attention is computed only among the M physics tokens, at cost 𝒪(M2) instead of 𝒪(N2). The updated tokens are then distributed back to all mesh nodes.

Handling complex geometries

A major strength of Transolver is its ability to handle genuinely complex geometries. The learned slice assignment matrix S automatically adapts to the geometry: near a thin boundary layer, many nodes are assigned to the “boundary layer” physical state; in the quiescent freestream, fewer physical states are needed.

Transolver has been demonstrated on:

  • Airfoils (AirfRANS dataset): Steady-state RANS simulations around parametrically varying NACA airfoil shapes. Transolver achieves state-of-the-art relative L2 error on pressure and velocity fields.

  • Vehicle aerodynamics (DrivAerNet): 3D external aerodynamics around car bodies, with 105 surface mesh nodes. The 𝒪(NM) scaling makes this tractable where 𝒪(N2) attention would be prohibitive.

  • Elasticity (von Mises stress on 3D parts): Predicting stress distributions on complex mechanical parts with unstructured tetrahedral meshes.

Example 11 (Transolver for airfoil flow prediction).

Consider predicting the pressure coefficient Cp(𝐱) around NACA 4-digit airfoils at varying angles of attack α[5,15] and Reynolds numbers Re[2×106,6×106]. The AirfRANS dataset provides RANS simulation data on unstructured meshes with 7,000 nodes per sample.

With M=96 physics tokens and L=8 physics-attention layers, Transolver achieves a relative L2 error of 0.46% on the test set, compared to 0.82% for PointTransformer, 1.14% for FNO (on interpolated regular grids), and 0.61% for GNOT. The learned slice assignments reveal that the model automatically discovers physically meaningful regions: a tight cluster of assignments near the suction peak, a distinct cluster in the wake, and broad clusters in the freestream.

HAMLET: Graph Transformer Neural Operator

While Transolver compresses the mesh into learned physical states, an alternative strategy is to explicitly model the mesh as a graph and use graph Transformers that combine the local inductive bias of graph neural networks (GNNs) with the global attention of Transformers. The HAMLET framework (Bryutkin, Hao, et al., ICML 2024) takes this approach, building a modular architecture that separately encodes PDE-specific information and geometric/mesh information before combining them via a graph Transformer.

Graph structure for PDE domains

Given a mesh =(𝒱,) with nodes 𝒱={1,,N} and edges (connecting neighbouring mesh elements), HAMLET constructs a multi-relational graph that encodes:

  1. Spatial adjacency: The original mesh connectivity, providing local structural information.

  2. Multi-scale connections: Edges connecting nodes at different scales of a coarsened mesh hierarchy (obtained via graph coarsening algorithms), enabling efficient multi-resolution information flow.

  3. Boundary-to-interior edges: Explicit connections from boundary nodes to interior nodes, reflecting the influence of boundary conditions on the solution.

Definition 12 (HAMLET multi-relational graph).

The HAMLET graph 𝒢=(𝒱,12R) has R relation types, where:

  • 1: mesh adjacency edges (from the original mesh).

  • 2,,R1: multi-scale edges from coarsened mesh levels.

  • R: boundary-to-interior edges.

Each edge (i,j,r)r carries edge features encoding the relative position 𝐱j𝐱i and the edge type r.

Modular encoder architecture

HAMLET uses a modular encoder that separately processes PDE-specific information and geometric information:

PDE info encoder.

The PDE information at each node i (input function values, boundary condition types and values, source terms) is processed by a dedicated MLP: (Hamlet PDE ENC)hiPDE=MLPPDE([a(𝐱i),bi,f(𝐱i)])d, where a is the input function, bi encodes boundary condition type and value (zero for interior nodes), and f is the source term.

Geometry encoder.

The geometric information (node coordinates, edge vectors, element areas) is processed by a separate encoder: (Hamlet GEOM ENC)higeom=MLPgeom([𝐱i,LocalGeomi])d, where LocalGeomi encodes local geometric features such as element areas, angles, and curvatures at node i.

Fusion.

The two encodings are fused via element-wise multiplication and addition: (Hamlet Fusion)hi(0)=hiPDEhigeom+hiPDE+higeom.

Graph Transformer layers

The fused representations are processed by a stack of graph Transformer layers. Each layer combines:

  1. Local message passing: A GNN-style update using the mesh adjacency edges, capturing local interactions: (Hamlet Local)mi()=j𝒩(i)αij()WV()hj(), where 𝒩(i) is the neighbourhood of node i in the mesh and αij() are graph attention coefficients.

  2. Global attention: A subset of M “virtual nodes” (analogous to GNOT's latent tokens) aggregates global information via cross-attention from all mesh nodes, and then broadcasts back. This provides the global receptive field that local message passing lacks.

  3. Multi-relational aggregation: Messages from different edge types are combined with learnable weights: (Hamlet Multirel)hi(+1)=hi()+r=1Rβrmi,r(), where mi,r() is the message from relation type r.

Remark 9 (HAMLET vs. Transolver: complementary strategies).

HAMLET and Transolver represent two complementary approaches to efficient Transformer-based PDE solving. Transolver learns the domain decomposition (via slice assignments) and computes attention among the resulting physical states. HAMLET prescribes the graph structure (from the mesh) and combines local GNN message passing with global virtual-node attention. HAMLET is more natural for problems where the mesh structure carries important information (e.g., adaptive meshes refined in regions of interest), while Transolver excels when the mesh is a discretisation artefact and the underlying physics has coherent large-scale structure.

PiT: Position-induced Transformer

The Position-induced Transformer (PiT), introduced at ICML 2024, takes a different approach to making Transformers efficient for PDEs. Rather than reducing the number of tokens (Transolver) or using a graph structure (HAMLET), PiT exploits the positional structure inherent in PDE discretisations to induce a structured, efficient attention pattern.

Key insight: spatial proximity implies interaction strength

The fundamental observation is that in most PDEs, the interaction strength between two points decays with their spatial distance. For elliptic PDEs, the Green's function typically decays as |G(𝐱,𝐲)||𝐱𝐲|2d in d dimensions (logarithmically in 2D). For parabolic PDEs, the heat kernel decays exponentially with distance. Even for hyperbolic PDEs where information propagates along characteristics, the relevant interactions are structured by the geometry of the characteristic surfaces.

Proposition 7 (Position-induced attention structure).

Let κ(𝐱,𝐲) be a radially decaying kernel, i.e., κ(𝐱,𝐲)=ϕ(|𝐱𝐲|) for a monotonically decreasing function ϕ:[0,)[0,). If the attention weights approximate κ, then the attention matrix A has the structure: (PIT Structure)Aijϕ(|𝐱i𝐱j|), which is approximately sparse: entries decay rapidly away from the block-diagonal structure induced by spatial proximity.

Position-induced attention

PiT exploits this structure by decomposing the attention computation into two components:

Positional bias.

A positional bias function b:d×d encodes the spatial relationship between points: (PIT BIAS)b(𝐱i,𝐱j)=MLPpos(𝐱i𝐱j), where MLPpos is a small MLP that maps relative positions to a scalar bias. This is added to the attention logits: (PIT ATTN)Aij=qikjdk+b(𝐱i,𝐱j).

Hierarchical attention.

To reduce the 𝒪(N2) cost of computing all pairwise biases, PiT uses a hierarchical decomposition:

  1. Fine level: Full attention within local neighbourhoods of radius r (containing k points each).

  2. Coarse level: Cluster the domain into N/k supernodes, compute attention among supernodes, and broadcast back.

The total complexity is 𝒪(Nk+(N/k)2)=𝒪(Nk+N2/k2), which is minimised at k=N2/3 giving 𝒪(N5/3)-sub-quadratic.

Definition 13 (PiT attention).

The PiT attention output at node i is (PIT FULL)PiT-Attni=j𝒩r(i)A~ijvj+c=1CAicvc, where 𝒩r(i) is the set of points within distance r of 𝐱i, A~ij are the local attention weights (with positional bias), C=N/k is the number of supernodes, Aic are the coarse-level attention weights from node i to supernode c, and vc is the aggregated value of supernode c.

Connection to numerical PDE methods

PiT's hierarchical attention has deep connections to classical numerical methods:

  • Multigrid methods: PiT's fine-coarse decomposition mirrors the V-cycle of multigrid: local smoothing on the fine grid followed by correction on a coarser grid. The key difference is that multigrid restricts and prolongs the solution, while PiT restricts and prolongs the attention.

  • -matrices: The hierarchical matrix (-matrix) framework in numerical linear algebra represents dense matrices arising from integral equations in a compressed, hierarchical format by exploiting the low-rank structure of off-diagonal blocks. PiT's hierarchical attention can be viewed as a learned -matrix.

  • Fast multipole method (FMM): The FMM computes N-body interactions in 𝒪(N) time by replacing distant interactions with multipole expansions. PiT's supernode aggregation is analogous to the FMM's multipole expansion.

Insight.

PiT demonstrates that the most effective Transformer architectures for PDEs are not generic efficient attention mechanisms (like Performer or Linformer), but rather designs that respect the mathematical structure of PDEs. The spatial decay of Green's functions, the multi-scale nature of PDE solutions, and the hierarchical structure of numerical methods all provide blueprints for attention design. The future of Transformer-based PDE solving lies in ever-tighter integration with classical numerical analysis.

PDE-Conditional Transformers and Foundation Models

The architectures discussed so far-Galerkin Transformer, GNOT, Transolver, HAMLET, PiT-are trained on data from a specific PDE or a specific family of PDEs with varying parameters. A more ambitious goal is to build foundation models for PDEs: large, pretrained Transformers that can solve many different types of PDEs, potentially even generalising to PDE families unseen during training. This subsection covers the key ideas behind PDE-conditional Transformers and the emerging landscape of PDE foundation models.

Unisolver: conditioning on PDE structure

The Unisolver observes that different PDEs have different mathematical structures (different differential operators, different types of nonlinearities), and that a universal solver must be conditioned on these structural properties. The key innovation is a taxonomy of PDE conditioning strategies:

Definition 14 (Domain-wise vs. point-wise PDE conditioning).

Let a PDE be characterised by its differential operator 𝒩, domain Ω, and boundary/initial conditions.

  1. Domain-wise conditioning: A single embedding vector 𝐞PDEd encodes the global PDE type (e.g., “heat equation”, “Navier–Stokes”, “Helmholtz”) and is added to all tokens: (Domain COND)hi(0)hi(0)+𝐞PDE. This is appropriate when the PDE type is uniform across the domain.

  2. Point-wise conditioning: Each discretisation point i receives a conditioning vector 𝐜id that encodes the local PDE structure (e.g., the local value of a spatially varying coefficient, the local boundary condition type): (Point COND)hi(0)hi(0)+MLP(𝐜i). This is necessary when the PDE has spatially varying structure (e.g., heterogeneous media, mixed boundary conditions).

Unisolver uses a combination of both conditioning types. The PDE type is encoded as a domain-wise embedding, while spatially varying parameters (coefficients, source terms, boundary conditions) are encoded point-wise. This allows a single model to handle a heterogeneous dataset of PDE problems.

Theorem 8 (Unisolver universality, informal).

Under mild regularity conditions on the PDE families, a sufficiently large Unisolver model (with L layers, H heads, embedding dimension d, and point-wise + domain-wise conditioning) can approximate the solution operator for any PDE in the training distribution to within ϵ>0 in the L2(Ω) norm, with the number of parameters scaling polynomially in 1/ϵ and the dimension of the PDE parameter space.

Zero-shot inference across PDE families

A remarkable finding is that Unisolver, trained on a diverse dataset of PDE families (heat equations, wave equations, advection-diffusion, reaction-diffusion, Burgers, incompressible Navier–Stokes), can perform zero-shot inference on PDE families not seen during training. For example:

  • Trained on heat and advection-diffusion equations, Unisolver achieves non-trivial accuracy on the convection-diffusion equation (which combines features of both).

  • Trained on 2D PDEs, Unisolver transfers to 3D versions of the same PDEs by leveraging the coordinate-agnostic nature of the attention mechanism.

This zero-shot capability arises because the point-wise conditioning mechanism allows the model to “read” the local PDE structure from the input, rather than memorising specific PDE types.

Multiple Physics Pretraining (MPP)

The Multiple Physics Pretraining (MPP) framework (McCabe, Blancard, et al., NeurIPS 2024) takes the foundation model idea further by pretraining a large Transformer on a massive, diverse dataset of PDE simulations spanning multiple physics domains.

The key design choices are:

Unified tokenisation.

All PDE solutions are represented as spatial fields on regular or irregular grids. Each spatial patch (e.g., 8×8 region on a 2D grid) is tokenised as a vector, analogous to Vision Transformer (ViT) patches for images. The number of physical channels varies by PDE type (1 for scalar equations, 3 for velocity fields, etc.), and is handled by a per-channel linear projection to a common embedding dimension.

Physics-aware masking.

During pretraining, random patches of the solution field are masked, and the model is trained to reconstruct them-a masked autoencoder (MAE) objective. The masking ratio is high (75%) to force the model to learn meaningful physical correlations rather than interpolation shortcuts.

Scaling laws.

MPP demonstrates that PDE foundation models obey scaling laws analogous to those observed in large language models. As the model size increases from 10M to 1B parameters and the dataset grows from 104 to 106 PDE simulations, the validation loss decreases as an approximate power law: (MPP Scaling)valCNparamsαDβ, with α0.07 and β0.12 (dataset-dependent). This suggests that continued scaling of PDE foundation models will yield predictable improvements.

Exercise 7 (Scaling law derivation).

Suppose the validation loss of a PDE foundation model follows the scaling law with C=5.0, α=0.07, β=0.12.

  1. (a)

    If the current model has Nparams=108 parameters and is trained on D=105 simulations, what is the validation loss?

  2. (b)

    To halve the validation loss, by what factor must you increase the model size (keeping the dataset fixed)?

  3. (c)

    Alternatively, by what factor must you increase the dataset size (keeping the model fixed)?

  4. (d)

    Discuss the practical implications: which is more expensive, generating more PDE simulation data or training a larger model?

CoDA-NO: Codomain Attention Neural Operator

The Codomain Attention Neural Operator (CoDA-NO, NeurIPS 2024) introduces a fundamentally different attention mechanism: instead of attending across spatial positions (the domain), CoDA-NO attends across the output channels (the codomain).

Definition 15 (Codomain attention).

Given a representation HN×C×d where N is the number of spatial points, C is the number of output channels (e.g., C=3 for velocity in 3D Navier–Stokes), and d is the feature dimension, codomain attention computes: (Codomain ATTN)CodAttn(H)n=softmax(QnKnd)Vn, where Qn,Kn,VnC×d are the query, key, and value matrices for spatial point n, obtained by linear projections of HnC×d. The attention is between channels at the same spatial point.

Codomain attention is computationally cheap (𝒪(NC2d) with C typically small) and captures the inter-channel correlations that are crucial for multi-field PDEs. For example, in Navier–Stokes, the pressure and velocity fields are coupled through the incompressibility constraint 𝐮=0; codomain attention allows the model to learn these couplings.

CoDA-NO uses codomain attention in combination with spatial attention (either via FNO-style spectral convolutions or Galerkin attention) to capture both spatial and inter-channel dependencies. It is pretrained on a diverse multi-physics dataset and fine-tuned for specific PDE tasks, achieving strong transfer learning performance.

Example 12 (CoDA-NO transfer learning).

CoDA-NO is pretrained on a dataset containing simulations of 2D incompressible Navier–Stokes (vorticity formulation), 2D shallow water equations, and 2D reaction-diffusion systems. When fine-tuned on the compressible Euler equations (not seen during pretraining), CoDA-NO with just 100 fine-tuning samples achieves the same accuracy as an FNO trained from scratch on 1,000 samples-a 10× data efficiency improvement due to transfer. The codomain attention mechanism is particularly effective because it transfers the learned inter-channel correlations (e.g., velocity-pressure coupling) across PDE families with similar multi-field structure.

Towards PDE foundation models: a synthesis

The approaches of Unisolver, MPP, and CoDA-NO represent three complementary pillars of PDE foundation models:

  1. Unisolver: Conditioning the Transformer on PDE structure (domain-wise + point-wise), enabling a single model to handle diverse PDE types.

  2. MPP: Scaling up pretrained Transformers on massive multi-physics datasets, demonstrating predictable scaling laws.

  3. CoDA-NO: Introducing codomain attention for inter-channel transfer learning across PDE families.

The three complementary pillars of PDE foundation models. Unisolver provides PDE-type conditioning for handling diverse PDE families. MPP demonstrates scaling laws for multi-physics pretraining. CoDA-NO introduces codomain attention for inter-channel transfer learning. A fully realised PDE foundation model would integrate all three approaches.

In-Context Operator Learning

One of the most surprising capabilities of large language models is in-context learning: the ability to perform new tasks at inference time simply by providing a few input-output examples in the prompt, without any gradient updates. Can we achieve the same for PDE solving? The answer is yes, and the resulting framework- In-Context Operator Learning (ICON)-represents a fascinating convergence of language modelling ideas and operator learning.

ICON: learning operators from demonstrations at inference

ICON, introduced by Yang, Liu, and co-authors (PNAS, 2023), trains a Transformer to take as input a sequence of input-output function pairs {(a1,u1),,(aK,uK)}-the “demonstrations”-together with a new query input aK+1, and outputs the predicted solution uK+1. Crucially, the demonstrations define the operator implicitly: the model must infer what operator maps a to u from the examples alone.

Definition 16 (In-context operator learning).

Let 𝒢:𝒜𝒰 be an unknown operator (e.g., the solution operator of a PDE). Given K demonstration pairs {(ak,𝒢(ak))}k=1K and a query input aK+1, the ICON model fθ predicts: (ICON)u^K+1=fθ(a1,u1,a2,u2,,aK,uK,aK+1). The model is trained on a meta-distribution over operators: the training loss averages over randomly sampled operators 𝒢, random demonstrations, and random query inputs.

The architecture processes the demonstration sequence by interleaving each input function ak and output function uk as tokens, similar to how a language model processes alternating prompt and response tokens. Self-attention over this interleaved sequence allows the model to:

  1. Identify the pattern relating inputs ak to outputs uk (i.e., infer the operator).

  2. Apply the inferred operator to the query input aK+1.

Theorem 9 (ICON approximation guarantee, informal).

Under a Bayesian meta-learning framework where the operator 𝒢 is drawn from a prior distribution p(𝒢), the optimal ICON predictor converges to the posterior mean: (ICON Posterior)f(a1,u1,,aK,uK,aK+1)=𝔼[𝒢(aK+1)|uk=𝒢(ak),k=1,,K]. As K, the posterior concentrates on the true operator, and the prediction error vanishes.

Exercise 8 (ICON convergence rate).

Suppose the operator 𝒢 is a linear integral operator with kernel κL2(Ω×Ω), and the ICON model has access to K demonstrations.

  1. (a)

    Show that the posterior mean estimate of κ has mean squared error 𝒪(1/K) when the demonstrations are i.i.d. samples from a Gaussian process prior over input functions.

  2. (b)

    For a nonlinear operator 𝒢, argue heuristically that the convergence rate depends on the “complexity” of 𝒢 (e.g., the number of terms in a polynomial chaos expansion), and that more demonstrations are needed for more complex operators.

  3. (c)

    Design a toy experiment: choose 𝒢 to be the solution operator of the 1D heat equation with varying initial conditions, and plot the ICON prediction error as a function of K for K=1,2,4,8,16.

PDEformer: PDE as computational graph

While ICON treats the operator as an implicit “black box” to be inferred from demonstrations, the PDEformer (ICLR 2024) takes a more structured approach: it explicitly represents the PDE itself as a computational graph and processes it with a graph Transformer.

The key insight is that any PDE can be represented as a directed acyclic graph (DAG) where:

  • Leaf nodes: Input variables (x, t), parameters (ν, κ), and the unknown function u.

  • Internal nodes: Mathematical operations (differentiation /x, multiplication, addition, nonlinear functions like sin, exp).

  • Root node: The PDE residual 𝒩[u]f=0.

Example 13 (PDEformer graph for Burgers equation).

The viscous Burgers equation tu+uxu=νxxu is represented as the following computational graph:

The graph explicitly encodes the structure of the PDE-what operations are applied to what variables in what order. A graph Transformer processes this graph to produce an embedding of the entire PDE, which is then used to condition a neural operator for solving it.

LLM-inspired ideas for PDEs

The success of in-context learning for PDEs has inspired a broader programme of importing ideas from large language models:

  1. Autoregressive PDE solving: Treating the time axis as a sequence and generating solutions autoregressively, one time step at a time, using causal attention. This mirrors how LLMs generate text token by token.

  2. Prompt engineering for PDEs: Providing the model with carefully chosen demonstrations that “steer” the inference towards the desired PDE family or solution regime.

  3. Chain-of-thought for PDEs: Instead of directly predicting the final solution, having the model output intermediate quantities (e.g., the pressure field before the velocity field in a Navier–Stokes solve) as “reasoning steps.”

  4. Retrieval-augmented PDE solving: Augmenting the model's input with retrieved examples of similar PDEs from a database, analogous to retrieval-augmented generation (RAG) in NLP.

Challenge 2 (ICON for coupled multiphysics).

Design an ICON-style in-context operator learning framework for coupled multiphysics problems (e.g., fluid–structure interaction, where the fluid velocity field and the structural displacement field are coupled through boundary conditions at the fluid–solid interface). Address the following questions:

  1. (a)

    How should the demonstration pairs be structured when the operator has multiple input and output fields?

  2. (b)

    How should the attention mechanism handle cross-field interactions (e.g., the coupling between fluid pressure and structural stress at the interface)?

  3. (c)

    What is the expected scaling of the number of demonstrations needed as a function of the number of coupled fields?

PINNsFormer

All the architectures discussed so far in this section are data-driven: they learn operators from input-output pairs generated by classical solvers. The PINNsFormer (Zhao, Fang, and Karniadakis, 2023) takes a different approach: it replaces the MLP backbone of a Physics-Informed Neural Network (PINN, Section Physics-Informed Neural Networks) with a Transformer, combining the physics-informed loss formulation of PINNs with the representational power of Transformers.

Motivation: limitations of MLP backbones

Recall that a standard PINN parameterises the solution uϕ(𝐱,t) as an MLP and minimises the PDE residual at collocation points. MLPs suffer from two well-known limitations:

  1. Spectral bias: MLPs with smooth activation functions (tanh, sigmoid) learn low-frequency components of the solution first and struggle with high-frequency features (shocks, sharp gradients, oscillations).

  2. No temporal structure: The MLP treats time t as just another input coordinate, with no architectural mechanism to capture the causal, sequential nature of time evolution.

PINNsFormer addresses both limitations simultaneously.

Pseudo Sequence Generator

The key challenge in applying a Transformer to PINNs is that collocation points {(𝐱i,ti)}i=1N are not naturally sequential. PINNsFormer introduces the Pseudo Sequence Generator (PSG), which converts each collocation point into a short sequence by sampling additional points along the time axis.

Definition 17 (Pseudo Sequence Generator).

Given a collocation point (𝐱,t) and a sequence length parameter Lseq, the PSG generates a pseudo-sequence: (PSG)𝒮(𝐱,t)={(𝐱,t0),(𝐱,t1),,(𝐱,tLseq1)}, where t0<t1<<tLseq1=t are uniformly spaced time points: t=t/(Lseq1) for =0,,Lseq1.

The physical intuition is clear: the solution at (𝐱,t) depends on the history of the solution at the same spatial location at earlier times. By providing this temporal context as a sequence, the Transformer can capture causal dependencies through its attention mechanism.

Architecture

The PINNsFormer architecture consists of:

  1. Input embedding: Each element of the pseudo-sequence is embedded by a small MLP: (Pinnsformer Embed)h(0)=MLPembed(𝐱,t)+PE(t)d, where PE(t) is a sinusoidal positional encoding.

  2. Transformer encoder: A standard Transformer encoder with L layers of multi-head self-attention and feed-forward networks processes the sequence [h0(0),,hLseq1(0)]. The self-attention uses causal masking (each token can only attend to earlier tokens in the sequence), enforcing the causal structure of time evolution.

  3. Output: The hidden state at the last position (tLseq1=t) is mapped to the predicted solution value: (Pinnsformer Output)uϕ(𝐱,t)=MLPout(hLseq1(L)).

  4. Physics-informed loss: The loss function is exactly the same as for standard PINNs (equation ): PDE residuals are computed via automatic differentiation through the Transformer, and the loss penalises the residuals at collocation points plus boundary and initial condition violations.

Wavelet activation functions

To further combat spectral bias, PINNsFormer introduces wavelet activation functions that replace the standard smooth activations (tanh, GELU) in the feed-forward layers: (Wavelet Activation)σwav(x)=w1ψ1(xb1a1)+w2ψ2(xb2a2), where ψ1 is the Mexican hat wavelet (negative normalised second derivative of a Gaussian): (Mexican HAT)ψ1(x)=23π1/4(1x2)ex2/2, and ψ2 is the Morlet wavelet: (Morlet)ψ2(x)=ex2/2cos(5x). The parameters w1,w2,a1,a2,b1,b2 are learnable, allowing the model to adaptively select the frequency content of its activations.

Proposition 8 (Wavelet activations mitigate spectral bias).

Let u(𝐱,t) be the true PDE solution with frequency content up to wave number kmax. A PINNsFormer with wavelet activations having learnable scale parameters a1,a2(0,) can represent functions with arbitrarily high frequency content by choosing aj=𝒪(1/kmax). In contrast, an MLP with tanh activation has an effective frequency bandwidth that scales only as 𝒪(L) with network depth L in the Neural Tangent Kernel regime.

Example 14 (PINNsFormer for the Burgers equation with a shock).

Consider the inviscid Burgers equation tu+uxu=0 with initial condition u0(x)=sin(πx) on [1,1], which develops a shock (discontinuity) at t1/π.

Standard PINNs with tanh activations produce severe oscillations near the shock (Gibbs-like ringing) and achieve a relative L2 error of 15%. PINNsFormer with wavelet activations and a pseudo-sequence length of Lseq=8 achieves a relative L2 error of 3.2% and produces a much sharper shock profile. The improvement comes from two sources:

  1. The wavelet activations provide the high-frequency representational capacity needed to resolve the sharp gradient.

  2. The causal Transformer processes the temporal history, allowing it to “track” the characteristics converging to form the shock.

Exercise 9 (Comparing PINNsFormer components).

Design an ablation study for PINNsFormer on the 1D advection equation tu+cxu=0 with c=1 and smooth initial condition u0(x)=exp(25(x0.5)2) on [0,2π] with periodic boundary conditions.

  1. (a)

    Compare four configurations: (i) standard PINN (MLP + tanh), (ii) PINN with wavelet activations, (iii) PINNsFormer with tanh activations (Transformer + PSG + tanh), (iv) full PINNsFormer (Transformer + PSG + wavelet). Which component contributes more: the Transformer architecture or the wavelet activations?

  2. (b)

    Vary the pseudo-sequence length Lseq{2,4,8,16,32} and plot the error vs. Lseq. Is there an optimal sequence length? What happens when Lseq is too large?

  3. (c)

    Replace causal masking with full (bidirectional) attention. How does this affect the solution quality? Does it improve or harm the result for this particular PDE? Explain why.

Comparative analysis and practical guidance

To help the practitioner navigate the growing zoo of Transformer-based PDE solvers, we provide a comparative summary in Table Table 2.

MethodAttention typeComplexityIrregular meshMulti-PDE
Galerkin Trans.\Linear (Galerkin)𝒪(Nd2)PartialNo
GNOTCross-attn + latent𝒪(NM+M2)YesPartial
TransolverPhysics-attn𝒪(NM)YesNo
HAMLETGraph + virtual nodes𝒪(N||+NM)YesNo
PiTHierarchical𝒪(N5/3)YesNo
UnisolverConditioned attn𝒪(N2) or linearYesYes
ICONIn-context𝒪((KN)2)PartialYes
PINNsFormerCausal self-attn𝒪(NLseq2)YesNo
Comparison of Transformer-based PDE solvers. N is the number of mesh nodes, M the number of latent/physics tokens, d the embedding dimension, L the number of layers.

Remark 10 (Choosing the right architecture).

The choice of Transformer architecture depends on the problem characteristics:

  1. Regular grid, moderate N: Galerkin Transformer or FNO. The linear complexity and spectral properties are ideal.

  2. Irregular mesh, single PDE family: Transolver (if the domain has coherent physical regions) or HAMLET (if the mesh structure is informative).

  3. Multiple input types, heterogeneous data: GNOT, which was specifically designed for this setting.

  4. Multiple PDE families, desire for zero-shot: Unisolver or MPP-pretrained models.

  5. Physics-informed (no data), single instance: PINNsFormer, which inherits the mesh-free, data-free advantages of PINNs while mitigating spectral bias.

  6. Few-shot, new operator at inference: ICON, which requires no retraining.

We close this section with a forward-looking exercise.

Exercise 10 (Design your own Transformer PDE solver).

You are given the following problem: predict the steady-state temperature distribution T(𝐱) inside a 3D heat exchanger with complex internal fin geometry. The inputs are: (i) the inlet temperature profile on an irregular surface mesh (2,000 boundary nodes), (ii) the fin geometry encoded as a signed distance field on a tetrahedral mesh (50,000 nodes), and (iii) the thermal conductivity κ[10,100] W/(mK) as a scalar parameter.

  1. (a)

    Which of the architectures in Table Table 2 would you choose, and why? Consider the mesh size, irregularity, heterogeneous inputs, and the need for parametric generalisation over κ.

  2. (b)

    Sketch the architecture, specifying: (i) how each input is tokenised, (ii) the attention mechanism, (iii) the output decoder, and (iv) the total computational complexity.

  3. (c)

    Propose a training dataset: what PDE solver would you use to generate the training data? How many samples? What range of κ and fin geometries?

  4. (d)

    What evaluation metrics would you use beyond relative L2 error? Consider physical quantities of interest (e.g., total heat transfer rate, maximum temperature) and their prediction accuracy.

Diffusion and Score-Based Models for PDE Simulation

“The idea that one can create structure by progressively removing noise is, in retrospect, deeply physical: it is the reverse of the second law of thermodynamics.” - Yang Song

We have now seen two families of neural PDE solvers. Physics-Informed Neural Networks (Section Physics-Informed Neural Networks) embed PDE constraints into the loss function but produce a single deterministic solution per problem instance. Neural operators (Section Neural Operator Learning) learn the mapping from PDE parameters to solutions across entire families, but they too are deterministic: given input parameters θ, they output a single prediction u^.

In this section, we make the leap to generative PDE solvers based on diffusion and score-matching. The core idea is both simple and profound: instead of learning a point estimate u^=𝒢(θ), we learn the distribution p(u|θ) over solution fields conditioned on PDE parameters. Sampling from this distribution produces diverse, physically plausible solution fields-complete with calibrated uncertainty-that respect the governing equations. This is the single most important conceptual shift in this chapter.

Why diffusion models for PDEs?

The mean-regression problem

Consider a turbulent flow governed by the incompressible Navier–Stokes equations at Reynolds number Re=10,000. Two runs with initial conditions that differ by a single-bit perturbation will diverge exponentially, exploring vastly different regions of the solution manifold. Yet if we train a deterministic neural operator u^=𝒢ϕ(θ) by minimising the mean squared error (MSE) over a training set of (θi,ui) pairs, the network learns the conditional expectation: (Condmean)u^MSE(θ)=𝔼p(u|θ)[u]=up(u|θ)du. This conditional mean is a weighted average over all possible trajectories. For turbulent flows, it produces an unphysical blurred field: the sharp vortices, thin shear layers, and intermittent structures that characterise real turbulence are washed out.

The mean-regression problem. For multi-modal distributions over solution fields (e.g., turbulent flows), averaging over diverse trajectories yields a blurred, physically meaningless field. Deterministic neural operators trained with MSE loss converge to this conditional mean.

More concretely, suppose the solution distribution is bimodal: p(u|θ)=12δ(uuA)+12δ(uuB), where uA and uB are two very different but equally valid turbulent realisations. The conditional mean u^=12(uA+uB) resembles neither uA nor uB. A generative model, by contrast, would sample either uA or uB with equal probability, always producing a physically valid field.

Key Idea.

Generative Models Avoid Mean Regression A generative model learns the full conditional distribution p(u|θ), not just its mean. Each sample is a plausible, physically consistent solution field. This is essential for:

  • Turbulence: capturing sharp structures and intermittency.

  • Chaotic dynamics: representing sensitivity to initial conditions through ensemble diversity.

  • Ill-posed inverse problems: quantifying non-identifiability via posterior spread.

  • Uncertainty quantification: providing calibrated error bars by examining the spread of generated samples.

Why diffusion, specifically?

Among generative models-GANs, VAEs, normalising flows, autoregressive models, diffusion-why have diffusion models emerged as the dominant paradigm for PDE applications? Several reasons:

  1. Iterative refinement parallels multigrid. The reverse diffusion process refines a noisy field over many steps, progressing from coarse, large-scale features to fine details. This coarse-to-fine generation mirrors the multigrid hierarchy used in classical PDE solvers, where one resolves low-frequency error components on coarse grids before refining on fine grids.

  2. Stable training. Unlike GANs, diffusion models are trained with a simple denoising objective that does not require adversarial min-max optimisation. Training is stable, does not suffer from mode collapse, and scales well to high-dimensional fields.

  3. Plug-and-play conditioning. Diffusion models support posterior sampling via guidance: one can inject physics constraints (PDE residuals, conservation laws, boundary conditions) and observational data (sparse sensors, partial measurements) into the sampling process without retraining the model.

  4. Calibrated uncertainty. The stochastic nature of the sampling process naturally yields an ensemble of solutions, whose spread provides a measure of uncertainty.

  5. Forward diffusion = heat equation. The forward noising process is itself a PDE-the heat equation in the space of solution fields! This deep connection between diffusion models and PDEs provides both intuition and mathematical tools.

The physical analogy: forward diffusion as the heat equation

Let us make the connection between diffusion models and PDEs precise. Recall that the forward process of a variance-preserving (VP) diffusion model adds Gaussian noise to a data sample x0 according to the stochastic differential equation (SDE): (Forward SDE)dx=12β(t)xdt+β(t)dWt,t[0,T], where β(t)>0 is the noise schedule and Wt is a Wiener process. The marginal distribution pt(x) satisfies the Fokker–Planck equation: (Fokkerplanck)ptt=12β(t)(xpt)+β(t)2Δpt. When β is constant and we drop the drift term, this reduces to the heat equation tp=β2Δp. The forward diffusion literally heats up the data distribution until it becomes featureless Gaussian noise-thermal equilibrium.

The reverse process, which generates data by starting from noise, can then be understood as anti-diffusion: the creation of structure from chaos, running the heat equation backwards in time. Of course, the heat equation is irreversible in general (information is lost), so the reverse process requires knowledge of the score function xlogpt(x), which encodes the structure that must be restored at each time step.

Insight.

Diffusion as Heating and Cooling Forward process: A structured PDE solution field is gradually heated (diffused) until all spatial structure is destroyed and only Gaussian noise remains. This is the thermodynamic arrow of time-entropy increases.\\[4pt] Reverse process: Starting from pure noise, the score function guides the gradual cooling (anti-diffusion) that restores spatial structure. Each denoising step removes some “thermal noise” and refines the field, analogous to annealing in materials science.\\[4pt] The score function is the missing ingredient: It tells us which structure to create at each step, compensating for the information lost during forward diffusion.

The forward–reverse duality of diffusion models for PDE solution fields. Forward diffusion (top) progressively destroys spatial structure by adding noise, analogous to the heat equation. Reverse diffusion (bottom) restores structure by iteratively denoising, guided by the learned score function. The process naturally generates fields from coarse to fine scales.

Score-based diffusion on function spaces

PDE solutions live not in n but in infinite-dimensional function spaces: the velocity field of a fluid is an element of a Sobolev space Hs(Ω;d), the temperature field lives in L2(Ω), and so on. A truly satisfying theory of diffusion models for PDEs must therefore operate directly on function spaces, independent of any particular discretisation (finite element mesh, spectral coefficients, point cloud).

In this subsection, we develop the mathematical framework for score-based diffusion in infinite dimensions, following the landmark works of Pidstrigach (2022), Kerrigan et al. (2023), and Lim et al. (JMLR, 2025).

The finite-dimensional recap

We begin with a rapid review of the score-based framework in n. Let p0(x) denote the data distribution (e.g., a distribution over discretised solution fields xn). The forward noising process is an Itô SDE: (Forward General)dxt=f(xt,t)dt+g(t)dWt,x0p0, where f:n×[0,T]n is the drift, g:[0,T] is the diffusion coefficient, and Wt is an n-dimensional Wiener process. The marginal density pt(x) evolves according to the Fokker–Planck equation. At the terminal time T, we want pTπ, a tractable reference distribution (typically 𝒩(0,In)).

Definition 18 (Score function).

The score function of a probability density pt(x) is the gradient of its log-density: (Score)st(x)xlogpt(x)=xpt(x)pt(x). The score points in the direction of steepest increase of the log-density at each point in space.

The fundamental result of Anderson (1982) states that the forward SDE has a time-reversed counterpart: (Reverse SDE)dxt=[f(xt,t)g(t)2xlogpt(xt)]dt+g(t)dWt, where Wt is a Wiener process running backwards in time (from t=T to t=0), and the crucial extra term g(t)2xlogpt(xt) is precisely the score function scaled by the diffusion coefficient.

Theorem 10 (Anderson's reverse-time SDE, 1982).

Let {xt}t[0,T] be a diffusion process satisfying with marginals {pt}. Then the time-reversed process {yt} defined by ytxTt satisfies the SDE (Anderson)dyt=[f(yt,Tt)+g(Tt)2ylogpTt(yt)]dt+g(Tt)dWt, with y0pT. If we can evaluate (or approximate) logpt for all t, we can sample from p0 by simulating this reverse SDE starting from y0pTπ.

In practice, we approximate the score with a neural network sϕ(x,t)xlogpt(x) trained via denoising score matching: (DSM)DSM(ϕ)=𝔼t𝒰[0,T]𝔼x0p0𝔼xtpt|0(xt|x0)[λ(t)sϕ(xt,t)xtlogpt|0(xt|x0)2], where pt|0(xt|x0) is the tractable transition kernel of the forward SDE (Gaussian for linear drift), and λ(t) is a positive weighting function.

Remark 11 (Denoising score matching is tractable).

The key insight of denoising score matching (Vincent, 2011; Song et al., 2021) is that one never needs to evaluate the intractable marginal score xlogpt(x). Instead, we match the conditional score xtlogpt|0(xt|x0), which is known in closed form. For the variance-preserving SDE with f(x,t)=12β(t)x and g(t)=β(t): pt|0(xt|x0)=𝒩(xt;α(t)x0,(1α(t)2)I), where α(t)=exp(120tβ(s)ds), giving: xtlogpt|0(xt|x0)=xtα(t)x01α(t)2.

Extension to Hilbert spaces

Now we move to infinite dimensions. Let be a separable Hilbert space (for concreteness, think of =L2(Ω) where Ωd is the physical domain). We wish to define a diffusion process on that perturbs function-valued data u0.

The first obstacle is the definition of a Wiener process. In finite dimensions, Wt is a standard Brownian motion with identity covariance. In infinite dimensions, the analogous object-a -valued Brownian motion with identity covariance-does not exist as a bona fide -valued process (its sample paths would have infinite norm almost surely). We must use a Q-Wiener process with a trace-class covariance operator Q.

Definition 19 (Q-Wiener process on a Hilbert space).

Let Q: be a symmetric, positive, trace-class operator (i.e., tr(Q)<), with eigenvalues {λk}k=1 and corresponding orthonormal eigenfunctions {ek}k=1. A Q-Wiener process is the -valued process: (Qwiener)WtQ=k=1λkβk(t)ek, where {βk(t)}k=1 are independent standard scalar Brownian motions. The trace-class condition kλk< ensures that the series converges in L2(Ω;).

The covariance operator Q controls the spatial correlation structure of the noise. A common choice is Q=(Δ+τ2I)α for some α>d/2 and τ>0, yielding a Matérn-like spatial covariance that decays with distance and penalises high-frequency noise.

Caution.

No “white noise” in infinite dimensions In n, the standard Wiener process has covariance In (white noise). In =L2(Ω), the analogous “cylindrical Wiener process” with Q=I does not take values in -its sample paths are distributions, not functions. One must always use a trace-class Q, which smooths out the noise at high frequencies. This has a direct physical interpretation: the noise added during forward diffusion must be spatially correlated, not pixel-independent.

With the Q-Wiener process in hand, we can define the forward SDE on : (Forward Hilbert)dut=f(ut,t)dt+g(t)dWtQ,u0μ0, where μ0 is a probability measure on (the data distribution over PDE solution fields), f:×[0,T] is a (possibly nonlinear) drift operator, and g:[0,T] is a scalar diffusion coefficient.

Definition 20 (Score function on a Hilbert space).

Let μt be the law of ut on . If μt has a density ρt with respect to a reference Gaussian measure γQ (with covariance Q), the score is defined as: (Score Hilbert)st(u)logρt(u), where denotes the Fréchet derivative in . In the eigenbasis {ek} of Q: (Score Components)st(u),ek=u,eklogρt(u).

Theorem 11 (Reverse SDE on Hilbert spaces).

Under regularity conditions on f, g, and the score st, the time-reversed process vtuTt satisfies: (Reverse Hilbert)dvt=[f(vt,Tt)+g(Tt)2QsTt(vt)]dt+g(Tt)dWtQ, with v0μT. Note the appearance of Qst rather than just st: the covariance operator weights the score correction according to the noise structure.

Remark 12 (The role of Q in the reverse SDE).

The product Qst(u) in has a clear interpretation: the score correction is applied only along directions in which noise was injected. Eigenvalues of Q that are zero (or very small) correspond to function-space directions along which no noise was added, and consequently no correction is needed. This ensures that the reverse process respects the regularity class of the forward process.

Score matching in function space

How do we train a score network sϕ(u,t)st(u) when u lives in a function space? The denoising score matching objective generalises naturally. For the Ornstein–Uhlenbeck forward process dut=12β(t)utdt+β(t)dWtQ, the transition kernel is Gaussian on : (Transition Hilbert)ut|u0𝒩(α(t)u0,σ(t)2Q), where α(t)=exp(120tβ(s)ds) and σ(t)2=1α(t)2.

The conditional score in the eigenbasis of Q is: (COND Score Hilbert)ulogpt|0(ut|u0),ek=utα(t)u0,ekσ(t)2λk. The function-space denoising score matching loss is: (DSM Hilbert)DSM(ϕ)=𝔼t,u0,ut[λ(t)sϕ(ut,t)ulogpt|0(ut|u0)2].

Proposition 9 (Discretisation consistency).

Let Pn:n be a projection onto the first n eigenmodes of Q (or any orthogonal projection), and let u(n)=Pnu be the discretised field. If sϕ is parameterised as a resolution-agnostic architecture (e.g., a neural operator that accepts inputs of any resolution), then the function-space loss evaluated on discretisations of increasing resolution n converges to the infinite-dimensional loss as n. In particular, a model trained on resolution n can be applied at resolution mn without retraining.

This discretisation agnosticism is a major practical advantage: one can train on coarse grids (cheap) and generate on fine grids (expensive but needed only at inference time).

Example 15 (VP diffusion on L2([0,1])).

Consider =L2([0,1]) with the Fourier basis {ek(x)=2sin(kπx)}k=1. Let Q have eigenvalues λk=k3 (the covariance of a mean-zero Gaussian random field with Sobolev regularity H1). The Q-Wiener process is: WtQ(x)=k=1k3/2βk(t)2sin(kπx). The noise realisation at any time t is a random function that is spatially smooth (it lives in H1/2ϵ for any ϵ>0). High-frequency modes (k1) receive negligible noise, so the forward diffusion primarily corrupts the large-scale structure of the solution field.

For the VP forward process with β(t)=βmin+(βmaxβmin)t, the noised field at time t is: ut(x)=α(t)u0(x)+σ(t)k=1k3/2ϵk2sin(kπx),ϵk𝒩(0,1). The denoising score matching target for mode k is: utα(t)u0,ekσ(t)2k3=k3σ(t)ϵk. Note the k3 amplification: the score for high-frequency modes is much larger in magnitude, reflecting the fact that Q-noise in those modes is very small, so the score must “shout loudly” to correct even small perturbations.

Mathematical rigor: well-posedness

We collect the key conditions under which the infinite-dimensional framework is well-posed.

Assumption 1 (Regularity conditions for function-space diffusion).

We require:

  1. Q is trace-class on : tr(Q)=k=1λk<.

  2. The data measure μ0 is absolutely continuous with respect to the Gaussian measure γQ=𝒩(0,Q).

  3. The score st(u)=log(dμt/dγQ)(u) is γQ-a.e. well-defined and satisfies 𝔼μt[st2]<.

  4. The drift f is Lipschitz on uniformly in t.

Theorem 12 (Well-posedness of function-space score matching (Lim et al., JMLR 2025)).

Under Assumption Assumption 1, the denoising score matching loss DSM(ϕ) is well-defined and finite. Moreover, its unique minimiser (over the class of all measurable functions s:×[0,T]) is the true score st(u)=logρt(u). The reverse SDE with the true score has a unique strong solution, and the law of vT coincides with μ0.

Historical Note.

From Pixels to Functions Score-based diffusion models were originally formulated for finite-dimensional data (images, audio). The extension to function spaces was motivated by the need for discretisation-agnostic generative models in scientific computing. Key milestones include:

  • Pidstrigach (2022): First formulation of score-based generative models on infinite-dimensional spaces, introducing the Q-Wiener framework.

  • Kerrigan et al. (2023): Functional diffusion processes with neural operator score networks.

  • Lim et al. (JMLR, 2025): Rigorous well-posedness theory and convergence guarantees for score matching in function space.

  • Baldassari et al. (2024): Conditional score-based diffusion for Bayesian inference on function spaces with applications to PDE inverse problems.

DiffusionPDE: joint diffusion over coefficients and solutions

One of the most striking applications of diffusion models to PDEs is DiffusionPDE (Huang et al., NeurIPS 2024), which proposes learning the joint distribution p(a,u) over PDE coefficients a (e.g., a spatially varying diffusivity field) and solution fields u, simultaneously. This is a conceptually radical idea: rather than viewing the PDE as a fixed constraint that maps au, we treat both a and u as random fields drawn from a joint distribution that encodes the PDE relationship implicitly.

Problem formulation

Consider a parametric PDE of the form: (Parametric PDE)𝒩[u;a](𝐱)=0,𝐱Ω, where a:Ω is a spatially varying coefficient (e.g., permeability in Darcy flow, thermal conductivity in heat transfer) and u:Ω is the solution. Given a distribution p(a) over coefficient fields and the deterministic map au(a) defined by the PDE, there is a joint distribution p(a,u) supported on the manifold {(a,u):𝒩[u;a]=0}.

DiffusionPDE learns this joint distribution using a single diffusion model. The data is represented as a multi-channel field: (Multichannel)z(𝐱)=(a(𝐱),u(𝐱))2, and the diffusion model is trained on paired samples (ai,ui) where ui is obtained by solving the PDE with coefficient field ai.

Sparse observation guidance

At inference time, DiffusionPDE can reconstruct full coefficient and solution fields from sparse observations. Suppose we observe the solution u at a sparse set of sensor locations 𝒮={𝐱1,,𝐱m} with values yj=u(𝐱j)+ηj (where ηj is measurement noise). We wish to sample from the posterior: (Posterior)p(a,u|y𝒮)p(a,u)p(y𝒮|u).

This posterior sampling is achieved via classifier guidance applied during the reverse diffusion process. At each denoising step t, the unconditional score zlogpt(zt) is augmented with a likelihood gradient: (Guided Score)s~t(zt)=ztlogpt(zt)unconditional score+wobsztlogp(y𝒮|zt)observation guidance, where wobs is a guidance weight. For Gaussian observation noise with variance σobs2: (OBS Likelihood)logp(y𝒮|zt)12σobs2j=1m|yju^0(𝐱j;zt,t)|2, where u^0(;zt,t) is Tweedie's estimate of the clean field from the noisy state zt at diffusion time t: u^0=𝔼[u0|ut=zt].

PDE constraint guidance

A key innovation of DiffusionPDE is using the PDE residual itself as an additional guidance signal. Since the generated fields (a,u) should satisfy the PDE, we define a PDE-residual likelihood: (PDE Likelihood)logpPDE(zt)wPDE2𝒩[u^0;a^0]Ω2, where a^0 and u^0 are Tweedie estimates of the clean coefficient and solution fields. The total guided score becomes: (Total Guidance)s~t(zt)=ztlogpt(zt)+wobsztlogp(y𝒮|zt)+wPDEztlogpPDE(zt).

The DiffusionPDE sampling pipeline. Starting from Gaussian noise, each denoising step is guided by two signals: sparse observation guidance (top) that pushes the generated fields toward consistency with measured sensor values, and PDE residual guidance (bottom) that enforces the governing equation. The output is a jointly generated coefficient–solution pair (a^0,u^0).

Architecture and training

DiffusionPDE uses a U-Net backbone with the following design choices:

  • Multi-channel input. The coefficient field a and solution field u are concatenated as channels of a single spatial field. For systems with multiple solution components (e.g., velocity 𝐯 and pressure p in Navier–Stokes), all components are stacked.

  • Time embedding. The diffusion time t is encoded via sinusoidal positional embeddings and injected into each residual block, following the standard DDPM architecture.

  • Training data. Paired samples (ai,ui) are generated by sampling ai from a prior (e.g., a Gaussian random field) and solving the PDE numerically to obtain ui.

  • Loss. The standard ϵ-prediction loss: (ϕ)=𝔼t,z0,ϵ[ϵϕ(zt,t)ϵ2], where zt=α(t)z0+σ(t)ϵ and ϵ𝒩(0,I).

Example 16 (DiffusionPDE for Darcy flow).

Consider the 2D Darcy flow equation on Ω=[0,1]2: (Darcy)(a(𝐱)u(𝐱))=f(𝐱),𝐱Ω, with u|Ω=0. The coefficient field a(𝐱) represents permeability and is drawn from a log-normal random field: loga𝒢𝒫(0,k) with a Matérn kernel k.

DiffusionPDE trains on 10,000 pairs (ai,ui) at resolution 64×64. At inference, given only m=0.01×64241 random sensor observations of u (about 1% of the grid), the guided sampling procedure recovers both a and u with relative L2 error below 5%. This dramatically outperforms deterministic baselines (FNO, DeepONet) that require substantially more observations.

Proposition 10 (Posterior consistency of guided diffusion).

Let pϕ(z) denote the marginal distribution of the diffusion model's generated samples, and let p~ϕ(z|y) denote the distribution under observation guidance with weight w. Under mild regularity conditions, as w: p~ϕ(z|y)wδ(zz), where z=argmaxzpϕ(z)p(y|z) is the MAP estimate. Conversely, as w0, p~ϕ(z|y)pϕ(z) (the prior). Intermediate values of w interpolate between the prior and the MAP estimate, with w=1 corresponding (approximately) to the true posterior.

Physics-informed diffusion models

While DiffusionPDE applies physics constraints at inference time (via guidance), an alternative approach embeds physics directly into the training objective. This is the strategy of Physics-Informed Diffusion Models (PIDMs), introduced by Bastek and Kochmann (ICLR 2025).

Motivation: PDE residuals as virtual observables

Recall the PINN philosophy: the PDE residual 𝒩[u](𝐱)=0 is treated as a constraint that must hold at every point in the domain. PIDMs import this idea into the diffusion framework. At each training step, the denoised estimate u^0 (obtained from the current noise prediction ϵϕ(ut,t)) should approximately satisfy the PDE. We can therefore add a physics loss to the denoising objective: (PIDM LOSS)PIDM(ϕ)=DSM(ϕ)denoising loss+λphys𝔼t,u0,ut[𝒩[u^0(ut,t;ϕ)]Ω2]physics loss, where u^0(ut,t;ϕ)=1α(t)(utσ(t)ϵϕ(ut,t)) is the Tweedie estimate of the clean sample.

Definition 21 (PIDM training objective).

A Physics-Informed Diffusion Model augments the standard denoising score matching loss with a PDE residual penalty evaluated on the denoised estimate u^0. The full objective is: (PIDM FULL)PIDM(ϕ)=𝔼t𝒰[0,T][𝔼u0,ϵ[ϵϕ(ut,t)ϵ2]data-driven term+λphys(t)𝔼u0,ϵ[𝒩[u^0]2]physics-informed term], where λphys(t) is a time-dependent weight that may be annealed during training.

Computing PDE residuals through the denoiser

A subtlety arises: to evaluate 𝒩[u^0], we need spatial derivatives of u^0. Since u^0 depends on ut (a discretised field on a grid), these derivatives must be computed via finite differences on the grid or via spectral methods. The gradient of the physics loss with respect to ϕ flows through the denoiser: (PIDM GRAD)ϕ𝒩[u^0]2=2𝒩[u^0],𝒩[u^0]u^0ϕΩ, where 𝒩[u^0] is the linearisation (Fréchet derivative) of the PDE operator and u^0ϕ comes from backpropagating through the noise-prediction network. For PDEs involving second-order spatial derivatives, one must compose spatial differentiation operators with the neural network Jacobian, which can be expensive but is readily handled by modern automatic differentiation frameworks.

Time-dependent physics weighting

The balance between the denoising loss and the physics loss is controlled by λphys(t). Bastek and Kochmann (2025) propose a schedule that increases the physics weight at low noise levels (small t), where the denoised estimate u^0 is close to a clean field and the PDE residual is meaningful, and decreases it at high noise levels (large t), where u^0 is still heavily corrupted and enforcing the PDE is premature: (PIDM Schedule)λphys(t)=λ0(1σ(t)/σ(T))γ, where λ0>0 is the base weight and γ>0 controls the steepness of the annealing.

Insight.

Physics Constraints Are Most Useful at Low Noise At high diffusion times (t near T), the denoised estimate u^0 is a rough, blurry approximation of the clean field. Enforcing fine-grained PDE constraints on such blurry fields is counterproductive-it can inject high-frequency artefacts. As the noise level decreases (t0), the denoised estimate becomes increasingly sharp and the PDE residual becomes physically meaningful. The annealing schedule λphys(t)(1σ(t)/σ(T))γ respects this hierarchy.

Theoretical justification

The PIDM objective can be justified from a Bayesian perspective. Consider the generative model as defining a prior pϕ(u) over solution fields. The PDE constraint 𝒩[u]=0 defines a likelihood pPDE(u)exp(12σPDE2𝒩[u]2), where σPDE reflects our tolerance for residual violations. The PIDM objective approximately maximises the marginal likelihood: (PIDM Bayes)logpphys=logpϕ(u)pPDE(u)du, with respect to ϕ. The physics loss acts as a regulariser that biases the learned distribution toward PDE-satisfying fields.

Theorem 13 (PIDM reduces PDE residuals).

Let pϕPIDM denote the distribution learned by the PIDM objective and pϕDSM the distribution learned by pure denoising score matching. Under standard regularity assumptions and with λphys>0: 𝔼upϕPIDM[𝒩[u]2]𝔼upϕDSM[𝒩[u]2]. That is, samples from the PIDM have smaller PDE residuals on average than samples from a purely data-driven diffusion model. The inequality is strict when the data distribution is not perfectly PDE-satisfying (e.g., due to solver noise or finite training data).

Example 17 (PIDM for the 2D Navier–Stokes equations).

Bastek and Kochmann (2025) apply PIDMs to generate vorticity fields ω(𝐱,t) for the 2D incompressible Navier–Stokes equations: (NS Vorticity)ωt+(𝐯)ω=νΔω,×𝐯=ω𝐳^. The denoising network is a U-Net that takes as input a noised vorticity field and the diffusion time t. The physics loss evaluates the vorticity-transport residual on the denoised estimate: phys=𝔼[tω^0+(𝐯^0)ω^0νΔω^02], where 𝐯^0 is obtained from ω^0 via the Biot–Savart law (a Poisson solve). The physics loss reduces the mean PDE residual by 35–60% compared to the baseline diffusion model, with no degradation in perceptual quality.

Conditional diffusion for forecasting and data assimilation

Many PDE applications require not unconditioned generation but conditional generation: given some partial information (initial conditions, sparse sensor data, boundary measurements, low-resolution fields), produce a high-fidelity solution field. In this subsection, we develop the theory and practice of conditional diffusion models for PDE forecasting and data assimilation.

Conditioning strategies

There are two broad strategies for conditioning a diffusion model:

  1. Training-time conditioning (“conditional model”). The score network sϕ(ut,t,c) takes the conditioning information c (e.g., initial condition, boundary data, PDE parameters) as an additional input. The model directly learns the conditional score ulogpt(u|c).

  2. Inference-time conditioning (“post-hoc guidance”). The score network sϕ(ut,t) is trained unconditionally. At sampling time, Bayes' rule is applied: (Bayes Guidance)ulogpt(u|c)=ulogpt(u)unconditional score+ulogpt(c|u)likelihood score. The likelihood score is estimated from the conditioning data (e.g., via Tweedie's formula and a forward model).

Each strategy has trade-offs:

1.2

CriterionConditional modelPost-hoc guidance
Requires retraining for new conditions?YesNo
Exact posterior sampling?ApproximatelyApproximately
Handles diverse conditioning types?Needs designPlug-and-play
Sample qualityHigherCan be lower
Computational cost at inferenceLowerHigher

Autoregressive diffusion for time-stepping

For time-dependent PDEs, a natural strategy is autoregressive diffusion: train a conditional diffusion model pϕ(u(n+1)|u(n)) that generates the next time step u(n+1) given the current state u(n), then roll out iteratively: (Autoregressive)u(0)sampleu(1)sampleu(2)sample

The score network takes as input the noised target ut(n+1) concatenated with the (clean) conditioning state u(n): (Autoregressive Score)sϕ(ut(n+1),t,u(n))ut(n+1)logpt(u(n+1)|u(n)).

Caution.

Error Accumulation in Autoregressive Rollouts Like deterministic autoregressive models, diffusion-based rollouts suffer from error accumulation: small inaccuracies at step n compound over subsequent steps. However, the stochastic nature of diffusion sampling provides a form of implicit regularisation-each step samples from a distribution rather than following a single trajectory, which can prevent the model from locking into spurious attractors. Nevertheless, for long rollouts (>50 steps), error control strategies such as noise injection scheduling, periodic re-anchoring to observations, or learned correction steps may be needed.

Data assimilation with diffusion models

Data assimilation is the process of combining a dynamical model (typically a PDE) with sparse, noisy observations to estimate the full state of a system. Classical methods (Kalman filters, ensemble Kalman filters, 4D-Var) require either linearity or tangent-linear adjoints of the forward model. Diffusion models offer a fundamentally different approach: learn the distribution over states, then condition on observations during sampling.

The data assimilation problem can be formalised as posterior sampling: (DA Posterior)p(u|y1:K)p(u)k=1Kp(yk|k[u]), where u is the full spatiotemporal state, yk is the k-th observation, and k is the observation operator (e.g., spatial interpolation to sensor locations). The prior p(u) is defined by the trained diffusion model, and the likelihood terms p(yk|k[u]) are applied via guidance.

Example 18 (Diffusion-based data assimilation for sea surface temperature).

Consider estimating the sea surface temperature (SST) field over the North Atlantic from a sparse array of 50 buoy measurements (out of a 256×256 grid with 65,000 grid points-less than 0.1% observation coverage). A diffusion model is trained on historical SST snapshots from reanalysis data.

At inference, observation guidance pushes the generated SST field to match the 50 buoy readings while the unconditional score ensures that the generated field has the correct spatial statistics (fronts, eddies, boundary currents). Compared to optimal interpolation (kriging), the diffusion approach:

  • reduces mean absolute error by 30%;

  • produces sharper frontal structures (no over-smoothing);

  • provides calibrated uncertainty via the ensemble of generated samples.

Applications to weather and climate

Diffusion models have recently shown remarkable promise in weather and climate applications:

  • GenCast (DeepMind, 2024): A diffusion model for medium-range weather forecasting that generates ensemble forecasts at 0.25 resolution. GenCast matches or exceeds the European Centre for Medium-Range Weather Forecasts (ECMWF) operational ensemble on many skill scores, while producing forecasts in seconds rather than hours.

  • CorrDiff (NVIDIA, 2024): Corrective diffusion for downscaling coarse weather model outputs to high resolution. Uses a conditional diffusion model where the condition is the low-resolution forecast and the target is the high-resolution analysis field.

  • SeedsDiff (2024): Seed-based diffusion for ensemble generation in numerical weather prediction, using diffusion to perturb initial conditions and generate diverse ensemble members.

These applications demonstrate that diffusion models can serve as powerful emulators of the atmospheric PDE system (the primitive equations), with the added benefit of natively producing calibrated ensemble forecasts.

CoCoGen: physically consistent score-based generation

CoCoGen (Constraint-Conditioned Generation) addresses a fundamental question: how can we ensure that samples from a diffusion model exactly (or very nearly) satisfy known physical constraints-conservation laws, divergence-free conditions, constitutive relations-rather than merely being “close” in an average-error sense?

The consistency problem

Even well-trained diffusion models can produce samples that violate physical constraints. For example, a diffusion model for incompressible fluid flow might generate velocity fields 𝐯 that are not exactly divergence-free: 𝐯0. While the violations may be small in a statistical sense, they can be physically catastrophic-mass is not conserved, which leads to unphysical pressure fields and ultimately unstable dynamics if the generated fields are used as initial conditions for further simulation.

Incorporating discretised PDE information

CoCoGen incorporates physical constraints into the score model in two complementary ways:

  1. Constraint-aware architecture. The score network is designed so that its output automatically satisfies certain constraints. For example, for divergence-free fields, the score network outputs a stream function ψ and the velocity field is computed as 𝐯=×ψ=(yψ,xψ), which is divergence-free by construction (since (×ψ)=0).

  2. Constraint projection during sampling. At each denoising step, the generated field is projected onto the constraint manifold. For a linear constraint 𝐂u=𝐛, this is an orthogonal projection: (Cocogen PROJ)uproj=u𝐂(𝐂u𝐛), where 𝐂 is the Moore–Penrose pseudoinverse. For nonlinear constraints, iterative methods (Newton's method, Gauss–Newton) are applied.

Definition 22 (Constraint-projected diffusion sampling).

Given a trained unconditional score network sϕ(ut,t) and a constraint 𝒞[u]=0, the CoCoGen sampling algorithm modifies each step of the reverse SDE:

  1. Compute the standard denoising update: u~tΔt=ut+[f(ut,t)+g(t)2sϕ(ut,t)]Δt+g(t)Δtξ, where ξ𝒩(0,I).

  2. Project onto the constraint manifold: utΔt=Π𝒞[u~tΔt].

Here Π𝒞 denotes the projection Π𝒞[u]=argminv:𝒞[v]=0vu2.

Forward and inverse PDE tasks

CoCoGen can handle both forward and inverse PDE problems:

  • Forward problem. Given PDE parameters θ (initial/boundary conditions, coefficients), sample from p(u|θ) using the PDE as a constraint: 𝒞[u]=𝒩[u;θ]=0. The diffusion model provides a data-driven prior over solution fields, and the constraint projection ensures PDE satisfaction.

  • Inverse problem. Given sparse observations of the solution u, infer the PDE parameters θ. Here the constraint is that the observed values match: 𝒞[θ]=[u(θ)]y=0, where u(θ) is the PDE solution for parameters θ.

Example 19 (CoCoGen for incompressible flow).

Consider generating 2D incompressible velocity fields 𝐯=(vx,vy) satisfying 𝐯=xvx+yvy=0. Using a standard diffusion model without constraints, the generated fields have a mean divergence residual of 𝐯20.03. While small, this violates the incompressibility constraint.

CoCoGen applies a Helmholtz decomposition at each denoising step: the generated velocity field is decomposed as 𝐯=×ψ+φ, and the irrotational (curl-free) component φ is removed, leaving the divergence-free component ×ψ. This reduces the mean divergence residual to machine precision (1014) with negligible computational overhead (one Poisson solve per denoising step).

Physics-informed diffusion for flow reconstruction

One of the most compelling applications of diffusion models in computational physics is the reconstruction of high-fidelity turbulent flow fields from low-fidelity or sparse data. Traditional approaches (interpolation, RANS-based augmentation) fail to capture the small-scale structures that dominate turbulent transport. Diffusion models, by learning the distribution of DNS (Direct Numerical Simulation) fields, can hallucinate physically plausible fine-scale structures that are consistent with the observed large-scale data.

Problem setup

The setup is a conditional generation problem. Let uHRNHR×d denote a high-resolution (HR) flow field (e.g., DNS of turbulence on a 5123 grid) and uLRNLR×d a low-resolution (LR) or sparse observation (e.g., a coarsened 323 grid, or scattered PIV measurements). We wish to sample from: (SR Posterior)p(uHR|uLR).

This is exactly the super-resolution problem, but in the context of PDE solutions rather than natural images. The key difference is that PDE solutions must obey physical constraints (momentum conservation, energy spectra, boundary conditions), so the “hallucinated” fine-scale details must be physically consistent.

Architecture: conditional U-Net with physics loss

Shu et al. (JCP, 2023) propose a conditional diffusion model for turbulent flow reconstruction with the following architecture:

  1. Conditioning. The LR field uLR is upsampled to the HR grid (e.g., via bicubic interpolation) and concatenated with the noised HR field ut as input channels to the U-Net.

  2. Denoising backbone. A standard U-Net with residual blocks, group normalisation, and sinusoidal time embedding.

  3. Physics-informed loss. In addition to the standard denoising loss, a spectral energy constraint is applied: (Spectral LOSS)spec(ϕ)=𝔼[E(u^0;κ)EDNS(κ)2], where E(;κ) is the energy spectrum as a function of wavenumber κ, and EDNS(κ) is the target spectrum from DNS data.

Results: JCP 2023

Key results from Shu et al. (JCP, 2023) on 2D and 3D turbulent flows:

  • 4× super-resolution of 2D turbulence: Starting from a 642 LR field, the diffusion model generates 2562 HR fields that match the DNS energy spectrum up to the Nyquist wavenumber of the HR grid. By contrast, bicubic interpolation misses the inertial range entirely, and a deterministic U-Net (trained with MSE) produces overly smooth fields.

  • Point-wise error reduction: The diffusion model achieves 40–55% lower point-wise L2 error compared to deterministic baselines on held-out DNS snapshots.

  • Structural similarity: Vorticity PDFs, structure functions, and two-point correlations of diffusion-generated fields closely match DNS statistics, while deterministic baselines underestimate the tails of the vorticity PDF (i.e., miss extreme events).

  • Uncertainty quantification: By drawing multiple samples from the conditional distribution p(uHR|uLR), the model provides calibrated uncertainty estimates: regions of high uncertainty correspond to small-scale structures that are poorly constrained by the LR data.

Conditional diffusion for turbulent flow super-resolution. A low-resolution (LR) vorticity field conditions the diffusion model, which generates diverse high-resolution (HR) samples. Different noise realisations produce different fine-scale details, all consistent with the LR input and the learned physics. The ensemble spread quantifies reconstruction uncertainty.

Flow matching and fast sampling for PDE solvers

A major practical limitation of diffusion models is the large number of denoising steps required for high-quality generation (typically hundreds to thousands of neural function evaluations, or NFEs). For PDE solvers that must be invoked repeatedly (e.g., in optimisation loops, real-time control, or ensemble forecasting), this cost can be prohibitive. Flow matching and related techniques offer a path to few-step or even one-step generation.

From diffusion to flow matching

Flow matching (Lipman et al., 2023; Albergo and Vanden-Eijnden, 2023; Liu et al., 2023) replaces the stochastic reverse-time SDE with a deterministic ODE-a continuous normalising flow (CNF). The idea is to learn a time-dependent velocity field vϕ(u,t) such that the ODE: (CNF)dutdt=vϕ(ut,t),u0π=𝒩(0,I),t[0,1], transports the base distribution π to the data distribution pdata. The key insight is that one can construct a conditional vector field vt(u|u1)=(u1(1σmin)u)/(1t) for each data sample u1 that linearly interpolates between noise u0 and data u1, and train vϕ to match the marginal vector field vt(u)=𝔼[vt(u|u1)|ut=u].

Definition 23 (Flow matching objective).

The flow matching loss is: (FM LOSS)FM(ϕ)=𝔼t𝒰[0,1]𝔼u1pdata𝔼utpt(u|u1)[vϕ(ut,t)vt(ut|u1)2], where pt(u|u1)=𝒩(u;tu1,(1(1σmin)t)2I) is the interpolation path and vt(ut|u1)=u1(1σmin)ut1t is the conditional velocity.

Remark 13 (Flow matching vs. score matching).

Flow matching and score matching (diffusion) are closely related:

  • Both learn time-dependent vector fields to transport noise to data.

  • Score matching learns the score logpt and uses a stochastic SDE for sampling; flow matching learns a velocity field vt and uses a deterministic ODE.

  • The probability flow ODE of diffusion models is a special case of a CNF, with velocity vt=f(x,t)12g(t)2logpt.

  • Flow matching often produces straighter transport paths, leading to faster ODE solving (fewer steps).

Rectified Flow-Based Operator (RFO)

The Rectified Flow-Based Operator (RFO) proposed by Chen and Morozov (ICLR 2025) adapts flow matching specifically for PDE operator learning. The key idea is to learn a flow that transports a conditional noise distribution π(|θ) to the solution distribution p(u|θ), where θ represents PDE parameters.

Definition 24 (Rectified flow for PDE operators).

The RFO objective is: (RFO)RFO(ϕ)=𝔼t,θ,u1,u0[vϕ(ut,t,θ)(u1u0)2], where u1p(u|θ) is a ground-truth PDE solution, u0𝒩(0,I) is noise, and ut=(1t)u0+tu1 is the linear interpolant. The model vϕ takes the PDE parameters θ as an additional input and predicts the constant velocity (u1u0) along the straight path from noise to solution.

The RFO framework has several advantages for PDE applications:

  1. Unified forward/inverse. For the forward problem, θ is given and we sample u. For the inverse problem, we jointly learn flows for both u and θ, or fix u (from observations) and invert for θ.

  2. Few-step generation. Rectified flows produce nearly straight transport paths, so the ODE can be solved in as few as 1–5 Euler steps, compared to 50–1000 steps for standard diffusion.

  3. Neural operator backbone. vϕ can be parameterised as a neural operator (e.g., FNO or Transformer), enabling resolution-agnostic generation.

Rectified flow vs. standard diffusion for PDE operator learning. Rectified flows learn nearly straight transport paths (solid lines) from noise to solution, enabling 1–5 step generation. Standard diffusion follows curved paths (dashed lines), requiring 100+ denoising steps. Both are conditioned on PDE parameters θ.

Truncation and iterative refinement

A further acceleration technique is truncated flow matching. Rather than transporting from pure noise (t=0) all the way to data (t=1), one can start from a rough deterministic prediction udet (obtained cheaply from a neural operator like FNO) and only transport from udet to the refined solution. This “warm start” eliminates the need to traverse the full noise-to-data path.

Formally, define a truncated interpolant: (Truncated)ut=(1t)udet+tuGT+σ(t)ϵ,t[0,1], where uGT is the ground truth and σ(t)=σ0(1t) is a small noise schedule that vanishes at t=1. The flow matching model learns to refine udet toward uGT, requiring only 1–3 ODE steps for high accuracy.

Proposition 11 (Truncation reduces NFEs).

Let NFEfull be the number of ODE steps needed to achieve relative error ϵ when transporting from pure noise, and NFEtrunc the number needed when starting from a deterministic prediction udet with udetuGT/uGT=δ. If the flow is approximately affine near the data manifold: NFEtruncClog(1/ϵ)δ,NFEfullClog(1/ϵ), so the truncated approach saves a factor of roughly 1/δ in NFEs when the deterministic prediction is already reasonable (δ1).

Physics-guided distillation

Another route to few-step generation is distillation: training a student model to reproduce the multi-step output of a teacher diffusion model in a single forward pass. Phys-Instruct combines distillation with physics constraints:

  1. Teacher: A pre-trained diffusion model for PDE solutions, using 1000-step DDPM sampling.

  2. Student: A lightweight network Gψ(z,θ) that maps noise z and PDE parameters θ to a solution in a single forward pass.

  3. Distillation loss: The student is trained to match the teacher's output distribution: (Distill)distill(ψ)=𝔼z,θ[Gψ(z,θ)uteacher(z,θ)2].

  4. Physics loss: An additional PDE residual penalty: (Distill PHYS)phys(ψ)=𝔼z,θ[𝒩[Gψ(z,θ);θ]2].

The physics loss ensures that the student does not just copy the teacher's samples but produces solutions that actually satisfy the PDE-a form of “physics-grounded distillation” that can sometimes outperform the teacher in terms of PDE residual.

Latent neural PDE solver with flow matching

A promising recent direction combines flow matching with latent space representations. Instead of operating directly on the high-dimensional field uN×d, one first trains an autoencoder to map u to a low-dimensional latent code z=Enc(u)m with mN, and then applies flow matching in the latent space: (Latent FM)dztdt=vϕ(zt,t,θ),z0𝒩(0,Im), followed by decoding: u^=Dec(z1).

Key Idea.

Latent Flow Matching for PDE Solvers Operating in a learned latent space offers three benefits:

  1. Dimensionality reduction: The flow matching ODE is solved in m instead of N, dramatically reducing computational cost per step.

  2. Implicit regularisation: The autoencoder's bottleneck enforces a smooth, low-dimensional manifold structure, reducing the complexity of the transport problem.

  3. Resolution independence: The latent code z is independent of the spatial discretisation; the decoder can map to any desired output resolution.

Example 20 (Latent flow matching for 2D Burgers equation).

Consider the 2D viscous Burgers equation on [0,1]2×[0,1]: ut+uux+uuy=νΔu. A convolutional autoencoder compresses 128×128 solution snapshots to a latent code of dimension m=64. Flow matching in the latent space, conditioned on the initial condition u(,0) encoded as zIC=Enc(u0), generates the solution at time T=1 in 5 ODE steps.

Performance comparison:

1.2

MethodRelative L2 errorNFEs
FNO (deterministic)2.8%1
DDPM (1000 steps)1.9%1000
Latent flow matching2.1%5
The latent flow matching approach achieves accuracy comparable to the full diffusion model while requiring 200× fewer neural function evaluations.

Mathematical deep dive: convergence of diffusion PDE solvers

We now present several rigorous results on the convergence properties of diffusion-based PDE solvers.

Approximation theory for score networks

Theorem 14 (Universal approximation of scores on function spaces).

Let be a separable Hilbert space and let μ be a probability measure on with score stL2(,μt;). For any ϵ>0, there exists a neural operator 𝒮ϕ:×[0,T] with finitely many parameters such that: 0T𝔼μt[𝒮ϕ(u,t)st(u)2]dt<ϵ.

Lemma 1 (Score estimation error propagation).

Let s^t be an approximate score with 𝔼μt[s^tst2]δ2 for all t[0,T]. Let μ^0 be the distribution generated by the reverse SDE with score s^t. Then the KL divergence satisfies: (KL Bound)DKL(μ0μ^0)120Tg(t)2𝔼μt[s^tst2]dtδ220Tg(t)2dt.

This lemma shows that the quality of generation degrades gracefully with score estimation error, and the degradation is controlled by the integral of g(t)2-the total amount of noise injected during the forward process.

PDE residual bounds for diffusion samples

Theorem 15 (PDE residual of diffusion samples).

Consider a PDE 𝒩[u]=0 with solution operator 𝒢:θu. Let pϕ(u|θ) be the distribution learned by a conditional diffusion model, and let u^pϕ(|θ) be a generated sample. If:

  1. The score estimation error satisfies 𝔼[s^tst2]δ2.

  2. The PDE operator 𝒩 is L-Lipschitz: 𝒩[u]𝒩[v]Luv.

  3. The data distribution is supported on exact solutions: μ0({u:𝒩[u]=0})=1.

Then the expected PDE residual of a generated sample satisfies: (Residual Bound)𝔼u^pϕ[𝒩[u^]2]L2𝔼[u^u2]L2Cδ20Tg(t)2dt, where u=𝒢(θ) is the true solution and C is a constant depending on the data distribution.

Remark 14 (Physics constraints as “free” regularisation).

Theorem Theorem 15 shows that even a purely data-driven diffusion model (without explicit physics losses) produces samples with bounded PDE residuals, provided the training data consists of true PDE solutions. Adding explicit physics losses (as in PIDMs) further tightens the bound. This explains the empirical observation that diffusion models for PDEs often produce physically more plausible fields than GANs or VAEs, even without physics-informed training.

Summary and comparative analysis

We conclude this section with a comparative overview of the methods discussed.

Taxonomy of diffusion and flow-matching methods for PDE simulation. All methods build on score-based diffusion (top) and specialise it for different PDE tasks: joint coefficient–solution modelling (DiffusionPDE), physics-informed training (PIDMs), constraint enforcement (CoCoGen), conditional generation for forecasting and data assimilation, turbulent flow reconstruction, and fast sampling via flow matching (RFO).

1.3

MethodPhysics constraintConditioningSampling costKey strength
Score-based diffusionNone (data only)Post-hoc guidanceHigh (100–1000 NFEs)Flexible prior
DiffusionPDEPDE residual (guidance)Sparse obs. guidanceHighJoint (a,u)
PIDMsPDE residual (training)Training-timeHighLower residuals
CoCoGenExact projectionConstraint-awareModerateHard constraints
Conditional diff.OptionalTraining-timeHighForecasting/DA
Flow recon.Spectral lossLR HRHighTurbulence
Flow matching (RFO)OptionalTraining-timeLow (1–5 NFEs)Speed

Exercises

Exercise 11 (Score function of a Gaussian field).

Let u𝒩(m,C) be a Gaussian random field on Ω=[0,1] with mean function m(x)=sin(πx) and covariance operator C with eigenvalues λk=k4 in the Fourier basis {ek=2sin(kπx)}.

  1. Show that the score function is s(u)=C1(um).

  2. Compute the score in the Fourier basis: s(u),ek=k4(u^km^k) where u^k=u,ek and m^k=m,ek.

  3. Interpret the factor k4: why does the score have large magnitude for high-frequency modes? What does this imply for score network training?

  4. If we perturb u to ut=α(t)u+σ(t)ξ where ξ𝒩(0,Q) with Q=C, show that the perturbed score is: st(ut)=(α(t)2C+σ(t)2C)1(utα(t)m). Simplify when α(t)2+σ(t)2=1.

Exercise 12 (Implementing DiffusionPDE guidance).

Consider the 1D Poisson equation u(x)=f(x) on [0,1] with u(0)=u(1)=0, where f(x)=asin(2πx) and a is a scalar parameter.

  1. Discretise on n=64 grid points. Generate a training dataset of 5,000 pairs (ai,ui) where ai𝒰[0.5,5] and ui is obtained by solving the tridiagonal system.

  2. Train a DDPM on the 2-channel data (a(𝐱),u(𝐱)) (treating the scalar a as a constant spatial field).

  3. Implement observation guidance: given u observed at 3 random points, sample from the posterior p(a,u|yobs) using the guided reverse SDE\@.

  4. Implement PDE residual guidance by computing u^0a^0sin(2πx)2 using finite differences on the Tweedie estimate.

  5. Compare reconstruction quality (a) without guidance, (b) with observation guidance only, (c) with both observation and PDE guidance.

Exercise 13 (Physics-informed vs. physics-guided).

Compare two approaches for generating solutions of the 1D heat equation tu=κxxu:

  1. PIDMs (training-time physics): Add the PDE residual loss to the denoising objective during training, using the time-dependent weight .

  2. DiffusionPDE-style (inference-time physics): Train a standard DDPM, then use PDE residual guidance during sampling.

For each approach:

  1. a.

    Measure the mean PDE residual of 100 generated samples.

  2. b.

    Measure the FID-like metric (Wasserstein distance of spectral energy distributions) between generated and true samples.

  3. c.

    Measure wall-clock time per sample.

  4. d.

    Which approach is better for forward problems (known κ, unknown u)? For inverse problems (known u at sparse points, unknown κ)?

Exercise 14 (Rectified flow for the advection equation).

Consider the 1D advection equation tu+cxu=0 on [0,2π] with periodic boundary conditions, velocity c𝒰[0.5,2], and initial condition u0(x)=sin(x+ϕ) with random phase ϕ𝒰[0,2π].

  1. Generate 10,000 training pairs (θi,ui(x,T)) where θi=(ci,ϕi) and ui(x,T)=sin(xciT+ϕi) is the exact solution at T=1.

  2. Implement a rectified flow model vϕ(ut,t,θ) using a small MLP, with the straight-line interpolation ut=(1t)ϵ+tu1 where ϵ𝒩(0,I).

  3. Train using the flow matching loss .

  4. Compare the number of ODE steps (Euler method) needed to achieve relative L2 error <1% for: (a) full rectified flow (u0=ϵ), (b) truncated rectified flow with u0=uFNO (a pre-trained FNO prediction).

Challenge 3 (Open problem: convergence rates for physics-informed diffusion).

Theorem Theorem 15 provides a bound on the expected PDE residual of diffusion samples in terms of the score estimation error. However, this bound does not account for the structure of the PDE\@.

  1. Conjecture a tighter bound for elliptic PDEs (which have smoothing properties) compared to hyperbolic PDEs (which propagate singularities).

  2. Can you prove that the PDE residual of PIDM samples converges faster than O(δ2) when the physics loss is included? Under what conditions?

  3. For the Navier–Stokes equations at high Reynolds number, the solution manifold has fractal-like structure (strange attractor). How does this affect the score estimation error δ and the resulting PDE residual bound?

This is an open research problem at the intersection of PDE theory, approximation theory, and generative modelling.

Poisson and Laplace-Type Elliptic PDEs

We begin our tour of PDE families with the simplest and, in many ways, the most fundamental: elliptic equations. These are the steady-state workhorses of mathematical physics-they describe equilibrium configurations where nothing changes in time, yet the spatial structure can be extraordinarily rich. If you want to know the temperature distribution in a metal plate after it has reached thermal equilibrium, or the electrostatic potential in a region with fixed charges, or the pressure field driving groundwater through a porous rock formation, you solve an elliptic PDE\@.

Elliptic problems are the natural starting point for benchmarking neural PDE solvers because they lack the additional complications of time stepping, shock formation, and chaotic sensitivity. Get an elliptic solver right, and you have a solid foundation for the harder problems that follow.

The Poisson and Laplace equations

Definition 25 (Poisson and Laplace equations).

Let Ωd be an open bounded domain with sufficiently smooth boundary Ω. The Poisson equation is the second-order elliptic PDE (Poisson)2u(𝐱)=f(𝐱),𝐱Ω, where 2=i=1d2/xi2 is the Laplacian operator and f:Ω is a given source term. When f0, the equation reduces to the Laplace equation: (Laplace)2u(𝐱)=0,𝐱Ω. The equation is supplemented by boundary conditions-most commonly Dirichlet (u|Ω=g), Neumann (u/n|Ω=h), or a mixture of both.

The Laplace equation defines harmonic functions: functions whose value at any point equals the average over any surrounding sphere. This mean-value property implies remarkable smoothness-harmonic functions are infinitely differentiable, even analytic. The Poisson equation adds a source term that “pushes” the solution away from being harmonic.

Theorem 16 (Existence and uniqueness for the Poisson equation).

Let Ωd be a bounded domain with Lipschitz boundary, fL2(Ω), and gH1/2(Ω). Then the Dirichlet problem 2u=f in Ω,u=g on Ω, admits a unique weak solution uH1(Ω), and uH1(Ω)C(fL2(Ω)+gH1/2(Ω)) for a constant C depending only on Ω.

Proof.

This follows from the Lax–Milgram theorem applied to the bilinear form a(u,v)=Ωuvd𝐱 on the Sobolev space H01(Ω) (after reducing to homogeneous boundary conditions by subtracting a lifting of g). Coercivity follows from the Poincaré inequality; continuity is immediate from the Cauchy–Schwarz inequality.

This well-posedness result is important for neural PDE solvers: it tells us that the mapping fu is a bounded linear operator, and therefore a neural operator has a well-defined, stable target to approximate.

Darcy flow: the parametric elliptic benchmark

The Poisson equation is useful for pedagogy, but most real-world elliptic problems involve variable coefficients. The canonical example-and arguably the single most important benchmark in the neural operator literature-is Darcy flow.

Definition 26 (Darcy flow equation).

The steady-state Darcy flow equation models pressure-driven flow through a porous medium: (Darcy)(a(𝐱)u(𝐱))=f(𝐱),𝐱Ω, where u(𝐱) is the pressure head, a(𝐱)>0 is the permeability field (a spatially varying coefficient), and f(𝐱) is a source or sink term. The velocity field is recovered via Darcy's law: 𝐯=a(𝐱)u.

Why has Darcy flow become the benchmark for operator learning? Several reasons conspire:

  1. Parametric richness. The permeability field a(𝐱) can be drawn from diverse distributions-smooth Gaussian random fields, piecewise-constant media, fractal geometries, channelised structures. Each draw defines a different PDE instance, creating a natural family of problems.

  2. Well-posedness. As long as a is bounded away from zero, the Lax–Milgram theorem guarantees existence and uniqueness, so the operator au is well-defined.

  3. Practical importance. Darcy flow arises in groundwater hydrology, petroleum reservoir simulation, carbon sequestration modelling, and filtration engineering.

  4. Scalable ground truth. High-resolution finite element solutions on structured grids can be computed efficiently, providing plentiful training data.

Key Idea.

The Darcy flow problem defines an operator learning task: given the permeability field a(𝐱) as input (a function), predict the pressure field u(𝐱) as output (another function). A neural operator 𝒢θ learns to approximate this infinite-dimensional mapping: 𝒢θ:a()u(), so that 𝒢θ(a)u for any a drawn from the training distribution.

The Darcy flow operator learning pipeline. A neural operator 𝒢θ learns to map permeability fields a(𝐱) to pressure solutions u(𝐱). Training data consists of input–output pairs generated by a classical finite element solver. At inference, the trained operator produces solutions for new permeability fields in milliseconds.

Neural operator results on Darcy flow

The Fourier Neural Operator (FNO) of Li et al. (2021) achieved a landmark result on Darcy flow: a single trained network, evaluated in under 10 milliseconds on a GPU, matched the accuracy of a finite element solver operating at the same resolution, while generalising across the entire distribution of permeability fields.

Let us recall the key numbers. On the standard 85×85 Darcy benchmark (permeability fields drawn from a thresholded Gaussian random field with length scale l), FNO achieves a relative L2 error of approximately 1.08% when trained on 1000 samples. In comparison:

MethodRel. L2 error (%)Inference time
Finite Element (ground truth)-seconds
DeepONet3.25 ms
FNO (4 Fourier layers)1.085 ms
U-Net2.78 ms
Graph Neural Operator1.512 ms

Remark 15 (Resolution invariance).

A crucial property of FNO is discretisation convergence: the operator can be trained at one resolution (say 64×64) and evaluated at a different resolution (say 256×256) without retraining. This is possible because FNO parameterises layers in Fourier space, truncating at a fixed number of modes kmax. Changing the spatial resolution changes only the FFT grid, not the learned parameters. For Darcy flow, this means a model trained on coarse data can predict fine-grained pressure fields-a form of super-resolution that traditional neural networks cannot achieve.

Proposition 12 (FNO approximation for Darcy flow).

Consider the Darcy operator 𝒢:au mapping permeability fields in L(Ω) (bounded below by amin>0) to solutions in H01(Ω). Let 𝒢θ(K) denote an FNO with K retained Fourier modes per layer and L Fourier layers. Then for any ε>0, there exist K, L, and a width parameter dv such that supa𝒜𝒢(a)𝒢θ(K)(a)L2(Ω)𝒢(a)L2(Ω)<ε, where 𝒜 is a compact subset of admissible permeability fields. The required number of modes K depends on the regularity of the operator kernel and the complexity of 𝒜.

Proof.

The proof proceeds in two steps. First, the solution operator for the Darcy equation can be written as an integral operator with a kernel that decays in Fourier space (owing to the elliptic regularity of the PDE). Second, the universal approximation theorem for FNOs (Kovachki et al., 2023) shows that FNO layers can approximate any continuous operator between Sobolev spaces to arbitrary accuracy, given sufficient modes and depth. The compactness of 𝒜 ensures uniform approximation.

Diffusion models for elliptic inverse problems

Forward Darcy flow-given a, find u-is well-posed. The inverse problem-given sparse, noisy observations of u, recover a-is drastically ill-posed. Many permeability fields can produce similar pressure observations, and the mapping from data to parameters is discontinuous. This is precisely the kind of problem where generative models shine: instead of seeking a single “best” a, we sample from the posterior distribution p(a|𝐲) where 𝐲 collects the observed pressure values.

Definition 27 (Bayesian inverse problem for Darcy flow).

Given noisy observations 𝐲=(u)+𝜼, where is an observation operator (e.g., pointwise evaluation at sensor locations), u solves the Darcy equation with permeability a, and 𝜼𝒩(0,σ2I), the posterior distribution over permeability fields is (Posterior)p(a|𝐲)p(𝐲|a)p(a)=exp(12σ2𝐲(𝒢(a))2)p(a), where 𝒢(a) denotes the forward solver and p(a) is the prior over permeability fields (typically a Gaussian process).

Traditional approaches to this inverse problem use Markov chain Monte Carlo (MCMC) methods, which are accurate but require thousands of forward solves-each taking seconds to minutes on a fine mesh. The total computational cost can be prohibitive for high-dimensional permeability fields.

Score-based priors for inverse problems

The key insight of diffusion-model approaches is to replace the explicit prior p(a) with a learned score function. A score-based diffusion model is trained on samples from the prior distribution of permeability fields (which can be cheaply generated from a Gaussian process). Once trained, the model provides the score alogpt(a) at all noise levels t, enabling posterior sampling via: (Score)alogpt(a|𝐲)=alogpt(a)+alogpt(𝐲|a). The first term comes from the pretrained diffusion model. The second term-the likelihood score-can be approximated using a differentiable forward solver or a neural surrogate.

Insight.

Diffusion models provide a principled way to solve ill-posed inverse problems: the prior score alogpt(a) learned from data regularises the solution, while the likelihood score alogpt(𝐲|a) ensures consistency with observations. The iterative denoising process naturally explores the posterior, producing diverse, physically plausible permeability fields that all explain the observed data.

DiffusionPDE on Darcy flow

Huang et al. (2024) introduced DiffusionPDE, a framework that goes beyond the standard “learn prior, condition on likelihood” paradigm. DiffusionPDE jointly models the PDE coefficient field and the solution field as a coupled system, using a single diffusion model that denoises both simultaneously.

The architecture treats the input as a multi-channel “image”: channel 1 is the permeability field a(𝐱), and channel 2 is the pressure field u(𝐱). During training, noise is added to both channels, and a U-Net-based denoising network learns to predict the clean pair (a,u) from the noisy version. During inference, the model can perform:

  1. Forward problems: Given a clean a (no noise on channel 1) and pure noise on channel 2, the denoising process “generates” the solution u.

  2. Inverse problems: Given sparse observations of u (partial noise on channel 2) and pure noise on channel 1, the model simultaneously recovers both a and the full u.

  3. Sparse recovery: Given both a and sparse u observations, the model infills the missing pressure data.

DiffusionPDE jointly denoises the coefficient field a(𝐱) and solution field u(𝐱). In forward mode, the known coefficient is kept clean while the solution is generated from noise. In inverse mode, sparse observations of u guide the simultaneous recovery of both fields.

The key advantage of the joint approach is that the model learns the physical coupling between a and u: it internalises the constraint that (au)=f, even though this PDE is never explicitly imposed in the loss. On the Darcy flow benchmark, DiffusionPDE achieves state-of-the-art results for inverse recovery with as few as 1% observed pressure values.

Transformer operators on Poisson variants

While FNO operates in Fourier space (limiting it to periodic or rectangular domains), Transformer-based operators can handle arbitrary geometries by treating the discretised field as a sequence of tokens-one per grid point or mesh node.

The Galerkin Transformer (Cao, 2021) replaces the softmax attention kernel with a linear (Galerkin-type) attention mechanism: (ATTN)Attn(Q,K,V)=1nQ(KV), where Q,K,Vn×d are the query, key, and value matrices and n is the number of spatial tokens. The crucial difference from standard softmax attention is the order of operations: by computing KV first (an d×d matrix), the cost drops from O(n2d) to O(nd2)-a dramatic saving when n (the number of spatial points) is large and d (the embedding dimension) is moderate.

Remark 16 (Galerkin attention as numerical integration).

The name “Galerkin” is not accidental. In the finite element method, the Galerkin projection computes ϕi,u by integrating test functions ϕi against the PDE operator. The linear attention mechanism can be interpreted as a discrete inner product between query functions and key–value pairs, mimicking Galerkin projection in a learned function space. This connection suggests that Transformer operators for elliptic PDEs are performing a form of learned Galerkin discretisation.

On Poisson-type benchmarks (including variable-coefficient variants on L-shaped and circular domains), Transformer operators achieve competitive or superior accuracy to FNO, with the added benefit of handling non-rectangular domains naturally.

Example 21 (2D Darcy flow benchmark).

Consider the standard 2D Darcy flow benchmark on Ω=[0,1]2: (2D)(a(𝐱)u(𝐱))=1,𝐱[0,1]2, with Dirichlet boundary conditions u=0 on Ω. The permeability a(𝐱) is drawn from a two-level random field: a(𝐱)=ψ(g(𝐱)),g𝒢𝒫(0,C), where C is a Matérn covariance with length scale l=0.1, and ψ(t)=12 if t0, ψ(t)=3 if t<0. This thresholding creates a “two-phase” medium with sharp interfaces between high- and low-permeability regions.

A standard FNO with 4 Fourier layers, kmax=12 modes, and channel width 32, trained on 1000 pairs at 85×85 resolution, achieves:

  • Relative L2 error: 1.08% (test set, n=200).

  • Training time: 10 minutes on a single A100 GPU\@.

  • Inference time: 5 ms per sample.

Compare this to a finite element solver at the same resolution, which takes 0.5 seconds per solve. For applications requiring thousands of forward evaluations (uncertainty quantification, design optimisation), the 100× speedup is transformative.

Exercise 15 (Implement FNO for Darcy flow).

Using PyTorch, implement a Fourier Neural Operator for the 2D Darcy flow benchmark described in Example Example 21.

  1. (a)

    Implement a single Fourier layer: lift the input to a higher-dimensional channel space, apply the FFT, multiply by a learnable complex tensor Rθdv×dv×kmax×kmax in Fourier space, apply the inverse FFT, add a pointwise linear bypass Wv(𝐱), and apply a GELU activation.

  2. (b)

    Stack 4 Fourier layers between a pointwise lifting layer (mapping 1 input channel to dv=32) and a pointwise projection layer (mapping dv to 1).

  3. (c)

    Train on 1000 Darcy samples at 64×64 resolution using the relative L2 loss. Report the test error.

  4. (d)

    Zero-shot super-resolution: Evaluate your trained model on 128×128 and 256×256 test samples without retraining. How does the error change? Explain why the FNO can generalise across resolutions.

The Heat Equation and Diffusion-Reaction Systems

We now add the dimension that elliptic equations lack: time. Parabolic PDEs describe processes that evolve toward equilibrium-the diffusion of heat, the spreading of a chemical concentration, the relaxation of a strained material. The simplest and most canonical parabolic PDE is the heat equation, and it occupies a special place in this book because the entire theory of diffusion generative models is built on a mathematical analogy with heat diffusion.

The heat equation: simplest parabolic PDE

Definition 28 (Heat equation).

The heat equation on a domain Ωd with diffusivity D>0 is (HEAT)ut(𝐱,t)=D2u(𝐱,t),𝐱Ω,t>0, subject to initial condition u(𝐱,0)=u0(𝐱) and appropriate boundary conditions. The solution u(𝐱,t) represents temperature (or concentration) at position 𝐱 and time t.

Historical Note.

Joseph Fourier introduced the heat equation in his 1822 masterwork Théorie analytique de la chaleur. To solve it, he developed the method of expanding functions as trigonometric series-what we now call Fourier series. The entire edifice of Fourier analysis, which underpins the FFT, signal processing, and the Fourier Neural Operator, grew from Fourier's study of heat conduction. It is a delicious irony that neural PDE solvers have come full circle: the FNO uses Fourier's own transform to accelerate the solution of the very equation Fourier invented the transform to solve.

The heat equation has several properties that make it both physically important and mathematically tractable:

Theorem 17 (Properties of the heat equation).

Let u(𝐱,t) solve the heat equation on d with initial data u0L1(d)L(d). Then:

  1. Smoothing: For any t>0, u(,t) is infinitely differentiable, regardless of the regularity of u0. The heat equation is an “infinite smoother.”

  2. Maximum principle: min𝐱u0(𝐱)u(𝐱,t)max𝐱u0(𝐱) for all t>0. Heat diffusion cannot create new extrema.

  3. Energy dissipation: ddtd|u(𝐱,t)|2d𝐱=2Dd|u|2d𝐱0. The L2 energy is non-increasing.

  4. Fundamental solution: The solution is given by convolution with the heat kernel: (Kernel)u(𝐱,t)=dG(𝐱𝐲,t)u0(𝐲)d𝐲,G(𝐱,t)=1(4πDt)d/2exp(|𝐱|24Dt).

Proof.

(Sketch.) Property (1) follows from the analyticity of the heat kernel G(𝐱,t) for t>0. Property (2) is a consequence of the weak maximum principle for parabolic equations. Property (3) follows by multiplying the PDE by u, integrating over d, and integrating by parts. Property (4) is verified by direct substitution.

Key Idea.

The connection between the heat equation and diffusion generative models is direct and deep. The forward diffusion process in score-based generative modelling, d𝐱=2Dd𝐖t, has the heat equation as its Fokker–Planck equation: the probability density p(𝐱,t) of the diffusing particle satisfies p/t=D2p. Every time you run the forward noising process in DDPM or score matching, you are solving the heat equation in probability space.

Diffusion-reaction equations

The heat equation describes pure diffusion. Adding a nonlinear reaction term R(u) creates a far richer class of equations:

Definition 29 (Diffusion-reaction equation).

The diffusion-reaction equation is (Diffreact)ut=D2u+R(u),𝐱Ω,t>0, where R: (or R:mm for systems of m species) is the reaction nonlinearity.

The interplay between diffusion (which smooths and spreads) and reaction (which amplifies, saturates, or oscillates) produces some of the most visually striking phenomena in all of PDE theory.

Fisher–KPP equation

The simplest nontrivial diffusion-reaction equation is the Fisher–KPP equation (Fisher, 1937; Kolmogorov, Petrovskii, and Piskunov, 1937): (Fisher)ut=D2u+ru(1u), where r>0 is the growth rate. This equation models the spread of an advantageous gene through a population: u represents the local frequency of the gene, diffusion models spatial migration, and the logistic term ru(1u) models selection. The Fisher–KPP equation admits travelling wave solutions of the form u(𝐱,t)=ϕ(xct) that propagate at a minimum speed c=2Dr.

Gray–Scott system

For truly spectacular pattern formation, we turn to the Gray–Scott system, a two-component reaction-diffusion model: (Grayscott)ut=Du2uuv2+F(1u),vt=Dv2v+uv2(F+k)v, where u and v represent concentrations of two chemical species, Du and Dv are their diffusivities, F is a feed rate, and k is a kill rate. Depending on the values of F and k, this system produces a zoo of Turing-type patterns: spots, stripes, spirals, labyrinthine structures, and pulsating domains.

Gallery of Turing patterns produced by the Gray–Scott reaction-diffusion system with different feed rate F and kill rate k. These spatially structured patterns emerge spontaneously from uniform initial conditions perturbed by small noise-a phenomenon first predicted by Alan Turing in 1952.

PDEBench diffusion-reaction benchmarks

The PDEBench benchmark suite (Takamoto et al., 2022) provides standardised datasets and evaluation protocols for neural PDE solvers. For diffusion-reaction systems, PDEBench includes:

  • 1D diffusion-reaction: u/t=D2u/x2+R(u) with R(u)=ρu(1u) on [0,1]×[0,1]. Dataset: 10000 trajectories at resolution 1024×101 (space × time).

  • 2D diffusion-reaction (2-species): The system u/t=Du2u+Ru(u,v), v/t=Dv2v+Rv(u,v) on [0,1]2×[0,5]. Dataset: 1000 trajectories at 128×128×101.

On these benchmarks, the relative performance of different neural architectures reveals interesting patterns:

Method1D Rel. Error (%)2D Rel. Error (%)
FNO0.423.1
U-Net0.782.8
Dilated ResNet1.214.5
PINN (retrained per IC)2.348.7

Remark 17 (Why U-Net sometimes beats FNO).

On the 2D diffusion-reaction benchmark, the U-Net slightly outperforms FNO\@. This is not surprising: the Gray–Scott patterns involve localised structures (spots, stripes) that are well-captured by the U-Net's multi-scale convolutional architecture. FNO's global Fourier modes are better suited to problems with smooth, globally correlated structures (like the smooth pressure fields in Darcy flow). The lesson: no single architecture dominates across all PDE types. The structure of the PDE dictates the ideal inductive bias.

PINNs for the heat equation

The heat equation is often the first PDE attempted with PINNs, and for smooth initial conditions, it works beautifully. Consider the 1D heat equation on [0,1]×[0,T]: (Heat1d)ut=D2ux2,u(x,0)=u0(x),u(0,t)=u(1,t)=0. With u0(x)=sin(πx), the exact solution is u(x,t)=eDπ2tsin(πx)-a smooth, exponentially decaying function that PINNs approximate easily.

Example 22 (PINN success: smooth heat equation).

For D=0.01 and u0(x)=sin(πx), a standard PINN with a 4-layer MLP (50 neurons per layer, tanh activation) trained with 10000 collocation points achieves a relative L2 error of 0.1% after 20000 Adam iterations. The solution is smooth in both space and time, well within the network's spectral bandwidth.

Caution.

The success of PINNs on smooth heat equations is misleading. When the initial condition has discontinuities-a step function, for example-the heat equation smooths them instantly (by Theorem Theorem 17), but the solution at very early times retains steep gradients. PINNs struggle precisely here: the spectral bias prevents accurate resolution of the sharp initial transient. The PINN may converge to the wrong steady state or exhibit spurious oscillations near t=0. This failure mode is a microcosm of the broader challenge of applying PINNs to PDEs with multi-scale features.

Example 23 (PINN failure: discontinuous initial condition).

Consider with the step-function initial condition: u0(x)={1if 0.25x0.75,0otherwise. The same PINN architecture from Example Example 22 now achieves a relative error of 12%, with the worst errors concentrated near the discontinuities at x=0.25 and x=0.75 at early times t<0.05. The network “rounds off” the sharp edges, producing a solution that looks qualitatively correct but is quantitatively poor.

Mitigation strategies include: (a) using Fourier feature embeddings γ(𝐱)=[sin(2πB𝐱),cos(2πB𝐱)] with random B to defeat spectral bias; (b) adaptive collocation point placement near the discontinuity; (c) time-stepping PINNs that solve in short windows [tk,tk+1].

Neural operators for parametric heat problems

For the parametric heat equation-where we want to solve for many different initial conditions or diffusivities-neural operators offer a compelling alternative to PINNs. The task is to learn the solution operator: (Operator)𝒢:u0()u(,T), mapping the initial temperature distribution to the temperature field at a fixed future time T (or, more ambitiously, to the entire trajectory u(,t) for t[0,T]).

By Theorem Theorem 17, this operator is given by convolution with the heat kernel-a linear, smoothing operator. In Fourier space: (Fourier)u^(𝐤,T)=eD|𝐤|2Tu^0(𝐤). This is a pointwise multiplication in Fourier space by an exponentially decaying filter-precisely the kind of operation that FNO is designed to learn.

Proposition 13 (FNO for the heat equation is exact).

A single Fourier layer with no nonlinearity and weight tensor R(𝐤)=eD|𝐤|2T (diagonal in mode space) exactly implements the heat equation solution operator for fixed T. Consequently, for the heat equation, FNO can achieve zero approximation error with a single layer of width 1.

Proof.

The heat equation solution operator in Fourier space is , a pointwise multiplication. A Fourier layer computes v^out(𝐤)=R(𝐤)v^in(𝐤), which matches exactly when R(𝐤)=eD|𝐤|2T.

This is a rare case where we can prove a neural architecture is perfectly matched to the PDE structure. Of course, real applications involve variable diffusivity, nonlinear reactions, and complex domains where the Fourier structure breaks down.

Score Matching via Differentiable Physics (SMDP)

Holl et al. introduced Score Matching via Differentiable Physics (SMDP), a framework that combines score-based generative modelling with differentiable PDE solvers for inverse problems. The idea is elegant: use a differentiable numerical solver (implemented in a framework like JAX or PhiFlow) as a “physics layer” inside the generative pipeline.

For the heat equation inverse problem-recovering the initial temperature u0 from a noisy observation of u(,T)-SMDP proceeds as follows:

  1. Train a diffusion model on a dataset of plausible initial conditions {u0(i)}. This gives a learned score u0logpσ(u0) at noise level σ.

  2. Compute the likelihood score by differentiating through the forward solver: (Likelihood)u0logp(𝐲|u0)=1σobs2𝒮u0(𝒮(u0)𝐲), where 𝒮(u0) denotes the forward solver mapping u0 to the observation (u(,T)), and the Jacobian 𝒮/u0 is computed via backpropagation through the solver.

  3. Sample from the posterior using the combined score in a reverse diffusion process.

Remark 18 (Differentiable solvers as physics constraints).

The SMDP approach differs from PINNs in a crucial way: instead of softly penalising PDE violations in a loss function, it exactly solves the PDE at each step using a classical numerical method, and backpropagates through the solver to get gradients. This means the physics is satisfied exactly (up to discretisation error), not approximately. The cost is that you need a differentiable implementation of the forward solver, which is increasingly available through libraries like JAX, PhiFlow, and DiffTaichi.

Poisson Flow Generative Models (PFGM)

We close our discussion of parabolic PDEs with a beautiful example of traffic in the opposite direction: rather than using generative models to solve PDEs, the Poisson Flow Generative Model (PFGM) of Xu et al. (2022) uses a PDE to build a better generative model.

The key observation is this: consider a data distribution pdata supported on d. Embed the data in a higher-dimensional space d+1 by placing it on the hyperplane z=0. Now consider the electric field generated by the data charges: by Gauss's law, this field satisfies the Poisson equation 𝐄=ρ in the augmented (d+1)-dimensional space.

Definition 30 (Poisson Flow Generative Model).

Let pdata(𝐱) be a data distribution on d. The PFGM defines a velocity field in the augmented space d×0 via the “electric field” generated by the data: (PFGM)𝐄(𝐱,z)=d(𝐱𝐲,z)(|𝐱𝐲|2+z2)(d+1)/2pdata(𝐲)d𝐲. Sampling proceeds by initialising points on a hemisphere at large z (where the distribution is nearly uniform) and following the field lines toward z=0 using an ODE solver.

Poisson Flow Generative Model (PFGM). Data points on the hyperplane z=0 generate an electric field in the augmented space. Sampling starts from near-uniform points at large z and follows field lines down to z=0, where the trajectories converge to the data distribution. The field satisfies Poisson's equation, providing a physics-inspired alternative to score-based diffusion.

The follow-up work PFGM++ (Xu et al., 2023) generalises this to arbitrary dimensions D>d for the augmented space, interpolating between PFGM (when D=d+1) and standard diffusion models (in the limit D). The optimal dimension D depends on the dataset and provides a new hyperparameter that can be tuned for improved sample quality.

Theorem 18 (PFGM as D recovers diffusion).

In the PFGM++ framework, as the augmented dimension D, the normalised electric field converges to the score function 𝐱logpσ(𝐱) of the noise-perturbed data distribution, and the PFGM sampling ODE converges to the probability flow ODE of score-based diffusion models.

This result reveals a deep connection: diffusion models are the infinite-dimensional limit of electrostatic generative models. The Poisson equation (elliptic) and the heat equation (parabolic) are thus unified in the PFGM framework as two ends of a continuous spectrum.

Exercise 16 (Heat kernel as a generative model).

Consider a 1D data distribution pdata(x) consisting of a mixture of three Gaussians.

  1. (a)

    Write down the forward diffusion process that solves the heat equation p/t=D2p/x2 starting from p(,0)=pdata. Show that p(,T)𝒩(0,2DT) as T.

  2. (b)

    Discretise the reverse-time SDE d𝐱=[Dlogp(𝐱,t)]dt+2Dd𝐖t using the Euler–Maruyama method. Using the exact score logp(𝐱,t) (which you can compute analytically for the Gaussian mixture convolved with the heat kernel), generate samples from pdata.

  3. (c)

    What happens to sample quality as you increase D? Decrease it? Relate your observations to the noise schedule in DDPM\@.

Burgers' Equation and Conservation Laws

If the heat equation is the gentle giant of PDE theory-smoothing everything it touches, dissipating energy, approaching equilibrium-then Burgers' equation is its mischievous cousin. Burgers' equation adds a single ingredient to diffusion-nonlinear advection-and the consequences are dramatic: steep gradients, shock waves, and a rich interplay between smoothing and steepening that prefigures the full complexity of fluid dynamics.

For neural PDE solvers, Burgers' equation occupies a uniquely important position. It is simple enough to admit an exact analytical solution (via the Cole–Hopf transformation), yet complex enough to expose the fundamental limitations of PINNs and neural operators when confronted with discontinuities. It is, in a very real sense, the Drosophila of computational physics: a model organism for studying how neural architectures handle shocks.

The viscous Burgers equation

Definition 31 (Viscous Burgers equation).

The one-dimensional viscous Burgers equation is (Burgers)ut+uux=ν2ux2,x,t>0, where ν>0 is the kinematic viscosity. The left-hand side contains nonlinear advection (the term uu/x), while the right-hand side provides viscous diffusion.

The equation can also be written in conservation form: (Conservation)ut+x(u22)=ν2ux2, which reveals its structure as a conservation law with flux function f(u)=u2/2 and viscous regularisation.

Historical Note.

Johannes Martinus Burgers (1895–1981) was a Dutch physicist who proposed this equation in 1948 as a simplified model for turbulence. While the equation turned out to be too simple to capture the essential features of turbulence (it lacks the pressure term and three-dimensionality of the Navier–Stokes equations), it has become one of the most studied nonlinear PDEs in applied mathematics. The Cole–Hopf transformation, discovered independently by Julian Cole and Eberhard Hopf in 1950–1951, showed that Burgers' equation is secretly linearisable-a remarkable and rare property among nonlinear PDEs.

Shock formation and the inviscid limit

The physics of Burgers' equation is governed by a competition between two effects:

  1. Nonlinear steepening: The advection term uu/x causes the wave to steepen. Points where u is large move faster than points where u is small, so the wave profile tilts forward until it threatens to become multi-valued.

  2. Viscous diffusion: The term ν2u/x2 smooths out gradients, counteracting the steepening.

When viscosity is large, diffusion dominates and the solution remains smooth. When viscosity is small, steepening dominates and the solution develops a shock-a region where u changes rapidly over a width of order O(ν).

Shock formation in Burgers' equation. A smooth initial profile steepens over time as faster-moving regions (high u) overtake slower regions (low u). At the breaking time, the gradient becomes infinite and a shock discontinuity forms. For small viscosity ν, the shock width is O(ν).

In the inviscid limit ν0, the Burgers equation becomes the inviscid Burgers equation u/t+uu/x=0. For generic smooth initial data with u0(x)<0 somewhere, the solution develops a gradient catastrophe (the derivative blows up) at a finite breaking time: (Breaktime)t=1minxu0(x). After t, the classical solution ceases to exist, and we must pass to weak solutions satisfying the Rankine–Hugoniot jump conditions and an entropy condition.

Theorem 19 (Rankine–Hugoniot condition).

A weak solution of the inviscid Burgers equation with a shock discontinuity at position xs(t) satisfies the jump condition (Rankine)x˙s(t)=f(u+)f(u)u+u=u++u2, where u+ and u are the solution values immediately to the right and left of the shock, respectively, and f(u)=u2/2 is the flux function.

The Cole–Hopf transformation

The viscous Burgers equation can be exactly solved by a remarkable change of variables:

Theorem 20 (Cole–Hopf transformation).

Define ϕ(𝐱,t) by (Colehopf)u=2νlogϕx=2νϕxϕ. Then u satisfies the viscous Burgers equation if and only if ϕ satisfies the heat equation: (HEAT)ϕt=ν2ϕx2.

Proof.

Substitute u=2νϕx/ϕ into the Burgers equation. First compute: ut=2νϕxtϕϕxϕtϕ2,ux=2νϕxxϕϕx2ϕ2,2ux2=2νddx[ϕxxϕϕx2ϕ2]. Substituting into ut+uux=νuxx and simplifying (using u=2νϕx/ϕ), every term reduces to a multiple of (ϕtνϕxx)/ϕ. The Burgers equation is satisfied if and only if ϕt=νϕxx.

Since the heat equation is exactly solvable (via convolution with the heat kernel), the Cole–Hopf transformation gives an exact solution of the viscous Burgers equation for any initial data.

Example 24 (Exact Burgers solution via Cole–Hopf).

Let u0(x)=sin(πx) on [1,1] with periodic boundary conditions and ν=0.01/π. The Cole–Hopf transformation gives: ϕ(x,0)=exp(12ν0xu0(s)ds)=exp(cos(πx)12νπ). Solving the heat equation for ϕ and transforming back yields the exact u(x,t), which develops a sharp shock near x=0 for t1/π. This exact solution serves as the ground truth for benchmarking neural solvers.

Why PINNs fail on shocks

The Burgers shock is a litmus test for neural PDE solvers: any method that cannot resolve it is fundamentally limited. Standard PINNs fail on this problem, and understanding why they fail illuminates the path toward better architectures.

Spectral bias analysis

The shock in the viscous Burgers solution has width O(ν). When ν=0.01/π0.003, the shock occupies roughly 0.3% of the spatial domain. Resolving this feature requires high-frequency Fourier modes up to k1/ν300. But the spectral bias of MLPs with smooth activations (tanh, sigmoid) means that the Neural Tangent Kernel eigenvalues λk decay exponentially for k1, making modes near k=300 essentially unlearnable within a reasonable number of gradient steps.

Proposition 14 (PINN failure for thin shocks).

Consider a PINN uϕ(x,t) approximating the Burgers solution with a shock of width δν. If the network uses smooth activations and has finite width W, then the relative L2 error satisfies uϕuL2uL2Cδ1/2for training iterations TO(1λ1/δ), where λ1/δ is the NTK eigenvalue at frequency k1/δ and C>0 is a constant. For smooth activations, λ1/δ is exponentially small in 1/δ, so the required training time grows exponentially as ν0.

This proposition makes the problem precise: PINNs do not just struggle with shocks-they require exponentially more training time as the shock becomes thinner.

PINNsFormer: Transformer + wavelet activation

Zhao et al. (2024) proposed PINNsFormer, a Transformer-based architecture that addresses both spectral bias and temporal dependencies. The key innovations are:

  1. Wavelet activation functions: Replace tanh/sigmoid with the Mexican hat wavelet ψ(x)=(1x2)ex2/2. Wavelets have compact support in both physical and frequency space, providing multi-scale representation without spectral bias.

  2. Temporal attention: Instead of treating time as just another input coordinate, PINNsFormer creates a sequence of pseudo-time-steps {t1,,tK} and applies self-attention across them, allowing the network to capture temporal causality and long-range time dependencies.

  3. Multi-head physics attention: Different attention heads specialise in different spatial scales, enabling simultaneous resolution of the smooth background and the sharp shock.

Comparison of standard PINN (left) and PINNsFormer (right) on Burgers' equation with a thin shock (ν=0.01/π). The standard PINN smooths the shock due to spectral bias, while PINNsFormer's wavelet activations and temporal attention enable sharp shock resolution. Dashed lines show the exact solution.

On the standard Burgers benchmark (ν=0.01/π), PINNsFormer reduces the relative L2 error from 11% (standard PINN) to 1.2%, a nearly 10× improvement. The wavelet activation alone accounts for approximately half of this gain, with temporal attention providing the other half.

FNO and operator learning benchmarks on Burgers

Unlike PINNs (which solve a single instance), neural operators learn the family of Burgers solutions parameterised by initial conditions. The standard benchmark task is: (Operator)𝒢:u0()u(,T), mapping the initial condition u0 to the solution at a fixed future time T=1, with ν=0.1 or ν=0.01.

The results depend dramatically on the viscosity:

Methodν=0.1 (%)ν=0.01 (%)ν=0.001 (%)
FNO (16 modes)0.140.986.7
DeepONet0.381.528.1
U-Net0.211.105.2
Transformer0.180.874.8

Remark 19 (The ν0 challenge).

As ν decreases, the errors for all methods increase dramatically. This is not a failure of neural architectures per se-it reflects the fundamental increase in solution complexity. The shock width scales as O(ν), requiring spatial resolution proportional to 1/ν for any method. The FNO, which uses a fixed number of Fourier modes kmax, cannot represent features smaller than 1/kmax, leading to a hard resolution limit. For ν=0.001, the U-Net and Transformer outperform FNO because their multi-scale and attention mechanisms can adaptively focus on the shock region.

SafeDiffCon: safe diffusion for Burgers control

Wei et al. (2025) introduced SafeDiffCon (Safe Diffusion-based Controller), a framework that uses diffusion models for optimal control of PDE systems subject to safety constraints.

Consider the control problem: steer the Burgers equation from an initial state u0 to a target state utarget by applying a forcing term g(x,t): (Safediffcon)ut+uux=ν2ux2+g(x,t), subject to the constraint that u(x,t) must remain within safety bounds [umin,umax] for all (x,t).

SafeDiffCon trains a conditional diffusion model on a dataset of optimal control trajectories (computed offline using adjoint methods). At inference, the diffusion model generates candidate control sequences, and a safety filter-based on control barrier functions-projects these onto the feasible set in real time.

Definition 32 (Diffusion-based PDE controller).

The SafeDiffCon controller generates the control signal g(x,t) by:

  1. Encoding the current state: The PDE state u(,tk) at the current time step is encoded as a conditioning input to a diffusion model.

  2. Generating control candidates: The diffusion model samples M candidate control sequences {g(j)}j=1M for the next planning horizon [tk,tk+H].

  3. Safety filtering: Each candidate is projected onto the safe set 𝒞={g:uminu(x,t)umax} using a linearised dynamics model and quadratic programming.

  4. Selection: The safe candidate with lowest cost (closest to utarget) is applied.

On the Burgers control benchmark, SafeDiffCon achieves 37% lower tracking error than model predictive control (MPC) baselines while maintaining zero safety violations, compared to a 12% violation rate for unconstrained diffusion controllers.

Riemann problems and conservation law structure

The inviscid Burgers equation is the simplest example of a scalar conservation law: (Conslaw)ut+f(u)x=0, with flux f(u)=u2/2. The Riemann problem-the initial-value problem with piecewise-constant initial data (Riemann)u(x,0)={uLif x<0,uRif x>0, -is the fundamental building block of conservation law theory.

For Burgers' equation, the Riemann problem has exactly two cases:

  1. Shock wave (uL>uR): The solution is a discontinuity propagating at speed s=(uL+uR)/2.

  2. Rarefaction wave (uL<uR): The solution is a continuous, self-similar expansion fan u(x,t)=x/t connecting uL to uR.

Example 25 (Neural operators on Riemann problems).

Training neural operators on Riemann problems reveals a fundamental tension. The training loss (typically relative L2) does not distinguish between a sharp shock and a smoothed approximation of the same shock: both can have small L2 error. As a result, neural operators trained with L2 loss tend to produce entropy-violating solutions for the Riemann problem-rarefaction fans where shocks should be, or diffused shocks that violate the Rankine–Hugoniot conditions.

This observation motivates the development of physics-constrained neural operators that incorporate conservation law structure (Godunov fluxes, entropy conditions) directly into the architecture or loss function.

Exercise 17 (Cole–Hopf transformation derivation).

  1. (a)

    Starting from the substitution u=2νϕx/ϕ, carry out the full algebraic derivation showing that u satisfies the viscous Burgers equation if and only if ϕ satisfies the heat equation. (Hint: compute ut, uux, and uxx separately, then combine.)

  2. (b)

    Given the initial condition u(x,0)=Asin(kx) on [0,2π/k] with periodic boundary conditions, find the corresponding initial condition ϕ(x,0) for the heat equation.

  3. (c)

    For small ν, explain qualitatively why the heat equation solution ϕ develops a “notch” (a region where ϕ is very small), and why the Cole–Hopf transformation converts this notch into a shock in u.

  4. (d)

    (Challenge.) Show that the exact solution via Cole–Hopf can be written as u(x,t)=xytexp(G(x,y,t)2ν)dyexp(G(x,y,t)2ν)dy, where G(x,y,t)=(xy)22t+0yu0(s)ds. Interpret this formula as a weighted average of characteristic speeds.

Exercise 18 (Implement FNO for Burgers' equation).

Using your FNO implementation from Exercise Exercise 15 (or starting from scratch):

  1. (a)

    Generate training data for the 1D Burgers equation with ν=0.1: sample 1000 initial conditions u0 from a Gaussian random field with length scale l=0.2, and compute solutions at T=1 using a spectral method (or the Cole–Hopf transformation).

  2. (b)

    Train a 1D FNO with 4 Fourier layers, kmax=16 modes, and channel width dv=64. Report the relative L2 test error.

  3. (c)

    Repeat with ν=0.01 and ν=0.001. Plot the error as a function of ν. Does the error increase as predicted by Remark Remark 19?

  4. (d)

    Increase kmax to 32, 64, 128. Does increasing the number of Fourier modes help for small ν? At what point does the benefit saturate?

  5. (e)

    (Challenge.) Implement a simple adaptive Fourier mode selection: during training, monitor which Fourier modes have the largest learned weights, and dynamically allocate more modes to the frequency bands where the weights are largest. Does this improve accuracy on the small-ν case?

Shallow Water Equations

We conclude this first survey of PDE families with a system that is far more complex than anything we have encountered so far: the shallow water equations (SWE). These equations govern the motion of a thin layer of fluid under gravity-think of ocean waves, river flows, tidal bores, or the large-scale circulation of the atmosphere. The SWE are a system of hyperbolic conservation laws that couple mass and momentum, admit both smooth waves and shocks, and-when posed on the rotating sphere-incorporate the Coriolis force that dominates large-scale geophysical dynamics.

For neural PDE solvers, the shallow water equations represent a major step up in difficulty. They are a system (not a scalar equation), they are nonlinear (with wave-wave interactions), they live on non-trivial geometries (the sphere), and they exhibit multi-scale dynamics (from small ripples to planetary-scale Rossby waves). Success on the SWE is a prerequisite for tackling the full atmospheric equations that drive weather prediction.

The SWE system

Definition 33 (Shallow water equations).

The shallow water equations in two spatial dimensions, with bottom topography b(𝐱) and Coriolis parameter f, are: (SWE)ht+(h𝐯)=0(mass conservation),(h𝐯)t+(h𝐯𝐯)+gh(h+b)+f𝐳^×(h𝐯)=𝟎(momentum conservation), where h(𝐱,t) is the fluid depth, 𝐯(𝐱,t)=(v1,v2) is the depth-averaged velocity, g is gravitational acceleration, b(𝐱) is the bottom topography (bathymetry), and f is the Coriolis parameter (which varies with latitude on the rotating Earth: f=2Ωsinφ).

Remark 20 (The SWE as a hyperbolic system).

Writing the SWE in vector conservation form 𝐔/t+𝐅(𝐔)=𝐒(𝐔) with 𝐔=(h,hv1,hv2), the system is strictly hyperbolic whenever h>0. The eigenvalues of the flux Jacobian give the characteristic speeds: vnc, vn, and vn+c, where vn is the normal velocity component and c=gh is the gravity wave speed. These three families of waves correspond to left-going waves, the material transport, and right-going waves. The ratio Fr=|𝐯|/c (the Froude number) determines whether the flow is subcritical (Fr <1) or supercritical (Fr >1), analogous to subsonic and supersonic flow in gas dynamics.

Applications and physical significance

The shallow water equations arise whenever a fluid layer is much thinner than its horizontal extent:

  • Tsunami propagation: Ocean waves generated by earthquakes are well-modelled by the SWE, as the wavelength (100–500 km) vastly exceeds the ocean depth (4 km). Real-time SWE simulations are critical for tsunami early warning systems.

  • Atmospheric dynamics: The “shallow” atmosphere of Earth (thickness 10 km vs. radius 6400 km) supports large-scale dynamics that are well-approximated by the SWE on the rotating sphere-Rossby waves, Kelvin waves, and geostrophic adjustment.

  • River and coastal flooding: The SWE with friction terms model the propagation of flood waves through river systems and coastal inundation during storm surges.

  • Ocean circulation: The large-scale, depth-averaged ocean circulation (gyres, western boundary currents) is governed by the SWE with wind forcing and bottom friction.

Spherical Fourier Neural Operator (SFNO)

Standard FNO uses the FFT on rectangular grids, but the Earth is a sphere. For geophysical applications, we need an operator that respects spherical geometry. The Spherical Fourier Neural Operator (SFNO) of Bonev et al. (2023) generalises FNO by replacing the FFT with the spherical harmonic transform (SHT).

Definition 34 (Spherical Fourier layer).

A spherical Fourier layer operates on functions defined on the sphere 𝕊2. Given an input field v(λ,φ) (where λ is longitude and φ is latitude), the layer computes:

  1. Forward SHT: Expand v in spherical harmonics: v^m=𝕊2v(λ,φ)Ym(φ,λ)dω.

  2. Spectral multiplication: Multiply by a learnable complex tensor: w^m=Rθ(,m)v^m, truncated at degree max.

  3. Inverse SHT: Transform back: w(λ,φ)==0maxm=w^mYm(φ,λ).

  4. Pointwise bypass and activation: Add a local linear map Wv+b and apply a nonlinear activation.

The SFNO architecture naturally handles the geometry of the sphere: there are no pole singularities (which plague latitude-longitude grids), and the spherical harmonics form a complete, orthonormal basis on 𝕊2. The spectral truncation at max provides a natural scale separation, analogous to the wavenumber truncation in standard FNO\@.

On the SWE benchmark (rotating shallow water on the sphere with realistic Coriolis forces), SFNO achieves significantly lower errors than standard FNO applied to equirectangular projections, because the latter introduces artificial distortions near the poles.

ECHO: million-point generative transformer

Lippe et al. (2024) introduced ECHO (Efficient Conditional Hierarchical Operator), a generative Transformer that scales to over one million spatial points-the resolution required for realistic geophysical simulations.

The key challenge is computational: standard self-attention over N points has O(N2) cost, which is prohibitive for N=106. ECHO addresses this through a hierarchical compression strategy:

  1. Patch embedding: The spatial field is divided into patches (e.g., 16×16), and each patch is embedded into a single token. This reduces N=106 points to 4000 tokens.

  2. Multi-scale attention: Attention is applied at multiple resolutions using a U-shaped architecture: first at the coarsest level (global context), then progressively finer levels (local detail).

  3. Conditional generation: The current state 𝐔(tk) conditions the model to generate the next state 𝐔(tk+1), enabling autoregressive rollout over long time horizons.

On the SWE benchmark, ECHO produces physically coherent solution fields that maintain conservation of mass and geostrophic balance over multi-day rollouts, even when generating at resolutions unseen during training.

Example 26 (SWE on the rotating sphere).

Consider the standard Galewsky test case: a zonal jet on the rotating sphere, perturbed by a localised bump in the height field. The initial jet is in geostrophic balance (the pressure gradient force balances the Coriolis force), but the perturbation triggers barotropic instability, producing a cascade of eddies and Rossby waves.

This test case is challenging for neural solvers because:

  1. The initial condition is nearly steady-any spurious dissipation in the neural model will cause the jet to decay unrealistically.

  2. The instability grows exponentially from a small perturbation, amplifying any numerical errors.

  3. The long-term dynamics involve a turbulent cascade that is sensitive to the representation of small-scale features.

SFNO with max=128 maintains the jet structure and captures the instability onset, while standard FNO on a latitude-longitude grid produces spurious waves near the poles.

PROSE-FD: multimodal PDE foundation model

Sun et al. (2024) proposed PROSE-FD (PDE Representation and Operator Solving via Finite Differences), a multimodal foundation model that can solve different PDEs with a single set of weights. The key insight is to encode PDE information as a symbolic token sequence (a textual description of the equation) alongside the numerical field data.

For the shallow water equations, PROSE-FD receives:

  1. Symbolic tokens: A tokenised representation of the SWE, including the equation structure, parameter values (g, f), and boundary conditions.

  2. Numerical tokens: The initial state (h,v1,v2) discretised on a grid and flattened into a token sequence.

The Transformer processes both modalities jointly, using cross-attention between symbolic and numerical tokens, and outputs the predicted state at the next time step.

Insight.

PROSE-FD represents a fundamental shift in how we think about neural PDE solvers: instead of training one model per PDE (or per PDE family), the goal is a single foundation model that understands the language of PDEs. The symbolic tokens allow the model to distinguish between, say, the heat equation and the wave equation without separate training, much as a large language model can switch between French and German based on the input text.

DiTTO: diffusion-inspired temporal transformer

Hemmasian and Barati Farimani (2024) introduced DiTTO (Diffusion-inspired Temporal Transformer Operator), which combines the temporal modelling strengths of diffusion processes with the spatial modelling strengths of Transformers.

The core idea is to treat the temporal evolution of a PDE solution as a “denoising” process:

  1. Temporal diffusion: The difference between the solution at time tk and tk+1 is modelled as a “noise” that must be predicted and removed.

  2. Iterative refinement: Instead of predicting u(,tk+1) in a single forward pass, DiTTO iteratively refines the prediction over multiple “denoising” steps, each conditioned on u(,tk).

  3. Adaptive compute: For time steps where the dynamics are slow (smooth evolution), fewer refinement steps suffice; for time steps with rapid changes (shock formation, wave breaking), more steps are needed.

On the PDEBench shallow water benchmark, DiTTO achieves 15–25% lower error than single-pass neural operators (FNO, U-Net) while using only 3× more compute, a favourable trade-off.

Schematic of shallow water wave propagation. The fluid depth h(𝐱,t) varies due to wave motion, the velocity field 𝐯 transports mass and momentum, gravity g provides the restoring force, the Coriolis force due to planetary rotation Ω deflects flow, and the bottom topography b(𝐱) modulates wave propagation.

PDEBench shallow water benchmarks

PDEBench provides a standardised 2D shallow water dataset:

  • Domain: [0,1]2 with periodic boundary conditions.

  • Resolution: 128×128 spatial, 21 time steps.

  • Initial conditions: Random height perturbations on a flat bottom (b=0), no Coriolis force (f=0).

  • Dataset: 1000 trajectories for training, 200 for testing.

Method1-step error (%)Full rollout error (%)
FNO1.28.5
U-Net1.07.1
Dilated ResNet1.812.3
SFNO0.95.8
DiTTO0.85.2

Remark 21 (Error accumulation in autoregressive rollout).

The gap between 1-step and full-rollout errors is striking: errors compound with each autoregressive step. A 1% error per step, compounded over 20 steps, can yield 20% or more cumulative error. This error accumulation is the central challenge of autoregressive neural PDE solvers. Strategies to mitigate it include: (a) noise injection during training (exposing the model to its own errors); (b) pushforward training (unrolling multiple steps during training and backpropagating through the rollout); (c) physics constraints (enforcing conservation of mass and energy at each step).

Exercise 19 (Shallow water conservation laws).

  1. (a)

    Starting from the SWE with f=0 and b=0 (no rotation, flat bottom), show that the total mass M=Ωhd𝐱 is conserved: dM/dt=0.

  2. (b)

    Show that the total energy E=Ω(12h|𝐯|2+12gh2)d𝐱 is conserved. (Hint: multiply the mass equation by 12|𝐯|2+gh and the momentum equation by 𝐯, then integrate.)

  3. (c)

    Consider a neural operator h^n+1,𝐯^n+1=𝒢θ(hn,𝐯n) that does not enforce conservation. Design a simple post-processing projection that adjusts h^n+1 to satisfy exact mass conservation while minimally perturbing the prediction. (Hint: add a spatially uniform correction.)

  4. (d)

    Can you design a similar projection for energy conservation? Why is this harder than mass conservation?

Challenge 4 (Building a multi-PDE benchmark).

Using the PDEBench library (or generating your own data), build a unified benchmark spanning all four PDE families in this section:

  1. (a)

    Darcy flow (elliptic): 500 samples at 64×64.

  2. (b)

    Heat equation (parabolic): 500 trajectories at 64×100.

  3. (c)

    Burgers' equation (hyperbolic, ν=0.01): 500 trajectories at 1024×100.

  4. (d)

    Shallow water (hyperbolic system): 500 trajectories at 64×64×20.

Train a single FNO-based model on all four datasets simultaneously, using a task identifier as an additional input channel. Compare the accuracy of this multi-task model against four separate single-task models. Does multi-task training help or hurt? On which PDE family is the effect most pronounced?

Navier–Stokes: The Crown Jewel of Fluid Dynamics

“Turbulence is the most important unsolved problem of classical physics.” - Richard Feynman

We have now assembled the full toolkit: physics-informed neural networks, neural operators, Transformers, and diffusion models. It is time to unleash these tools on the equation that matters most in applied mathematics and engineering-the Navier–Stokes (NS) equations. The NS equations govern the motion of viscous fluids and appear in an astonishing range of applications: aircraft design, weather prediction, cardiovascular modelling, turbine optimisation, ocean circulation, and the combustion dynamics inside every car engine. They are also the subject of one of the seven Clay Millennium Prize Problems, which asks whether smooth solutions in three dimensions exist for all time-a question that remains open after more than a century.

In this section we show how Transformer and diffusion-based generative models are transforming computational fluid dynamics (CFD), replacing hours of simulation with seconds of inference while preserving the multi-scale physics that makes these equations so challenging.

The incompressible Navier–Stokes equations

For an incompressible, Newtonian fluid with density ρ and dynamic viscosity μ, the velocity field 𝐮(𝐱,t)d and pressure field p(𝐱,t) satisfy:

Definition 35 (Incompressible Navier–Stokes equations).

(NS Momentum)ρ𝐮tunsteady+ρ(𝐮)𝐮convection=ppressure+μ2𝐮diffusion+𝐟body force,𝐮=0. Here 𝐟(𝐱,t) is an external body force (e.g. gravity). Equation is the momentum equation (Newton's second law for a continuum), and equation is the incompressibility constraint (conservation of mass for constant-density flows).

The Reynolds number (Reynolds)Re=ρULμ, where U and L are characteristic velocity and length scales, quantifies the ratio of inertial to viscous forces. At low Re (think honey pouring from a spoon), viscosity dominates and flows are smooth (laminar). As Re increases (think a Boeing 747 at cruising altitude, Re107), flows become turbulent-chaotic, multi-scale, and computationally catastrophic.

Remark 22 (Non-dimensionalisation).

Dividing by ρ and rescaling lengths by L and velocities by U yields the non-dimensional form: (NS Nondim)𝐮t+(𝐮)𝐮=p+1Re2𝐮+𝐟,𝐮=0. This form shows that Re is the sole governing parameter for incompressible flows (up to forcing and geometry).

Compressible Navier–Stokes equations

When the fluid density ρ(𝐱,t) varies (e.g. at high Mach numbers, in combustion, or in astrophysical flows), we must solve the full compressible system: (Compns MASS)ρt+(ρ𝐮)=0,(ρ𝐮)t+(ρ𝐮𝐮)=p+𝝉+ρ𝐟,(ρE)t+[(ρE+p)𝐮]=(𝝉𝐮)+(κT)+ρ𝐟𝐮, where E=e+12|𝐮|2 is the total specific energy, e is the internal energy, T is the temperature, κ is the thermal conductivity, and 𝝉 is the viscous stress tensor. An equation of state (e.g. the ideal gas law p=ρRT) closes the system.

Key Idea.

Why Navier–Stokes is THE Benchmark for Generative PDE Models The NS equations combine every difficulty that plagues neural PDE solvers: (i) nonlinear convection that produces shocks and turbulence, (ii) a saddle-point structure (velocity-pressure coupling), (iii) multi-scale physics spanning orders of magnitude in space and time, and (iv) strong sensitivity to initial/boundary conditions. Any generative model that can handle NS convincingly is likely to generalise well to a wide class of PDEs.

Transformer-based approaches for Navier–Stokes

Transformers bring two distinctive strengths to NS modelling: global receptive fields (via self-attention) that capture long-range pressure-velocity coupling, and geometry flexibility that handles unstructured meshes arising in industrial CFD\@. We survey the most impactful Transformer-based methods.

Transolver: Physics-aware Transformers for industrial CFD

Real-world CFD meshes are not regular grids. The mesh around an airfoil, for instance, is highly refined near the leading edge, coarse in the far field, and may contain millions of nodes. Standard Transformers struggle with this because naive self-attention scales as O(N2) in the number of mesh nodes N.

Transolver (Wu et al., 2024) addresses this by introducing physics-aware slicing: the computational domain is decomposed into a small number of overlapping “slices” that respect the underlying physics (e.g. boundary layers, wake regions, far field). Attention is computed within and across slices, reducing complexity from O(N2) to O(NS+S2), where SN is the number of slices.

Proposition 15 (Transolver complexity).

Let N be the number of mesh nodes and S the number of physical slices. The Transolver attention mechanism has computational cost O(NS) for node-to-slice assignment and O(S2) for inter-slice attention, yielding total cost O(NS+S2). For S=O(N), this gives O(N3/2)-a significant improvement over O(N2) for large meshes.

Example 27 (Transolver on airfoil pressure prediction).

Consider the AirfRANS dataset (Bonnet et al., 2022), which contains Reynolds-Averaged NS (RANS) simulations over airfoil profiles at Reynolds numbers 2×106 to 6×106, with meshes of approximately 200,000 nodes.

Transolver achieves relative L2 errors of approximately 0.6% on velocity and 1.2% on pressure, outperforming FNO (2.4% velocity error), GNOT (1.8%), and standard ViT-based approaches (3.1%). Crucially, inference takes 0.4,s per sample versus 20 minutes for the original RANS solver on a single GPU\@. This represents a speedup of approximately 3,000×.

HAMLET: Fluid-structure interaction

In many engineering problems, the fluid interacts with a deformable or moving solid-think of blood flow through a beating heart or aeroelastic flutter of a wing. The HAMLET framework (Graph Mesh Learner with Efficient Transformers; Bryutkin et al., 2024) tackles these fluid-structure interaction (FSI) problems by combining graph neural networks (for local mesh interactions) with efficient Transformer attention (for global coupling between the fluid and structural domains).

HAMLET uses a two-level architecture:

  1. Local GNN encoder: A message-passing GNN operates on the mesh graph, capturing local interactions between neighbouring nodes (stress propagation, convection).

  2. Global Transformer: The GNN node embeddings are pooled into a moderate number of “super-nodes” representing patches of the mesh, and a Transformer computes attention among these super-nodes. This captures the global fluid-structure coupling (e.g. the pressure wave from the fluid reaching the solid boundary and causing deformation, which in turn alters the flow).

GAOT: General geometry operator Transformer

The Geometry-Aware Operator Transformer (GAOT; Li et al., 2024) extends the operator-learning paradigm to arbitrary computational geometries. The key innovation is a geometry-conditioned attention mechanism: the attention weights depend not only on the function values at query/key positions but also on the local geometric features of the mesh (curvature, normal vectors, element aspect ratios).

Definition 36 (Geometry-conditioned attention).

Given mesh node features {𝐡i}i=1N and geometric descriptors {𝐠i}i=1N (encoding local curvature, normal direction, and element size), GAOT defines: (GAOT ATTN)αij=softmaxj((𝐖Q𝐡i)(𝐖K𝐡j)dk+ϕg(𝐠i,𝐠j)), where ϕg:dg×dg is a learnable geometric bias function (implemented as a small MLP operating on the concatenation [𝐠i;𝐠j;𝐠i𝐠j]).

Foundation models: MPP and CoDA-NO

A striking recent trend is the development of foundation models for PDEs-large Transformer-based architectures pretrained on diverse PDE datasets and fine-tuned for specific applications.

Multiple Physics Pretraining (MPP) (McCabe et al., 2023) pretrains a Vision Transformer on a large corpus of PDE simulation data spanning Navier–Stokes, shallow water, diffusion–reaction, compressible Euler, and Maxwell's equations. The key insight is that diverse PDE fields (velocity, pressure, temperature, electromagnetic fields) can be tokenised into patches and processed by a single Transformer backbone, much as language tokens from different languages can be processed by a multilingual LLM\@.

CoDA-NO (Cooperation of Domain Adaptation with Neural Operators; Subramanian et al., 2024) takes a complementary approach: instead of pretraining on simulation data, it uses domain adaptation techniques to transfer a neural operator trained on one PDE family to another. The method introduces learnable domain tokens that encode the “physics signature” of each PDE type, allowing a single model to serve as a multi-physics solver.

Example 28 (MPP zero-shot transfer).

After pretraining on a mix of 2D incompressible NS, shallow water, and diffusion–reaction data, MPP is evaluated (zero-shot, without fine-tuning) on the compressible Euler equations. The pretrained model achieves a normalised RMSE of 0.041, compared to 0.063 for an FNO trained from scratch on the same Euler data. Fine-tuning MPP on just 100 Euler samples reduces the error further to 0.028-a 2.3× improvement over the from-scratch baseline, demonstrating strong positive transfer across PDE families.

Diffusion-based approaches for Navier–Stokes

Diffusion models bring a complementary set of strengths: distributional modelling (generating diverse plausible solutions rather than a single point estimate), flexible conditioning (sparse observations, physics constraints), and high-frequency fidelity (the iterative denoising process can recover fine-scale structures that regression-based methods blur away).

DiffusionPDE: Sparse reconstruction

Imagine you have a sparse set of pressure sensors scattered across an airfoil surface and wish to reconstruct the full pressure and velocity fields. This is an inverse problem-ill-posed, since many flow configurations are consistent with a handful of sensor readings.

DiffusionPDE (Huang et al., 2024) formulates this as conditional generation. A diffusion model is trained on a dataset of full NS solution fields (velocity 𝐮, pressure p). At inference, the sparse observations 𝐲=(𝐮,p) (where is the observation operator selecting sensor locations) are incorporated via a guidance mechanism.

Definition 37 (Observation-guided denoising).

Let 𝐮t denote the noisy state at diffusion time t, and let 𝐮^0|t=𝔼[𝐮0|𝐮t] be the predicted clean state (Tweedie estimate). DiffusionPDE adds a guidance gradient at each denoising step: (Diffpde Guidance)𝐮~t1=𝐮t1DDPMηt𝐮t(𝐮^0|t)𝐲2, where ηt is a step-size schedule and 𝐮t1DDPM is the standard DDPM update. The gradient “steers” the denoising trajectory toward solutions consistent with the observations.

Example 29 (DiffusionPDE on 2D cylinder flow).

For 2D flow past a cylinder at Re=200 (vortex shedding regime), DiffusionPDE reconstructs the full velocity field from 1% randomly placed sensors with a relative L2 error of 3.8%. In contrast, a deterministic FNO-based inverse solver achieves 8.2% error, and linear interpolation gives 22.1%. Moreover, DiffusionPDE produces calibrated uncertainty estimates: the true solution lies within the 90% credible interval 91.3% of the time.

Conditional diffusion for forecasting and assimilation

A landmark paper at NeurIPS 2024 (Rozet et al., 2024) demonstrated that conditional diffusion models can simultaneously perform forecasting (predicting the future state given the current state) and data assimilation (incorporating new observations as they arrive) for fluid dynamics.

The key idea is to train a score network sϕ(𝐮t,t|𝐮0prev) that is conditioned on the previous time step's solution field. This score network defines a conditional distribution over the next time step: (COND DIFF Forecast)pϕ(𝐮(n+1)|𝐮(n))pϕ(𝐮(n+1)|𝐮t(n))q(𝐮t(n)|𝐮(n))d𝐮t(n). For data assimilation, observations 𝐲(n+1) at the new time step are incorporated via Bayes' rule: (COND DIFF Assim)p(𝐮(n+1)|𝐮(n),𝐲(n+1))p(𝐲(n+1)|𝐮(n+1))pϕ(𝐮(n+1)|𝐮(n)).

Insight.

This formulation elegantly unifies three traditionally separate problems: (i) forward simulation (sample from the forecast distribution), (ii) data assimilation (apply Bayes' rule with observations), and (iii) uncertainty quantification (draw multiple samples to form an ensemble). Classical approaches like the Ensemble Kalman Filter require ad hoc covariance estimates; the diffusion model learns the full nonlinear forecast distribution.

PDE-Diffusion: Temporal coherence

A common pitfall of applying image diffusion models frame-by-frame to PDE trajectories is temporal incoherence: each frame is individually plausible, but consecutive frames may exhibit flickering, non-physical jumps, or violation of conservation laws.

PDE-Diffusion (Shu et al., 2024) addresses this by conditioning the denoising network on a temporal context window of K previous frames and adding a physics regulariser that penalises violations of the PDE residual in the generated trajectory: (PDE Diffusion)PDE-Diff=DDPM+λphys𝔼[𝒩[𝐮^0|t]2], where 𝒩 denotes the PDE residual operator and 𝐮^0|t is the denoised prediction at diffusion time t. The physics loss guides the model toward temporally coherent, physically consistent trajectories.

SimDiffPDE: Image-to-image translation

A refreshingly direct approach is taken by SimDiffPDE (Wang et al., 2024), which treats PDE solving as a conditional image-to-image translation problem. The input “image” encodes the PDE parameters (initial condition, boundary geometry, forcing term) as a multi-channel image, and the output “image” is the solution field. A standard conditional diffusion model (essentially a Palette-style architecture) is trained on pairs (ci,𝐮i) of parameter images and solution fields.

Remark 23 (When is image-to-image translation appropriate?).

SimDiffPDE works best when the solution field can be naturally represented on a regular grid (e.g. rectangular domains with periodic or simple boundary conditions). For complex geometries, unstructured meshes, or varying resolutions, the operator-based approaches (DiffusionPDE, CoCoGen) are more appropriate.

Key results: Error metrics and speedups

To contextualise the methods we have discussed, we present a comparison of representative results on standard NS benchmarks. The metrics reported are the relative L2 error (lower is better) and wall-clock speedup over the reference solver (higher is better).

Comparison of Transformer and diffusion methods for Navier–Stokes problems. “NS-2D” refers to the 2D vorticity equation benchmark from PDEBench; “AirfRANS” is the industrial airfoil RANS dataset; “NS-Inv” and “NS-Forecast” are inverse and forecasting variants. Speedups are relative to the respective reference solvers (DNS, RANS, or spectral methods).

Caution.

Speedup numbers should be interpreted with care. A 3,000× speedup over RANS does not mean the neural model is “better” than RANS-it means it is faster while achieving comparable accuracy on the training distribution. Neural surrogates may fail catastrophically for out-of-distribution inputs (e.g. Reynolds numbers or geometries not seen in training). Always validate against a reference solver for safety-critical applications.

Exercise 20 (Comparing solver paradigms).

Consider a 2D incompressible NS problem on [0,1]2 at Re=1,000 with a 256×256 grid.

  1. (a)

    Estimate the computational cost of DNS using a spectral method with semi-implicit time stepping. How many time steps are needed if the CFL condition requires ΔtΔx/Umax?

  2. (b)

    An FNO trained on 1,000 DNS snapshots achieves a relative L2 error of 2.4%. If inference takes 10,ms per snapshot and training took 4,GPU-hours, estimate the “break-even point”-the number of NS solves needed before the FNO investment pays off compared to DNS\@.

  3. (c)

    A diffusion model achieves 1.5% error but requires 100 denoising steps at 50,ms each. Compare the total inference time to the FNO and discuss when the higher accuracy justifies the extra cost.

Generative Modelling for Turbulence

“Big whirls have little whirls that feed on their velocity, and little whirls have lesser whirls and so on to viscosity.” - Lewis Fry Richardson (1922)

Turbulence is, by many accounts, the last great unsolved problem of classical physics. It is ubiquitous-from the mixing of cream in coffee to the formation of galaxies-yet its full mathematical characterisation has eluded physicists and mathematicians for over a century. In this section, we explain why turbulence is the ultimate test case for generative models of physical systems, and survey the remarkable recent progress in generating turbulent flows using GANs, diffusion models, and hybrid approaches.

Why turbulence is THE challenge

Turbulent flows are characterised by:

  • Chaotic sensitivity: Infinitesimal perturbations to initial conditions lead to exponentially diverging trajectories (positive Lyapunov exponents).

  • Multi-scale structure: Energy is injected at large scales and cascades down to the Kolmogorov microscale η, where it is dissipated by viscosity. The ratio of the largest to smallest scales is L/ηRe3/4.

  • Statistical stationarity: While individual realisations are unpredictable, the statistics (mean velocity profiles, energy spectra, structure functions) are reproducible and governed by universal scaling laws.

This presents a fundamental mismatch with deterministic neural surrogates. A single “best guess” prediction of a turbulent flow cannot be physically meaningful beyond the predictability time (typically a few eddy turnover times). What is meaningful are the statistics: the energy spectrum, probability density functions of velocity increments, and higher-order moments.

Key Idea.

Turbulence Demands Generative Models Turbulence is inherently a distributional phenomenon. The correct output of a turbulence model is not a single velocity field but a probability distribution over velocity fields-one that reproduces the correct energy spectrum, intermittency statistics, and spatial correlations. This is precisely what generative models provide.

Energy cascade and the Kolmogorov spectrum

In 1941, Andrei Kolmogorov proposed one of the most celebrated results in theoretical physics: in the inertial range (scales much smaller than the energy injection scale L and much larger than the dissipation scale η), the energy spectrum takes a universal form.

Theorem 21 (Kolmogorov's 5/3 law).

For homogeneous, isotropic turbulence in the inertial range 1/Lk1/η, the energy spectrum is: (Kolmogorov)E(k)=CKε2/3k5/3, where k=|𝐤| is the wavenumber magnitude, ε is the mean energy dissipation rate per unit mass, and CK1.5 is the Kolmogorov constant.

Proof.

The proof rests on dimensional analysis. In the inertial range, the only parameters are ε (with dimensions [L2T3]) and k (with dimensions [L1]). The energy spectrum has dimensions [L3T2]. The only combination is: E(k)=CKεakb,[L3T2]=[L2aT3a][Lb]. Matching dimensions: 2ab=3 and 3a=2, yielding a=2/3 and b=5/3.

Historical Note.

Andrei Nikolaevich Kolmogorov (1903–1987) was a Soviet mathematician of extraordinary breadth. His 1941 papers on turbulence, written during the siege of Moscow in World War II, introduced the concept of self-similar scaling in the inertial range and remain the cornerstone of turbulence theory. Remarkably, Kolmogorov himself later refined his theory (K62) to account for intermittency-the phenomenon of extreme, localised bursts of dissipation that cause deviations from the 5/3 law at higher-order statistics.

The energy spectrum is the single most important diagnostic for evaluating generative turbulence models: any model that fails to reproduce the 5/3 scaling in the inertial range is physically inadequate, regardless of its pixel-wise accuracy.

Energy spectrum comparison. DNS (blue solid) exhibits the Kolmogorov k5/3 scaling in the inertial range. A deterministic FNO (red dashed) matches at low wavenumbers but decays too steeply at high k (missing small-scale structures). A diffusion model (green dash-dotted) closely tracks the DNS spectrum across the full range, including the dissipation roll-off.

GAN-era approaches to turbulence

Before diffusion models dominated the field, GANs were the primary generative approach for turbulence modelling. Several key ideas from this era remain influential.

Physics-constrained GANs

The naive application of a GAN (e.g. DCGAN) to turbulence data produces visually plausible velocity fields but with incorrect statistics: the energy spectrum may have the wrong slope, or the two-point correlations may be inaccurate.

To address this, several groups introduced physics-constrained discriminator losses:

  1. Covariance matching (Wu et al., 2020): Add a penalty to the generator loss that measures the discrepancy between the spatial covariance of generated and real velocity fields: (GAN COV)cov=Rijgen(𝐫)Rijdata(𝐫)L2(𝐫)2, where Rij(𝐫)=ui(𝐱)uj(𝐱+𝐫) is the two-point velocity correlation tensor.

  2. Energy spectrum constraint (Kim & Lee, 2020): Compute the energy spectrum of generated fields via FFT and penalise deviations from the target spectrum: (GAN Spectrum)spec=0kmax|Egen(k)Edata(k)|2dk.

  3. Deterministic constraint (Bode et al., 2021): Enforce the divergence-free condition 𝐮=0 in the generator architecture via a stream-function or vector-potential parameterisation.

Example 30 (GAN with spectrum constraint for isotropic turbulence).

Kim & Lee (2020) trained a conditional GAN on 643 DNS snapshots of forced isotropic turbulence at Reλ=100. The generator was a 3D convolutional network; the discriminator operated on both the velocity field and its energy spectrum.

With the spectrum constraint , the generated fields matched the 5/3 scaling in the inertial range to within 5%, compared to 25% deviation without the constraint. However, higher-order statistics (fourth-order flatness factors) still showed significant errors, highlighting the difficulty of capturing intermittency with GANs.

Diffusion models for turbulence

The limitations of GANs-mode collapse, training instability, and difficulty enforcing complex statistical constraints-motivated the shift to diffusion models.

“From Zero to Turbulence” (ICLR 2024)

A conceptually striking result is the ability to generate turbulent velocity fields from scratch, without requiring an initial condition from a previous simulation. Shu et al. (ICLR 2024) demonstrated this with a score-based diffusion model trained on a dataset of statistically stationary turbulence snapshots.

The model learns the equilibrium distribution of the turbulent flow-the stationary measure of the Navier–Stokes dynamics. Sampling from this distribution produces velocity fields that are statistically indistinguishable from DNS snapshots: the energy spectrum, velocity PDFs, and structure functions all match to within statistical uncertainty.

Proposition 16 (Convergence to equilibrium statistics).

Let μ denote the stationary measure of the NS dynamics and μϕ the distribution learned by the diffusion model. If the score matching loss converges, i.e. 𝔼[sϕ(𝐮t,t)𝐮tlogqt(𝐮t)2]0, then μϕμ in distribution, and statistical observables (energy spectrum, structure functions) computed from μϕ-samples converge to those computed from μ-samples.

Turbulent flow generation pipeline: pure Gaussian noise is iteratively denoised by a learned score network to produce a turbulent velocity field. The generated field is validated against the Kolmogorov 5/3 energy spectrum and other statistical diagnostics.

CoNFiLD: Conditional neural-field latent diffusion

A key limitation of direct diffusion on high-resolution turbulence fields is computational cost: 3D turbulence on a 2563 grid requires denoising in a space of 50 million dimensions.

CoNFiLD (Conditional Neural Field Latent Diffusion; Du et al., Nature Communications 2024) addresses this by combining three ideas:

  1. Neural field representation: The turbulence field 𝐮(𝐱) is represented as a continuous neural field 𝐮𝜽(𝐱)=f𝜽(𝐱), parameterised by a compact latent vector 𝜽d.

  2. Latent diffusion: Instead of denoising the high-resolution field directly, CoNFiLD performs diffusion in the low-dimensional latent space d (d256512 in practice), reducing the computational cost by orders of magnitude.

  3. Conditional generation: The model is conditioned on physical parameters (Reynolds number, forcing type, boundary conditions) via cross-attention, enabling generation of turbulent fields across a range of flow regimes.

Example 31 (CoNFiLD for channel flow turbulence).

Du et al. applied CoNFiLD to turbulent channel flow at friction Reynolds numbers Reτ{180,395,590}, training on DNS data from the Johns Hopkins Turbulence Database. The model generates velocity fields at resolution 192×128×160 in approximately 2 seconds (vs. 12 hours for the equivalent DNS on 256 CPU cores).

Key statistics match DNS to within 2%: the mean velocity profile follows the law of the wall (U+=κ1lny++B with κ0.41, B5.2), the Reynolds stress profiles uv are reproduced accurately, and the energy spectrum matches the 5/3 law in the inertial range.

GenCFD: Score-based diffusion for CFD ensembles

GenCFD (Dreler et al., 2024) focuses on generating ensembles of turbulent flow realisations for uncertainty quantification. The key insight is that in many engineering applications, one does not need a single accurate prediction but rather a distribution of outcomes (e.g. the 95th percentile of drag on a structure exposed to turbulent wind).

GenCFD trains a score-based diffusion model on flow snapshots and uses it to generate large ensembles efficiently. The ensemble statistics (mean, variance, higher-order moments) are then used for risk assessment.

Proposition 17 (Ensemble calibration).

A well-calibrated generative ensemble satisfies: for any measurable set A in function space, (Gencfd Calib)1Mm=1M𝟏[𝐮(m)A]Mp(A), where 𝐮(m)pϕ are generated samples and p is the true data distribution. GenCFD verifies calibration using rank histograms and the Continuous Ranked Probability Score (CRPS).

Learning turbulent flows: Operator-generative hybrids

A 2026 paper in Nature Communications (Lienen et al., 2026) proposes a powerful hybrid: a deterministic neural operator provides the conditional mean prediction, and a diffusion model generates the stochastic residual (the difference between the true field and the conditional mean).

Definition 38 (Operator-generative decomposition).

The turbulent field is decomposed as: (TURB Hybrid)𝐮(𝐱,t)=𝐮ϕ(𝐱,t)conditional mean(neural operator)+𝐮ψ(𝐱,t)stochastic residual(diffusion model), where 𝐮ϕ is the output of a deterministic neural operator (e.g. FNO) and 𝐮ψpψ(|𝐮ϕ) is sampled from a conditional diffusion model.

This decomposition leverages the strengths of both paradigms: the neural operator captures the large-scale structure efficiently (one forward pass), while the diffusion model fills in the physically correct small-scale fluctuations. The result is both fast (the neural operator handles the bulk of the prediction) and statistically accurate (the diffusion model ensures the correct energy spectrum at high wavenumbers).

Super-resolution of turbulent flows

A particularly impactful application of generative models is super-resolution: taking a coarse-grid (Large Eddy Simulation, LES) flow field and adding physically consistent small-scale detail to produce a field at DNS resolution. This is exactly the problem that diffusion models excel at-adding high-frequency detail that is statistically correct but unpredictable in its exact realisation.

Example 32 (Diffusion super-resolution for 3D turbulence).

Consider a 643 LES field upsampled to 2563 (a factor of 4× in each direction, 64× in total grid points). A conditional diffusion model, trained on paired LES–DNS data, generates the sub-grid fluctuations conditioned on the LES field.

The key metric is the energy spectrum of the super-resolved field. Deterministic super-resolution (e.g. a U-Net with L2 loss) produces fields whose spectrum rolls off too steeply above the LES cutoff wavenumber-the model “invents” smooth interpolations rather than turbulent fluctuations. The diffusion model, by contrast, generates spectrally correct fluctuations that extend the 5/3 scaling to the DNS wavenumber range, matching the true spectrum to within 3% across the full inertial range.

Why L2 loss fails and diffusion succeeds

This subsection addresses a subtle but crucial point: why minimising the pixel-wise L2 error is fundamentally wrong for turbulent flows, and why diffusion models naturally avoid this pitfall.

Theorem 22 (Regression to the conditional mean destroys spectra).

Let 𝐮(𝐱) be a turbulent velocity field and 𝐮^(𝐱)=𝔼[𝐮|input] the conditional mean (the minimiser of the L2 loss). Then the energy spectrum of the conditional mean satisfies: (TURB L2 Spectrum)Eu^(k)Eu(k)for all k, with strict inequality for any wavenumber k at which the conditional distribution has nonzero variance. In the inertial range, where fluctuations dominate, the spectrum of the conditional mean can be orders of magnitude below the true spectrum.

Proof.

By the law of total variance applied to each Fourier mode u^k: Eu(k)=𝔼[|u^k|2]=|𝔼[u^k|input]|2=Eu^(k)+𝖵ar(u^k|input)0. Hence Eu^(k)Eu(k), with equality only when the conditional variance of mode k is zero. For turbulent flows in the inertial range, the conditional variance is large (the exact phase and amplitude of each eddy are unpredictable), so the inequality is strict and substantial.

Insight.

This theorem explains the universal observation that deterministic neural surrogates produce “blurry” turbulent fields: they correctly predict the large-scale structure (low k, where the conditional mean is close to the true field) but systematically under-predict the energy at high wavenumbers (where the conditional variance is large). Diffusion models, by sampling from the full conditional distribution rather than predicting the mean, naturally produce fields with the correct spectral content.

Exercise 21 (Computing the Kolmogorov spectrum from simulation data).

Given a 2D velocity field 𝐮(x,y)=(ux,uy) on a periodic domain [0,2π]2 discretised on an N×N grid:

  1. (a)

    Compute the 2D discrete Fourier transform u^x(kx,ky) and u^y(kx,ky) using the FFT\@.

  2. (b)

    Compute the 2D energy spectrum: E^(kx,ky)=12(|u^x(kx,ky)|2+|u^y(kx,ky)|2).

  3. (c)

    Compute the radially averaged (isotropic) energy spectrum by binning: for each integer wavenumber k, sum E^(kx,ky) over all (kx,ky) satisfying k1/2kx2+ky2<k+1/2.

  4. (d)

    Plot E(k) vs. k on a log-log scale and verify that the inertial range follows E(k)k5/3.

  5. (e)

    Generate 10 samples from a pretrained diffusion model (e.g. from the “From Zero to Turbulence” codebase) and overlay their spectra on the same plot. Do they match the DNS reference?

Exercise 22 (Mode collapse detection via energy spectrum).

A common failure mode of GANs for turbulence is mode collapse: the generator produces only a few distinct flow patterns.

  1. (a)

    Explain why mode collapse in a turbulence GAN would manifest as peaks in the energy spectrum at specific wavenumbers (corresponding to the limited set of spatial patterns the generator has memorised).

  2. (b)

    Propose a quantitative metric based on the variance of the energy spectrum across generated samples that would detect mode collapse. (Hint: for a well-calibrated generative model, the sample-to-sample variance of E(k) should match the variance computed from DNS snapshots.)

Helmholtz Equation and Wave Phenomena

We now turn from fluid dynamics to wave physics. The Helmholtz equation (Helmholtz)2u(𝐱)+k2u(𝐱)=f(𝐱),𝐱Ωd, governs time-harmonic waves: it arises when one assumes a time-periodic solution U(𝐱,t)=u(𝐱)eiωt in the wave equation t2U=c22U+F. Here k=ω/c is the wavenumber (frequency divided by wave speed), and f is a source term.

The Helmholtz equation appears throughout physics and engineering:

  • Acoustics: Sound wave propagation in rooms, concert halls, and noise barriers.

  • Seismology: Seismic wave propagation through the Earth's subsurface.

  • Electromagnetics: Scattering and diffraction of electromagnetic waves (radar, antennas).

  • Quantum mechanics: The time-independent Schrödinger equation is a Helmholtz-type equation.

Why high-frequency waves are hard

The Helmholtz equation becomes fiendishly difficult as the wavenumber k increases. There are two fundamental reasons:

  1. Oscillatory solutions: The solution oscillates on a length scale λ=2π/k. To resolve these oscillations, any discretisation (finite elements, neural network collocation points) must have a spacing hλ/10, leading to O(kd) degrees of freedom in d dimensions. For seismic applications at k100, this means 106 unknowns in 2D and 109 in 3D\@.

  2. Pollution effect: Even with sufficient mesh resolution, standard finite element methods accumulate phase errors that grow with k, requiring h=O(k(d+1)/d) for a fixed error tolerance-worse than the Nyquist limit.

  3. Spectral bias of neural networks: PINNs with smooth activations have eigenvalues that decay rapidly with frequency (as discussed in Section Spectral bias), making them catastrophically slow for high-k Helmholtz problems.

Caution.

The Helmholtz equation at high wavenumber is often called the “hardest easy problem” in numerical analysis. The PDE itself is linear, but solving it at high frequency is computationally harder than many nonlinear problems. Neural surrogates must grapple with this difficulty: a model trained at k=10 may fail completely at k=100 due to the fundamentally different solution structure.

NSNO: Neumann Series Neural Operator

The Neumann Series Neural Operator (NSNO; Agrawal et al., 2024) is a Transformer-based architecture specifically designed for the Helmholtz equation. The key idea is to incorporate the mathematical structure of the Neumann series (the iterative expansion of the Green's function) into the neural operator architecture.

Definition 39 (Neumann series for the Helmholtz equation).

The solution of the Helmholtz equation can be formally written as: (Neumann)u=n=0(k2G0)nG0f=G0fk2G02f+k4G03f, where G0 is the free-space Green's function (the inverse of 2). The series converges for sufficiently small k2G0.

NSNO approximates each term in the Neumann series by a Transformer layer, with the attention mechanism playing the role of the integral operator G0. Each layer effectively computes one term in the series, and the total network depth corresponds to the truncation order.

Proposition 18 (NSNO approximation).

An NSNO with L Transformer layers approximates the Neumann series truncated at order L. For wavenumbers satisfying k2G0<1, the truncation error is bounded by: (NSNO Error)uuNSNO(L)(k2G0)L+11k2G0G0f.

Diffusion for probabilistic Helmholtz solutions

A 2026 paper at ICLR (Baldassari et al., 2026) introduces a diffusion-based approach to the Helmholtz equation that provides calibrated uncertainty quantification. The key motivation is that in many applications (e.g. subsurface imaging), the wave speed c(𝐱) is only approximately known, leading to uncertainty in the wavenumber field k(𝐱)=ω/c(𝐱).

The diffusion model is conditioned on:

  • The source term f(𝐱),

  • A (possibly uncertain) wavenumber field k(𝐱),

  • Sparse boundary observations of u.

The model generates an ensemble of solution fields, each consistent with the observations and the PDE (within the uncertainty on k). The ensemble spread provides a principled measure of solution uncertainty.

Example 33 (Probabilistic Helmholtz for subsurface imaging).

In seismic exploration, a source at the surface generates waves that propagate through layered rock formations with unknown velocity structure. Receivers at the surface record the wavefield. The task is to invert for both the velocity model and the wavefield.

Baldassari et al. train a conditional diffusion model on synthetically generated Helmholtz solutions for random layered media. At test time, given sparse receiver data (16 surface receivers), the model generates 100 posterior samples of the wavefield. The ensemble mean achieves a relative error of 4.7% (vs. 7.2% for a deterministic baseline), and the 90% credible intervals achieve 92% coverage, demonstrating well-calibrated uncertainty.

Spectrum-preserving wavefield surrogates

Just as turbulence models must preserve the energy spectrum, wavefield surrogates must preserve the spatial frequency content of the Helmholtz solution. This is particularly challenging because the solution contains sharp features (caustics, shadow boundaries, diffraction patterns) that span a wide range of spatial frequencies.

Definition 40 (Spectral fidelity metric for wavefields).

The spectral fidelity of a predicted wavefield u^ relative to the true wavefield u is measured by: (Spectral Fidelity)𝒮(u^,u)=10kmax|Eu^(k)Eu(k)|dk0kmaxEu(k)dk, where E() denotes the radially averaged power spectrum. A perfect match gives 𝒮=1; a model that predicts zero everywhere gives 𝒮=0.

Diffusion models typically achieve spectral fidelity scores of 𝒮>0.95 on Helmholtz benchmarks, compared to 𝒮0.800.85 for FNO and 𝒮0.70 for PINNs with smooth activations (due to spectral bias).

Applications: Acoustics, seismic, and material design

Room acoustics

In architectural acoustics, one must solve the Helmholtz equation at frequencies up to 20kHz (k370m1 in air) inside complex geometries (concert halls, lecture theatres). Neural surrogates trained on parameterised room geometries can evaluate the acoustic field in milliseconds, enabling real-time auralization in virtual reality applications.

Seismic full waveform inversion

The Helmholtz equation is the frequency-domain formulation of the wave equation used in seismic exploration. Generative models serve as fast forward solvers within iterative inversion loops, replacing each expensive Helmholtz solve (which dominates the cost of full waveform inversion) with a neural-network evaluation.

RadioDiff-k: Helmholtz-informed diffusion for radio maps

An innovative application by Lee et al. (2025) combines Helmholtz physics with diffusion models for wireless communication. RadioDiff-k generates radio propagation maps-the received signal strength as a function of position in an urban environment-by conditioning a diffusion model on the environment geometry and transmitter locations, with the Helmholtz equation providing a physics prior.

The model incorporates the wavenumber k (determined by the carrier frequency) as a conditioning variable, allowing a single model to generate radio maps across a range of frequencies (700,MHz to 6,GHz).

Exercise 23 (Helmholtz: From 1D to high frequency).

Consider the 1D Helmholtz equation on [0,1]: u(x)+k2u(x)=0,u(0)=0,u(1)=1.

  1. (a)

    Find the exact solution and verify that it oscillates k/(2π) times on [0,1].

  2. (b)

    Train a PINN (3-layer MLP, 64 units, tanh activation) to solve this problem for k=5, k=20, and k=80. Plot the training loss vs. iteration for each k. How does spectral bias manifest?

  3. (c)

    Repeat with a Fourier feature encoding γ(x)=[sin(2πσ1x),cos(2πσ1x),,sin(2πσmx),cos(2πσmx)], where σj are sampled from 𝒩(0,k2). Does the spectral bias reduce?

The challenge of high-frequency Helmholtz solutions. At low wavenumber (left), a moderate number of grid/collocation points suffices to resolve the solution. At high wavenumber (right), the same grid aliasing the rapid oscillations, requiring vastly more points-or fundamentally different approaches.

Maxwell's Equations and Computational Electromagnetics

“From a long view of the history of mankind, seen from, say, ten thousand years from now, there can be little doubt that the most significant event of the 19th century will be judged as Maxwell's discovery of the laws of electrodynamics.” - Richard Feynman

Maxwell's equations unify electricity, magnetism, and optics into a single theoretical framework. Their numerical solution-known as computational electromagnetics (CEM)-underpins the design of antennas, optical devices, integrated circuits, MRI scanners, and the wireless networks through which you are likely accessing this textbook.

Maxwell's equations: A brief recap

In their differential form, Maxwell's equations in a linear, isotropic medium are:

Definition 41 (Maxwell's equations).

(Faraday)×𝐄=μ𝐇t,(Faraday’s law)×𝐇=ε𝐄t+𝐉,(Ampère’s law)(ε𝐄)=ρ,(Gauss’s law for 𝐄)(μ𝐇)=0,(Gauss’s law for 𝐇) where 𝐄 is the electric field, 𝐇 is the magnetic field, ε(𝐱) is the permittivity, μ(𝐱) is the permeability, 𝐉 is the current density, and ρ is the charge density.

For time-harmonic fields (𝐄(𝐱,t)=𝐄(𝐱)eiωt), Maxwell's equations reduce to the vector Helmholtz equation: (Vector Helmholtz)×(μ1×𝐄)ω2ε𝐄=iω𝐉, connecting the electromagnetic problem to the Helmholtz theory of the previous section.

Remark 24 (From Helmholtz to Maxwell).

For scalar problems in 2D (e.g. TE or TM polarisation), the vector Helmholtz equation reduces to the scalar Helmholtz equation . Thus, all the neural operator and diffusion techniques developed for Helmholtz apply directly to 2D electromagnetics. The full 3D vector problem introduces additional challenges: the curl-curl structure, divergence constraints, and the need to handle material interfaces where ε and μ are discontinuous.

GNOT for Maxwell's equations

The General Neural Operator Transformer (GNOT; Hao et al., 2023) was evaluated on several electromagnetic benchmarks, including the Inductor2D problem: predicting the magnetic field distribution around a 2D cross-section of an inductor coil, given the coil geometry and current distribution.

Example 34 (GNOT on the Inductor2D benchmark).

The Inductor2D benchmark consists of 2D magnetostatic problems (steady Maxwell's equations with no time variation) parameterised by:

  • Coil cross-section geometry (varying number and position of conductors),

  • Current distribution (varying magnitude and direction),

  • Core material permeability μ(𝐱).

GNOT uses heterogeneous attention (different attention heads for different physical quantities) and achieves a relative L2 error of 1.3% on the magnetic flux density 𝐁, compared to 2.1% for FNO and 4.8% for DeepONet. The speedup over finite-element (COMSOL) simulations is approximately 500×.

Diffusion for electromagnetic inverse design

One of the most exciting applications of generative models in electromagnetics is inverse design: given a desired electromagnetic response (e.g. a specific scattering pattern, a prescribed transmission spectrum), generate the physical structure (geometry and material distribution) that achieves it.

This is a classic ill-posed inverse problem: many structures may produce similar electromagnetic responses, and the mapping from response to structure is highly nonlinear. Diffusion models are ideally suited because they naturally handle multi-modality (generating diverse valid designs) and can incorporate physics constraints.

Definition 42 (Metasurface inverse design problem).

A metasurface is a thin, engineered surface composed of sub-wavelength resonators (“meta-atoms”) that manipulate electromagnetic waves. The inverse design problem is: (Metasurface Inverse)Given target response 𝐫m,find 𝐬𝒮 such that (𝐬)𝐫, where 𝐬 is the structural design (a binary or continuous image describing the metasurface geometry), 𝒮 is the set of fabricable designs, and :𝒮m is the (expensive) electromagnetic forward solver.

A conditional diffusion model pϕ(𝐬|𝐫) is trained on paired (design, response) data. At inference, given a desired response 𝐫, the model generates multiple candidate designs, which are then verified with a single forward simulation each (much cheaper than iterative optimisation).

Metasurface inverse design via conditional diffusion. Given a target electromagnetic response, the diffusion model generates multiple diverse candidate structures. Each is verified with a single forward simulation, and the best design is selected. This “generate-then-verify” paradigm is far more efficient than iterative optimisation, which may converge to a single (possibly suboptimal) local minimum.

Example 35 (Diffusion-based metasurface design).

A diffusion model is trained on 50,000 pairs of metasurface geometries (binary 64×64 images) and their simulated transmission spectra (m=200 wavelength points from 400,nm to 800,nm, covering the visible spectrum).

Given a target transmission spectrum (e.g. a narrow bandpass filter centred at 550,nm with 10,nm bandwidth), the model generates 100 candidate designs in 3,seconds. After verification with a finite-difference time-domain (FDTD) solver:

  • The best design achieves a spectral overlap of 97.2% with the target (vs. 92.1% for topology optimisation after 500 iterations, which takes 4,hours).

  • 73 of the 100 designs achieve >90% spectral overlap, demonstrating the diversity and quality of the generated candidates.

  • The designs exhibit a rich variety of geometric motifs (crosses, split rings, spirals), showing that the model has learned the many-to-one nature of the inverse problem.

Physics-aware Maxwell-guided diffusion

A 2026 advance incorporates Maxwell's equations directly into the diffusion process. Rather than training a diffusion model on simulation data and hoping it learns the physics, this approach uses the Maxwell residual as an explicit guidance signal during denoising.

Definition 43 (Maxwell-guided denoising).

At each denoising step, the standard DDPM update is augmented with a physics guidance gradient: (Maxwell Guided)𝐄~t1=𝐄t1DDPMλ𝐄t[×(μ1×𝐄^0|t)ω2ε𝐄^0|tiω𝐉2], where 𝐄^0|t is the Tweedie estimate of the clean field at diffusion time t, and λ controls the strength of the physics guidance.

This approach has two advantages: (i) it improves physical consistency without requiring additional training data, and (ii) it enables zero-shot generalisation to new material configurations (different ε, μ) not seen during training, since the physics guidance automatically adapts.

Applications in photonics, antenna design, and metamaterials

Photonic crystal design

Photonic crystals are periodic dielectric structures that control light propagation. Designing a photonic crystal with a desired band gap requires solving Maxwell's equations for many candidate geometries-a perfect task for generative surrogates. Diffusion models conditioned on the target band structure can generate diverse photonic crystal unit cells in milliseconds.

Antenna design

Modern antenna design (5G MIMO arrays, satellite antennas) involves optimising complex 3D geometries to achieve specified radiation patterns, impedance matching, and bandwidth. Generative models can explore the vast design space more efficiently than gradient-based topology optimisation, especially when multiple competing objectives must be balanced.

Metamaterials

Metamaterials are engineered structures with electromagnetic properties not found in nature (negative refractive index, cloaking, perfect absorption). The design space is combinatorially vast (each meta-atom can have a different geometry), and diffusion models provide a natural way to sample from the space of designs that achieve a target effective property.

Exercise 24 (2D TE-mode Maxwell as scalar Helmholtz).

Consider 2D TE-mode propagation (𝐄=Ez(x,y)z^, 𝐇 in the xy-plane) in a medium with spatially varying permittivity ε(x,y) and constant permeability μ0.

  1. (a)

    Show that Ez satisfies the scalar Helmholtz equation: 2Ez+ω2μ0ε(x,y)Ez=iωμ0Jz.

  2. (b)

    For a circular dielectric cylinder of radius a and permittivity εr in free space, write down the analytical scattering solution in terms of Bessel functions (Mie series).

  3. (c)

    Use the Mie series to generate a dataset of 1,000 solutions for random εr[2,10] and k0a[0.5,5]. Train an FNO on this dataset and evaluate the relative L2 error as a function of k0a. Does the error increase with frequency?

Exercise 25 (Inverse design: Diversity vs. accuracy trade-off).

Consider a conditional diffusion model for metasurface inverse design.

  1. (a)

    Explain why a higher classifier-free guidance scale ω (see Section Diffusion and Score-Based Models for PDE Simulation) tends to reduce the diversity of generated designs while improving their fidelity to the target response.

  2. (b)

    Propose a protocol for choosing ω that balances diversity (exploring the design space) and accuracy (meeting the target specification). Consider the Pareto front of (diversity, accuracy) pairs as ω varies.

  3. (c)

    In practice, fabrication constraints (minimum feature size, connected geometry) further restrict the design space. How could you incorporate these constraints into the diffusion model? (Hint: consider guidance-based approaches or constrained latent spaces.)

Traditional computational electromagnetics (left) starts from a device geometry and computes the EM response via an expensive Maxwell solver-hours per design. The generative approach (right) inverts this: given a target response, a conditional diffusion model generates diverse valid device geometries in seconds.

Conjecture 2 (Universal foundation models for wave equations).

We conjecture that a single, sufficiently large Transformer-based foundation model-pretrained on a diverse corpus of Helmholtz, Maxwell, elastic wave, and acoustic wave simulation data-can serve as a universal surrogate for wave phenomena across physics disciplines. The key architectural requirements are: (i) frequency-aware positional encodings that scale with the local wavenumber, (ii) material-property conditioning via cross-attention, and (iii) resolution-invariant tokenisation that handles both coarse far-field regions and fine near-field structures. Such a model would unify the currently fragmented landscape of wave-equation surrogates into a single pre-trained backbone.

Exercise 26 (Green's function and neural operators for Maxwell).

The free-space Green's function for the 3D scalar Helmholtz equation is G0(𝐱,𝐱)=eik|𝐱𝐱|4π|𝐱𝐱|.

  1. (a)

    Verify that G0 satisfies (2+k2)G0(𝐱,𝐱)=δ(𝐱𝐱).

  2. (b)

    The solution to the Helmholtz equation with source f is u(𝐱)=ΩG0(𝐱,𝐱)f(𝐱)d𝐱. This integral operator has exactly the structure of a DeepONet (branch network processes f, trunk network processes 𝐱). Write down the DeepONet approximation explicitly and discuss what the branch and trunk networks must learn.

  3. (c)

    For the dyadic Green's function of Maxwell's equations, G(𝐱,𝐱), discuss the additional challenges posed by the tensor structure and the divergence-free constraint.

Stefan Problem and Moving Boundaries

When ice melts in a glass of water, the boundary between solid and liquid is not fixed-it moves, and its position is itself an unknown of the problem. This deceptively simple observation underlies one of the oldest and most challenging classes of PDE problems: the Stefan problem and its many generalisations.

The classic Stefan problem

Consider a one-dimensional slab of material occupying [0,L] that undergoes a phase transition (e.g., ice melting into water). Let s(t) denote the position of the phase boundary at time t. In the liquid region 0<x<s(t) the temperature u(x,t) satisfies the heat equation, and in the solid region s(t)<x<L the temperature v(x,t) satisfies a (possibly different) heat equation: (Liquid)ut=α2ux2,0<x<s(t),vt=αs2vx2,s(t)<x<L, where α and αs are the thermal diffusivities of the liquid and solid phases, respectively.

At the interface x=s(t), the temperature equals the melting point Tm: (Melting)u(s(t),t)=v(s(t),t)=Tm. The crucial ingredient is the Stefan condition, which links the interface velocity to the jump in heat flux:

Definition 44 (Stefan condition).

The velocity of the moving interface s(t) is determined by the energy balance at the phase boundary: (Condition)ρdsdt=kux|x=s(t)ksvx|x=s(t)+, where ρ is the density, is the latent heat of fusion, and k, ks are the thermal conductivities of the liquid and solid phases.

The Stefan condition says that any imbalance in heat flux at the interface must go into moving the boundary-absorbing latent heat as ice melts, or releasing it as water freezes. This is an elegant expression of energy conservation, but it makes the mathematical problem nonlinear: the domain on which we solve the PDE is itself determined by the solution.

The classical Stefan problem. The liquid (blue) and solid (red) phases are separated by a moving interface at x=s(t) (green dashed line). The temperature profile satisfies the heat equation in each phase, with the interface velocity determined by the jump in heat flux (Stefan condition). The interface moves rightward as the solid melts.

Remark 25.

The Stefan problem is named after Jozef Stefan, who studied it in 1889 in the context of ice formation in the polar seas. Remarkably, exact solutions exist only for semi-infinite domains with special self-similar initial data (the Neumann solution), where the interface position grows as s(t)=2λαt with λ determined by a transcendental equation. For general geometries and initial data, one must resort to numerical methods.

Why moving boundaries are hard for neural methods

Moving boundary problems present a triple challenge for neural PDE solvers:

  1. Domain geometry is solution-dependent. In standard PINN or neural operator approaches, the domain Ω is fixed. For a Stefan problem, the domain changes at every time step, and the domain boundary is itself an unknown. A neural network that takes (x,t) as input has no built-in mechanism to “know” that x lies in the liquid phase for x<s(t) and in the solid phase for x>s(t).

  2. Discontinuous gradients at the interface. The temperature is continuous across the interface (it equals Tm on both sides), but its gradient may be discontinuous-indeed, the difference in gradients is what drives the interface motion. Standard MLPs with smooth activations produce smooth outputs and struggle to represent gradient discontinuities sharply.

  3. Implicit coupling. The Stefan condition couples the PDE solution to the interface evolution in a nonlinear, implicit fashion. Enforcing this condition as a soft penalty in a loss function leads to a delicate balance between PDE residual accuracy and interface tracking accuracy.

Caution.

Naïve PINN training on Stefan problems often fails. If the interface position s(t) is treated as a free parameter and optimised jointly with the network weights, the optimisation landscape becomes highly non-convex. The loss function develops “ravines” where the interface is approximately correct but the temperature profile is wrong, or vice versa. Curriculum strategies that gradually extend the time horizon, or front-fixing transformations that map the moving boundary to a fixed domain, can significantly improve convergence.

Physics-Informed Distillation of Diffusion Models (PIDDM)

A fundamental tension arises when we attempt to enforce PDE constraints within a diffusion model. Recall that a trained diffusion model learns the conditional expectation 𝔼[𝐱0|𝐱t] through its denoiser. But for a nonlinear PDE operator 𝒩, enforcing the physics on this conditional mean is not the same as enforcing it on individual samples: (Jensen)𝒩[𝔼[𝐱0|𝐱t]]𝔼[𝒩[𝐱0]|𝐱t], by Jensen's inequality (applied to the convex/concave parts of 𝒩). This discrepancy is called the Jensen's gap, and it means that a physics-informed diffusion model may produce samples whose mean satisfies the PDE while individual samples do not.

Key Idea.

The Jensen's Gap in Physics-Informed Diffusion When a PDE operator 𝒩 is nonlinear, the physics loss 𝒩[𝐱^0]2 evaluated on the denoiser's output 𝐱^0=𝔼[𝐱0|𝐱t] does not guarantee that individual samples satisfy the PDE. This is because the denoiser output is a conditional average, and nonlinear operators do not commute with averaging. The discrepancy grows with the nonlinearity of 𝒩 and the variance of p(𝐱0|𝐱t).

Post-hoc distillation to close the gap

The Physics-Informed Distillation of Diffusion Models (PIDDM) approach addresses the Jensen's gap through a two-stage strategy:

  1. Stage 1: Train a standard diffusion model. A conditional diffusion model is trained on paired data (θi,ui) where θi are PDE parameters (initial conditions, coefficients) and ui are solution fields obtained from a numerical solver. This produces a teacher model that can generate diverse, data-consistent solution fields.

  2. Stage 2: Distil into a single-step student. A deterministic student network Gψ(θ,𝐳) (where 𝐳𝒩(0,I)) is trained to match the teacher's output distribution while simultaneously satisfying the PDE constraints on individual samples: (LOSS)PIDDM(ψ)=distill(ψ)match teacher+λphysPDE(ψ)physics on samples, where the physics loss is evaluated on the student's actual outputs u^=Gψ(θ,𝐳): (Physics)PDE(ψ)=𝔼θ,𝐳[𝒩[Gψ(θ,𝐳)]2].

Because the student generates samples in a single forward pass (no iterative denoising), we can compute PDE residuals directly on each generated sample, completely avoiding the Jensen's gap.

Proposition 19 (Jensen's gap elimination via distillation).

Let Gψ be a deterministic generator producing samples u^=Gψ(θ,𝐳). For any (possibly nonlinear) differential operator 𝒩, the physics loss PDE(ψ)=𝔼𝐳[𝒩[Gψ(θ,𝐳)]2] is zero if and only if 𝒩[u^]=0 almost surely. In particular, there is no gap between the expected PDE residual and the residual of individual samples.

Proof.

Since 𝒩[u^]20 for every sample, the expectation vanishes if and only if 𝒩[u^]2=0 almost surely, which is equivalent to 𝒩[u^]=0 a.s. No Jensen-type inequality is involved because the loss is evaluated sample-by-sample, not on the conditional mean.

Application to the Generalised Porous Medium Equation

The Generalised Porous Medium Equation (GPME) provides an excellent test bed for PIDDM because it exhibits moving fronts (compactly supported solutions with sharp interfaces) that require accurate tracking: (GPME)ut=(mum1u),m>1. For m=1 this reduces to the heat equation; for m>1 the diffusion is degenerate (vanishing where u=0), producing solutions with compact support whose boundaries move at finite speed. The case m=2 arises in modelling gas flow through porous media, while m=3 appears in thin-film equations.

Example 36 (PIDDM on the Barenblatt solution).

The Barenblatt–Pattle solution provides an exact benchmark for the GPME\@. In one spatial dimension, it reads: u(x,t)=tα(Cα(m1)2mx2t2α/d)+1/(m1), where α=(d+d/(m1)+2)1, d is the spatial dimension, C is determined by mass conservation, and (z)+=max(z,0). PIDDM trained on a family of initial conditions with varying m[2,5] achieves relative L2 errors below 0.5% on the moving front position, significantly outperforming both standard PINNs (which struggle with the degeneracy at u=0) and unconstrainted diffusion models (which produce physically inconsistent fronts).

Exercise 27 (Deriving the Stefan condition from energy balance).

Consider a thin control volume [s(t)ϵ,s(t)+ϵ] centred on the moving interface.

  1. (a)

    Write the integral form of energy conservation for this control volume, accounting for the latent heat released or absorbed as the interface moves through the material.

  2. (b)

    Take the limit ϵ0, using the fact that the temperature is continuous at x=s(t) but the heat flux may be discontinuous, to derive the Stefan condition .

  3. (c)

    Explain why the Stefan condition implies that the interface velocity s˙(t) is proportional to the jump in temperature gradient, and discuss the physical interpretation when s˙>0 (melting) versus s˙<0 (solidification).

Exercise 28 (Jensen's gap quantification).

Consider the one-dimensional Burgers equation tu+uxu=νxxu. Suppose p(u|xt) is Gaussian with mean μ(x,t) and variance σ2(x,t).

  1. (a)

    Show that the nonlinear advection term introduces a Jensen's gap: 𝔼[uxu]=μxμ+σxσ.

  2. (b)

    Estimate the relative magnitude of the gap term σxσ compared to the mean-field term μxμ for a typical diffusion model at noise level t=0.5.

  3. (c)

    Argue that the gap vanishes as t0 (low noise) and discuss the implications for the number of denoising steps versus physical accuracy.

Cahn–Hilliard and Allen–Cahn: Phase-Field Dynamics

The Stefan problem of the previous section tracks a sharp interface between phases. An alternative approach, enormously influential in materials science and increasingly in machine learning, replaces the sharp interface with a diffuse interface-a thin transition layer of width ϵ across which the order parameter varies smoothly from one phase to the other. This is the realm of phase-field models.

The Allen–Cahn equation

The Allen–Cahn equation describes the evolution of a non-conserved order parameter u(𝐱,t)[1,+1], where u=+1 represents one phase and u=1 the other: (AC)ut=ϵ22uF(u), where ϵ>0 is the interfacial width parameter and F(u)=14(u21)2 is the standard double-well potential with minima at u=±1.

Definition 45 (Free energy functional).

The Ginzburg–Landau free energy associated with the Allen–Cahn equation is: (Freeenergy)[u]=Ω[ϵ22|u|2+F(u)]d𝐱. The Allen–Cahn equation is the L2-gradient flow of this energy: tu=δ/δu. Consequently, the free energy is a Lyapunov functional: d/dt0 along solutions.

The two terms in the free energy compete: the gradient term ϵ22|u|2 penalises rapid spatial variation (favouring smooth, broad interfaces), while the double-well potential F(u) penalises values away from ±1 (favouring sharp phase separation). The balance between these two tendencies produces interfaces of characteristic width ϵ.

Remark 26.

The Allen–Cahn equation is a reaction-diffusion PDE\@. The diffusion term ϵ22u smooths the order parameter, while the reaction term F(u)=uu3 drives it towards the pure phases u=±1. In the limit ϵ0, solutions of the Allen–Cahn equation converge to motion by mean curvature of the interface-a deep connection between phase-field models and geometric evolution equations.

The Cahn–Hilliard equation

When the total amount of each phase must be conserved (as in a binary alloy or a polymer blend), the Allen–Cahn equation is inadequate because it does not preserve Ωud𝐱. The Cahn–Hilliard equation enforces conservation by making the dynamics a conserved gradient flow: (CH)ut=(M(F(u)ϵ22u)), where M>0 is the mobility. The quantity in parentheses, (Chempot)μ=F(u)ϵ22u=δδu, is the chemical potential, and the Cahn–Hilliard equation can be written compactly as tu=(Mμ).

Theorem 23 (Mass conservation and energy dissipation).

Solutions of the Cahn–Hilliard equation with no-flux boundary conditions μ𝐧=0 on Ω satisfy:

  1. Mass conservation: ddtΩud𝐱=0.

  2. Energy dissipation: ddt=ΩM|μ|2d𝐱0.

Proof.

For mass conservation, integrate over Ω and apply the divergence theorem: ddtΩud𝐱=Ω(Mμ)d𝐱=ΩMμ𝐧dS=0.

For energy dissipation, compute: ddt=Ωδδuutd𝐱=Ωμ(Mμ)d𝐱=ΩM|μ|2d𝐱 after integration by parts and the no-flux boundary condition.

Spinodal decomposition

The Cahn–Hilliard equation produces one of the most visually striking phenomena in materials science: spinodal decomposition. Starting from a nearly homogeneous mixture (e.g., u(𝐱,0)=u+η(𝐱) where η is small random noise and |u|<1/3 lies in the spinodal region where F(u)<0), the system is linearly unstable: small perturbations grow exponentially.

Proposition 20 (Linear instability in the spinodal region).

Linearising the Cahn–Hilliard equation about a uniform state u with F(u)<0, a Fourier mode with wavenumber k grows as eσ(k)t where (Growth)σ(k)=Mk2(F(u)+ϵ2k2). This is positive for 0<k<kc=F(u)/ϵ, with maximum growth at kmax=kc/2.

The result is a cascade of phase separation: the mixture rapidly demixes into a labyrinthine pattern of domains rich in one component or the other, connected by thin interfaces. Over long times, these domains coarsen via the Lifshitz–Slyozov mechanism (larger domains grow at the expense of smaller ones), with the characteristic domain size growing as (t)t1/3.

Spinodal decomposition in the Cahn–Hilliard equation. Left: a nearly homogeneous initial condition with small random perturbations. Centre: early-stage spinodal decomposition produces fine-scale phase separation with a characteristic wavelength set by kmax. Right: late-stage coarsening produces large domains separated by thin interfaces, with domain size growing as (t)t1/3.

Why fourth-order derivatives kill PINNs

The Cahn–Hilliard equation is fourth-order in space: expanding the divergence term reveals 4u (the biharmonic operator). This creates severe difficulties for physics-informed approaches:

  1. Gradient accumulation. Computing 4uϕ via automatic differentiation requires four nested applications of the chain rule. Each pass through the network multiplies the computational graph, and the memory cost scales roughly as 𝒪(4depthwidth) for the backward pass. For a network with L layers of width W, this translates to a per-collocation-point cost of 𝒪(L4W) in the worst case.

  2. Numerical ill-conditioning. Fourth-order derivatives amplify high-frequency noise in the network output. Small oscillations of amplitude δ at wavenumber k produce fourth-derivative residuals of order δk4, leading to loss-function values dominated by numerical artefacts rather than genuine PDE violation.

  3. Loss landscape pathology. The ratio between the PDE residual scale (involving 4) and the boundary/initial condition scale creates extreme ill-conditioning in the loss landscape, making gradient descent ineffective without careful normalisation.

Insight.

Mixed formulations as a rescue strategy. One can reduce the Cahn–Hilliard equation to a system of two second-order equations by introducing the chemical potential μ=F(u)ϵ22u as an auxiliary variable: ut=(Mμ),μ=F(u)ϵ22u. A PINN that predicts both u and μ simultaneously needs only second-order derivatives, dramatically improving trainability. This is the neural analogue of the mixed finite element formulation used in classical numerics.

PINTO: Physics-Informed Neural Transformer Operator

Standard neural operators such as FNO and DeepONet learn the solution operator from data alone, without explicit PDE constraints. For phase-field equations, where the physics imposes strict conservation laws and energy dissipation, purely data-driven operators can produce solutions that violate these fundamental properties.

The Physics-Informed Neural Transformer Operator (PINTO) addresses this by combining the expressiveness of Transformers with physics-informed training.

Architecture

PINTO uses an encoder-decoder architecture where the key innovation is the use of cross-attention integral kernels to approximate the integral transforms that appear in operator learning:

Definition 46 (Cross-attention integral kernel).

Given an input function a(𝐱) discretised at query points {𝐱j}j=1Nq and key points {𝐲i}i=1Nk, the cross-attention integral kernel computes: (Crossattn)(𝒦a)(𝐱j)=i=1Nkexp(Q(𝐱j)K(𝐲i)/d)iexp(Q(𝐱j)K(𝐲i)/d)V(a(𝐲i)), where Q, K, V are learnable linear projections. This approximates a general integral operator κ(𝐱,𝐲)a(𝐲)d𝐲 with a data-dependent kernel determined by the attention weights.

PINTO architecture. An encoder processes the input field through self-attention layers, producing keys and values. A decoder attends to these via cross-attention integral kernels to produce the output field at query positions. The model is trained with a combined data loss and physics-informed PDE residual loss, enabling generalisation to unseen initial conditions while respecting the governing equations.

Generalisation across initial conditions

A key advantage of PINTO over single-instance PINNs is amortised inference: once trained, the model maps any initial condition to the solution at a future time without re-training. For the Cahn–Hilliard equation, this means a single PINTO model can predict spinodal decomposition patterns starting from different compositions u, different noise realisations, and even different domain sizes (if position encoding is appropriately designed).

Example 37 (PINTO for Cahn–Hilliard dynamics).

Training PINTO on 500 Cahn–Hilliard trajectories with random initial compositions u[0.3,0.3] on a 128×128 grid, the model achieves:

  • Relative L2 error of 1.2% on unseen initial conditions, compared to 3.8% for a standard FNO with the same parameter count.

  • Mass conservation violation |(u^u0)dx|<104, compared to 102 for unconstrained neural operators.

  • Correct prediction of the coarsening exponent (t)t1/3 over 10× the training time horizon, demonstrating physically consistent extrapolation.

Cahn–Hilliard for image inpainting

In a beautiful example of physics inspiring computer vision, the Cahn–Hilliard equation has been applied to image inpainting: the task of filling in missing or corrupted regions of an image.

The key insight is that image pixels, when viewed as a field u(𝐱), can undergo “phase separation” that propagates structure from known regions into unknown ones. A wavelet decomposition separates the image into scale-specific components, and Cahn–Hilliard dynamics applied to each wavelet sub-band propagates texture information from the boundary of the missing region inward, respecting the natural scale hierarchy of the image.

Example 38 (CH-based image inpainting pipeline).

Given an image I(𝐱) with a missing region Ωmiss:

  1. Decompose I into wavelet sub-bands: I=jWj.

  2. For each sub-band Wj, initialise the Cahn–Hilliard equation on Ωmiss with boundary data from Wj|Ωmiss.

  3. Evolve to steady state: the chemical potential diffusion “fills in” the missing region while the double-well potential maintains the contrast structure.

  4. Reconstruct: I^=jW^j.

This approach produces sharp edges (maintained by the double-well potential) and smooth textures (propagated by the diffusion term), which is precisely what human visual perception expects. While modern deep learning methods (diffusion-based inpainters) significantly outperform this approach in practice, the physics-based perspective offers interpretability and guaranteed stability.

Exercise 29 (Implementing Allen–Cahn with a PINN).

Consider the Allen–Cahn equation on Ω=[1,1]2 with periodic boundary conditions and ϵ=0.05.

  1. (a)

    Design a PINN loss function that includes the PDE residual, periodic boundary terms, and initial condition. Discuss whether the energy dissipation property d/dt0 should be added as an additional constraint.

  2. (b)

    Implement the PINN in your framework of choice (PyTorch or JAX). Use the initial condition u0(𝐱)=tanh((0.3|𝐱|)/(2ϵ)) (a circular interface of radius 0.3).

  3. (c)

    Train the PINN and visualise the evolution. The interface should shrink and eventually collapse to a point. Measure the interface velocity and compare with the theoretical prediction v=κ (velocity equals minus curvature).

  4. (d)

    Now try ϵ=0.01. What goes wrong? Propose and test a mitigation strategy (Fourier feature embeddings, adaptive weighting, or the mixed formulation from the insight box above).

Schrödinger Equation and Quantum PDEs

We now venture into perhaps the most consequential application of generative models to PDEs: solving the quantum many-body Schrödinger equation. The stakes are enormous-an accurate, scalable quantum solver would revolutionise chemistry, materials science, and drug design. The difficulty is equally enormous: the curse of dimensionality is at its most severe in quantum mechanics, where the wavefunction of N electrons lives in a 3N-dimensional space.

The time-independent Schrödinger equation

For a system of N electrons in a fixed external potential (the Born–Oppenheimer approximation), the time-independent electronic Schrödinger equation reads: (TISE)H^Ψ(𝐫1,,𝐫N)=EΨ(𝐫1,,𝐫N), where 𝐫i3 is the position of the i-th electron (we suppress spin for now), E is the total electronic energy, and the Hamiltonian is: (Hamiltonian)H^=12i=1Ni2+i=1NVext(𝐫i)+i<j1|𝐫i𝐫j|. The three terms represent kinetic energy, electron-nuclear attraction, and electron-electron repulsion, respectively. We use atomic units (=me=e=1).

Definition 47 (Ground-state energy).

The ground-state energy is the minimum eigenvalue of H^: (Variational)E0=minΨΨ|H^|ΨΨ|Ψ=minΨΨH^Ψd𝐫N|Ψ|2d𝐫N, where the minimum is over all antisymmetric wavefunctions ΨAS (see below). The corresponding minimiser is the ground-state wavefunction Ψ0.

The curse of dimensionality in Hilbert space

The wavefunction Ψ(𝐫1,,𝐫N) is a function of 3N continuous variables. For a modestly sized molecule with N=50 electrons, this is a function in 150 dimensions. If we discretise each dimension with G grid points, storing the wavefunction requires G3N numbers-a quantity that exceeds the number of atoms in the observable universe for G=10 and N30.

Key Idea.

Why Neural Wavefunctions? Traditional quantum chemistry methods (configuration interaction, coupled cluster) represent Ψ in a basis of Slater determinants, whose number grows combinatorially with N. Neural networks offer a radically different representation: Ψθ(𝐫1,,𝐫N) is parametrised by a fixed number of parameters θ, regardless of the number of grid points. The network learns to allocate its representational capacity where the wavefunction has significant amplitude, implicitly performing a form of adaptive compression. This circumvents the exponential scaling of traditional basis sets-at the cost of the variational optimisation being non-convex.

Antisymmetry and Slater determinants

Electrons are fermions, and the Pauli exclusion principle demands that the wavefunction be antisymmetric under exchange of any two electrons (including their spin): (Antisym)Ψ(,𝐫i,σi,,𝐫j,σj,)=Ψ(,𝐫j,σj,,𝐫i,σi,), where σi{,} denotes spin. This constraint is non-negotiable: any ansatz for Ψ that does not satisfy will produce unphysical results.

The simplest antisymmetric ansatz is the Slater determinant: (Slater)ΨSD(𝐫1,,𝐫N)=1N!|ϕ1(𝐫1)ϕ1(𝐫2)ϕ1(𝐫N)ϕ2(𝐫1)ϕ2(𝐫2)ϕ2(𝐫N)ϕN(𝐫1)ϕN(𝐫2)ϕN(𝐫N)|, where {ϕi} are single-particle orbitals. The determinant structure automatically ensures antisymmetry (swapping two columns changes the sign), but a single Slater determinant captures only mean-field (Hartree–Fock) physics, missing the crucial electron correlation that determines chemical bonding, reaction barriers, and materials properties.

Remark 27.

The exact ground-state wavefunction can always be expanded as a (possibly infinite) linear combination of Slater determinants-this is the basis of Full Configuration Interaction (Full CI). But the number of determinants grows combinatorially: for N electrons in K orbitals, there are (KN) determinants. For a realistic basis set with K=100 and N=20, this exceeds 1020. Neural wavefunctions can be viewed as a compact, nonlinear parametrisation of this exponentially large space.

FermiNet and PauliNet: pioneering neural wavefunctions

Two landmark architectures showed that neural networks could achieve near-exact accuracy for the electronic Schrödinger equation:

FermiNet (Pfau et al., 2020) parametrises Ψ as a sum of D generalised Slater determinants: (Ferminet)Ψθ(𝐫1,,𝐫N)=d=1Dwddet[ϕi(d)(𝐫j;{𝐫k}kj)]i,j=1N, where each orbital ϕi(d) depends not only on the position 𝐫j of its assigned electron but also on the positions of all other electrons {𝐫k}kj. This “backflow” dependence is the key innovation: it allows each orbital to adapt to the instantaneous configuration of the other electrons, capturing correlation effects far beyond Hartree–Fock.

PauliNet (Hermann, Schätzle, and Noé, 2020) takes a complementary approach, building on top of traditional quantum chemistry by starting from Hartree–Fock orbitals and adding neural correlation factors: Ψθ=ΨHFeJθdet[ϕiHF(𝐫j)+fijθ(𝐫j,{𝐫k})], where Jθ is a neural Jastrow factor and fijθ are learned backflow corrections. By starting from the Hartree–Fock solution, PauliNet incorporates physical knowledge (cusp conditions, asymptotic decay) from the outset.

Schematic of the FermiNet architecture for N=4 electrons. Electron positions are processed through permutation-equivariant interaction layers that build configuration-dependent orbitals ϕi(d). These are assembled into generalised Slater determinants, ensuring antisymmetry, and summed with learnable weights to produce the wavefunction Ψθ.

QiankunNet: Transformers for many-electron systems

While FermiNet and PauliNet demonstrated the viability of neural wavefunctions, they relied on hand-designed equivariant architectures with limited scalability. QiankunNet (Zhao et al., Nature Communications, 2025) introduces a Transformer-based architecture that scales to much larger systems, achieving chemical accuracy for challenging transition-metal complexes.

Architecture overview

The name “Qiankun” (meaning “universe” in Chinese) reflects the ambition to capture universal quantum correlations through attention mechanisms. The architecture consists of three key components:

  1. Configuration-dependent orbitals via attention. Each electron i attends to all other electrons and all nuclei through multi-head self-attention: (ATTN)hi(+1)=hi()+MHA(hi(),{hj()}j=1N,{RA}A=1M), where {RA} are nuclear positions and MHA denotes multi-head attention. The attention heads implement backflow correlations: each electron's representation is modulated by the positions of all other electrons, analogous to backflow transformations in quantum Monte Carlo.

  2. Batched autoregressive sampling. To evaluate the variational energy by Monte Carlo integration, one needs to sample electron configurations (𝐫1,,𝐫N)|Ψθ|2. QiankunNet uses a batched autoregressive approach: electrons are sampled sequentially, with each electron's proposal distribution conditioned on the positions of all previously sampled electrons. Batching across multiple configurations enables efficient GPU utilisation.

  3. Generalised determinantal structure. The final wavefunction takes the form: (PSI)Ψθ(𝐫1,,𝐫N)=d=1Dwd({𝐫})det[ϕ~i(d)(𝐫j;hj(L))]i,j, where ϕ~i(d) are orbitals constructed from the final-layer Transformer embeddings hj(L), and even the determinant weights wd are configuration-dependent.

QiankunNet architecture. Electron and nuclear positions are embedded and processed through L Transformer blocks with self-attention implementing backflow correlations. The final embeddings are used to construct configuration-dependent orbitals assembled into a weighted sum of Slater determinants.

Achieving chemical accuracy

Chemical accuracy-defined as an error of at most 1 kcal/mol (1.6×103 Hartree) relative to experiment-is the gold standard in quantum chemistry. QiankunNet achieves or approaches this threshold on systems that are extremely challenging for traditional methods:

Example 39 (Iron–sulfur clusters and the Fenton reaction).

Iron–sulfur clusters ([Fe2S2], [Fe4S4]) are ubiquitous in biology (electron transfer chains, nitrogen fixation) and notoriously difficult for computational methods due to their multi-reference character and large active spaces. QiankunNet achieves:

  • Total energy errors within 2 mHa (1.3 kcal/mol) of experimental estimates for [Fe2S2] with 30 correlated electrons.

  • Correct spin-state ordering for the Fenton reaction (Fe2+ + H2O2 Fe3+ + OH + OH), where density functional theory (DFT) methods disagree on the ground-state spin.

  • Scaling to 58 correlated electrons with 180 active orbitals, far beyond the reach of exact diagonalisation methods.

Hellmann–Feynman forces without Pulay terms

A remarkable practical advantage of neural wavefunctions is that molecular forces (derivatives of the energy with respect to nuclear positions) simplify dramatically. The Hellmann–Feynman theorem states:

Theorem 24 (Hellmann–Feynman theorem).

If Ψθ is an exact eigenstate of H^(𝐑) (parametrically dependent on nuclear positions 𝐑), then (Hellmann)ERA=Ψθ|H^RA|Ψθ. In particular, derivatives of the wavefunction parameters θ with respect to RA do not appear.

For approximate wavefunctions (such as those from Hartree–Fock or truncated CI), the theorem does not hold exactly, and additional “Pulay force” terms arising from the basis set dependence on nuclear positions must be computed. For neural wavefunctions, however, the basis set is the neural network itself, which depends on nuclear positions only through the input features. When the variational energy is well-converged, the Pulay terms become negligible, and forces can be computed cheaply from the Hellmann–Feynman expression alone.

Flow matching for ground-state sampling

An emerging approach replaces Variational Monte Carlo (VMC) with flow matching for sampling the ground-state distribution |Ψ0|2. The idea is elegant: learn a continuous normalising flow that transforms a simple base distribution (e.g., independent Gaussians centred on nuclei) into the target distribution |Ψθ|2: (FLOW)d𝐫dt=vϕ(𝐫,t),𝐫(0)pbase,𝐫(1)|Ψθ|2.

The flow matching loss is: (Flowloss)FM(ϕ)=𝔼t,𝐫0,𝐫1[vϕ(𝐫t,t)(𝐫1𝐫0)2], where 𝐫t=(1t)𝐫0+t𝐫1 is the linear interpolation. Importantly, the flow must be equivariant under electron permutations to respect the fermionic symmetry.

Insight.

Flow matching decouples wavefunction optimisation from sampling. In traditional VMC, the same wavefunction Ψθ is used both as the variational ansatz and (via |Ψθ|2) as the sampling distribution. This coupling creates a chicken-and-egg problem: to optimise Ψθ you need samples from |Ψθ|2, but sampling well requires an already-good Ψθ. Flow matching breaks this cycle by using a separate, trainable sampler vϕ, which can be optimised independently and reused across different wavefunction updates.

Historical Note.

From Hartree–Fock to neural quantum states: a century of approximations. The quest to solve the electronic Schrödinger equation has driven some of the most important developments in computational science. Douglas Hartree proposed the self-consistent field method in 1928, and Vladimir Fock added the antisymmetry requirement in 1930, yielding Hartree–Fock theory. Christian M ller and Milton Plesset introduced perturbation theory in 1934. Jirí Cízek developed coupled cluster theory in 1966. Walter Kohn and Lu Sham reformulated the problem via density functional theory in 1965, earning Kohn the 1998 Nobel Prize. Each advance traded accuracy for tractability. The neural wavefunction approach, beginning with Carleo and Troyer's Restricted Boltzmann Machine ansatz (2017) and maturing with FermiNet (2020) and QiankunNet (2025), represents a fundamentally new paradigm: using the universal approximation power of neural networks to bypass the exponential scaling of traditional basis sets, while maintaining the variational principle as the optimisation objective.

Exercise 30 (Variational Monte Carlo for the helium atom).

The helium atom has N=2 electrons and Hamiltonian: H^=121212222r12r2+1r12, where ri=|𝐫i| and r12=|𝐫1𝐫2|.

  1. (a)

    Show that the simple product ansatz Ψ(𝐫1,𝐫2)=eα(r1+r2) (ignoring antisymmetry for the spatial part, which is symmetric when combined with a singlet spin function) gives a variational energy E(α)=α2278α. Minimise over α and compare with the exact ground-state energy E0=2.9037 Ha.

  2. (b)

    Add a Jastrow factor: Ψ=eα(r1+r2)+βr12. Derive the local energy EL=Ψ1H^Ψ and show that it depends on 𝐫1, 𝐫2 (not just r1, r2, r12).

  3. (c)

    Implement VMC: sample (𝐫1,𝐫2)|Ψ|2 using Metropolis–Hastings, estimate E=EL, and optimise (α,β) to minimise E. What accuracy do you achieve compared to the exact E0?

Coupled and Multiphysics PDE Systems

Real-world engineering systems rarely involve a single PDE\@. An aircraft wing experiences aerodynamic forces (Navier–Stokes), which deform the structure (elasticity), which changes the aerodynamic forces, which further deform the structure-a fully coupled fluid–structure interaction problem. A nuclear reactor core involves neutron transport, heat conduction, coolant flow, and structural mechanics, all coupled through temperature-dependent cross sections and thermal expansion. A battery cell involves electrochemistry, ion transport, heat generation, and mechanical stress from lithium intercalation.

The coupling challenge

Multiphysics systems are difficult for three fundamental reasons:

  1. Scale separation. Different physics operate on vastly different spatial and temporal scales. In a turbine blade, the fluid boundary layer has thickness 0.1 mm and fluctuates on microsecond timescales, while the structural vibration has a wavelength of 10 cm and a period of 1 ms. A single mesh or time step that resolves both is prohibitively expensive.

  2. Stiffness. The coupling between physics often introduces stiff dynamics: some modes decay much faster than others. In thermoelasticity, thermal diffusion (105 m2/s) is much slower than elastic wave propagation (103 m/s), leading to a stiffness ratio of 108 in the governing system of ODEs.

  3. Interface conditions. At the boundary between different physics domains (e.g., the fluid–solid interface in an FSI problem), compatibility conditions must be satisfied: continuity of displacement, traction balance, heat flux continuity. These conditions couple the sub-problems and must be enforced to high accuracy; even small violations can lead to instabilities or unphysical energy generation.

Caution.

Monolithic vs. partitioned coupling. In classical numerics, multiphysics systems are solved either monolithically (assembling a single large system for all physics simultaneously) or partitioned (solving each physics separately and exchanging boundary data iteratively). Monolithic approaches are robust but memory-intensive; partitioned approaches are modular but can suffer from convergence issues (the “added mass” instability in FSI is a notorious example). Neural approaches face the same fundamental trade-off: training a single model for all physics (expensive, but naturally captures coupling) versus composing separately trained models (modular, but coupling must be enforced at inference).

MultiSimDiff: Compositional Generative Multiphysics

MultiSimDiff (Wei et al., ICML 2025) introduces a beautifully modular approach to multiphysics simulation using the framework of compositional diffusion models.

Core idea: composing energy functions

The key insight is that in diffusion models, the score function 𝐱logp(𝐱) can be decomposed as a sum of contributions from independent factors:

Proposition 21 (Score composition).

If the joint distribution factorises as p(𝐱)k=1Kpk(𝐱) (up to a normalisation constant), then: (Composition)𝐱logp(𝐱)=k=1K𝐱logpk(𝐱). Equivalently, in the energy-based interpretation where pk(𝐱)eEk(𝐱), the composite energy is simply: (Energy)E(𝐱)=k=1KEk(𝐱).

MultiSimDiff exploits this by training a separate diffusion model (equivalently, a separate score function or energy function) for each physics discipline, and composing them at inference time to generate solutions to the coupled system.

Training on decoupled data

The training procedure is strikingly simple:

  1. For each physics k (e.g., neutron transport, thermal hydraulics), independently generate training data by running the corresponding single-physics solver.

  2. Train a conditional diffusion model ϵθk for each physics, conditioned on the relevant boundary conditions and parameters.

  3. At inference, compose the score functions: (Composed)ϵcoupled(𝐱t,t)=k=1Kϵθk(𝐱t,t).

The remarkable aspect is that no coupled simulation data is needed during training. Each model is trained independently on single-physics data, and the coupling emerges purely from the compositional structure of diffusion models at inference time.

Key Idea.

Train Separately, Infer Together MultiSimDiff leverages the compositionality of score functions to solve coupled multiphysics problems without ever generating expensive coupled training data. Each physics is learned independently, and the coupling is “free” at inference time. This has a profound practical implication: if you later add a new physics (e.g., structural mechanics to a thermal-hydraulic model), you only need to train one new model, not regenerate the entire coupled dataset.

MultiSimDiff: compositional multiphysics generation. During training, separate diffusion models are trained independently on single-physics data (no coupling needed). At inference, the score functions are composed by summation to generate solutions to the coupled system. New physics can be added by training a single additional model, without retraining existing ones.

Nuclear thermal coupling: results

MultiSimDiff was demonstrated on a nuclear reactor thermal coupling problem involving neutron diffusion coupled with heat conduction in a prismatic fuel element with up to 64 material components.

Example 40 (64-component prismatic fuel element).

The benchmark involves:

  • Neutron transport: A multi-group diffusion equation for the neutron flux ϕg(𝐱) in energy groups g=1,,G, with temperature-dependent cross sections Σg(T).

  • Heat conduction: Steady-state heat equation (k(T)T)=q(ϕ) where the volumetric heat source q depends on the neutron flux.

  • Coupling: The neutron cross sections depend on temperature (Σg as T due to Doppler broadening), and the heat source depends on the neutron flux. This creates a nonlinear feedback loop.

MultiSimDiff achieves a 40.3% reduction in mean relative error compared to independently trained single-physics models, demonstrating that the compositional approach successfully captures the thermal-neutronic coupling without any coupled training data. The largest test case involves 64 distinct material regions with different thermal and neutronic properties-a complexity level that would require millions of coupled simulations to adequately cover with a jointly trained model.

Transformer operators for multiphysics

Beyond compositional diffusion, several Transformer-based architectures have been proposed for directly learning multiphysics operators:

GNOT: multi-input operator Transformers

The General Neural Operator Transformer (GNOT) handles heterogeneous inputs naturally by treating different physical fields, boundary conditions, and PDE coefficients as distinct token types. Each token type has its own embedding, and cross-attention between types allows the model to learn input-output relationships across physics disciplines: (GNOT)hout(k)=CrossAttn(Q=hquery(k),K=[hin(1),,hin(P)],V=[hin(1),,hin(P)]), where P is the number of input physics fields.

HAMLET: modular encoders for multiphysics

HAMLET (Heterogeneous Architecture with Multiple Learned Encoders for Transformers) uses physics-specific encoders that project each field into a shared latent space: (Hamlet)z(k)=Encoderk(u(k)),u^(k)=Decoderk(Transformer([z(1),,z(P)])). The modular encoder-decoder structure allows each physics module to be designed, trained, and tested independently, with the central Transformer learning the cross-physics interactions.

CoDA-NO: cross-system pretraining

The Codomain Attention Neural Operator (CoDA-NO) takes the transferability idea further by pretraining on a diverse collection of PDE systems (heat equation, advection, Burgers, Navier–Stokes) and fine-tuning on the target multiphysics system. The key architectural choice is codomain attention: instead of attending over spatial positions (as in standard Transformers), CoDA-NO attends over the output channels (solution components), which allows it to learn cross-physics correlations:

Definition 48 (Codomain attention).

Given a spatially discretised multi-component field 𝐮N×C (with N spatial points and C solution components), codomain attention computes: (Codomain)CodomainAttn(𝐮)n,c=c=1Cexp(qckc/d)cexp(qckc/d)vc(𝐮:,c), where qc, kc, vc are computed from the c-th component 𝐮:,cN. This allows, e.g., the velocity field to attend to the pressure field, learning the coupling between Navier–Stokes momentum and continuity equations.

Lemma 2 (Compositionality of codomain attention).

Codomain attention with C1+C2 components can represent the composition of two operators: one acting on the first C1 components (physics 1) and one on the last C2 components (physics 2), plus cross-physics interaction terms. If the cross-physics attention weights are masked to zero, the operator reduces to two independent physics operators.

Example 41 (CoDA-NO for thermoelasticity).

CoDA-NO pretrained on single-physics benchmarks (heat equation and linear elasticity separately, 10,000 samples each) and fine-tuned on 500 coupled thermoelasticity samples achieves a relative L2 error of 2.1% on the temperature field and 3.4% on the displacement field. Training from scratch on the same 500 coupled samples yields errors of 5.8% and 8.2%, respectively, demonstrating the substantial benefit of cross-physics pretraining.

Summary of multiphysics approaches

Table Table 3 summarises the key characteristics of the multiphysics methods discussed.

MethodCoupled dataModularGenerative
MultiSimDiffNot neededYesYes (diffusion)
GNOTRequiredPartiallyNo
HAMLETRequiredYesNo
CoDA-NOFine-tuning onlyYesNo
Comparison of neural approaches for multiphysics PDE systems.

Exercise 31 (Designing a coupled heat-elasticity problem).

Consider a 2D square plate Ω=[0,1]2 with a circular heat source at its centre.

  1. (a)

    Write down the coupled system: itemize

  2. Heat equation: ρcptT=(kT)+Q(𝐱),

  3. Linear thermoelasticity: 𝝈+𝐟=𝟎, with 𝝈=:(𝜺αT(TT0)𝐈), itemize where 𝜺=12(𝐮+𝐮) is the strain tensor. Identify the coupling terms.

  4. (b)

    Propose a MultiSimDiff-style approach: what would the single-physics training datasets look like? What fields would each diffusion model generate?

  5. (c)

    Discuss: for what parameter ranges would you expect the compositional approach to succeed, and when might it fail? (Hint: consider the strength of the thermal-mechanical coupling coefficient αT.)

Exercise 32 (Score composition with constraints).

Suppose you have two trained diffusion models with scores 𝐬1(𝐱,t) and 𝐬2(𝐱,t), representing two physical fields that must satisfy the interface condition g(𝐱)=0 (e.g., heat flux continuity at a material boundary).

  1. (a)

    Show that naïve score composition 𝐬1+𝐬2 does not enforce the constraint g(𝐱)=0.

  2. (b)

    Propose a constrained composition using guidance: 𝐬coupled=𝐬1+𝐬2λ𝐱g(𝐱)2. Under what conditions on λ does the composed distribution concentrate on the constraint manifold {g=0} as λ?

  3. (c)

    Discuss the trade-off between constraint satisfaction (large λ) and sample diversity (small λ).

Conjecture 3 (Universal compositional multiphysics).

For a broad class of weakly coupled elliptic multiphysics systems, the compositional diffusion approach (training independent score functions and summing them at inference) converges to the true coupled solution in the limit of sufficient training data and model capacity, provided that the coupling strength (measured, e.g., by the spectral radius of the coupling operator) is less than one. For strongly coupled or hyperbolic systems, the compositional approximation may require iterative refinement (alternating between composition and re-scoring) analogous to partitioned coupling iterations in classical numerics.

Function-Space Diffusion: Beyond Grids

Every diffusion model we have encountered so far operates on finite-dimensional objects: a vorticity field discretised on a 64×64 grid, a velocity snapshot stored as a 128×128×2 tensor, a temperature profile sampled at N sensor locations. The forward and reverse SDEs live in n for some large but fixed n, and the score network is a finite-dimensional function sϕ:n×[0,T]n.

This is fine-until you change the grid.

Caution.

The finite-dimensional diffusion framework is discretisation-dependent. A model trained on 64×64 grids cannot natively produce samples at 128×128 without retraining or ad hoc interpolation. For PDE applications where the mesh is dictated by the geometry (unstructured finite-element meshes, adaptive refinement, multi-resolution grids), this is a fundamental limitation.

The remedy is to formulate diffusion directly on the function space to which the PDE solution belongs-typically a separable Hilbert space such as L2(Ω) or a Sobolev space Hs(Ω). In this formulation, each “data point” is an entire function u, the noise process is an -valued stochastic process, and the score is a map s:×[0,T]. Any finite-dimensional grid merely provides a projection of this infinite-dimensional object, and a model trained in function space can be evaluated on any discretisation at test time.

Key Idea.

Discretisation-Agnostic Generation By formulating diffusion on function spaces rather than on n, the generative model becomes inherently resolution-invariant: it learns the distribution over continuous functions p(u), and any grid is simply a finite-dimensional projection of the generated function. This is the key conceptual leap of function-space diffusion.

Mathematical framework: diffusion on Hilbert spaces

Let be a separable Hilbert space with inner product , and norm . The prototypical choice is =L2(Ω) for a bounded domain Ωd. We denote by {ek}k=1 a complete orthonormal basis of .

Definition 49 (Cylindrical Wiener Process).

A cylindrical Wiener process on is a formal sum (Cylindrical)W(t)=k=1βk(t)ek, where {βk}k=1 are independent standard Brownian motions on . The series does not converge in (its variance is infinite), but it converges in any larger space 𝒰 such that the embedding 𝒰 is Hilbert–Schmidt.

In practice, we work with a trace-class noise process by introducing a covariance operator 𝒞: that is positive, self-adjoint, and trace-class (Tr(𝒞)<). The 𝒞-Wiener process is defined by (Cwiener)W𝒞(t)=k=1λkβk(t)ek, where λk are the eigenvalues of 𝒞 and the eigenvectors coincide with the basis {ek} (which we may always arrange by diagonalising 𝒞). The trace-class condition kλk< ensures that W𝒞(t) almost surely.

Definition 50 (Function-Space Forward SDE).

The forward noising process on is the stochastic differential equation (Funcforward)dut=12β(t)𝒜utdt+β(t)dWt𝒞,u0pdata, where β:[0,T]>0 is a noise schedule and 𝒜: is a (possibly unbounded) linear operator governing the drift structure. The simplest choice 𝒜= (the identity) recovers the Ornstein–Uhlenbeck process in .

Remark 28 (Choice of covariance operator).

The covariance operator 𝒞 encodes a regularity prior on the noise. A common choice is 𝒞=(Δ+τ2)α for α>d/2, which yields Matérn-like noise with correlation length controlled by τ and smoothness by α. This is crucial for PDE applications: white noise (𝒞=) is too rough for most physical fields, and using coloured noise with an appropriate spectral decay ensures that both the forward and reverse processes remain well-defined in .

The marginal distribution at time t has the form (Funcmarginal)ut=α(t)u0+σ(t)ξ,ξ𝒩(0,𝒞), where α(t) and σ(t) are scalar functions determined by β() and 𝒜, and 𝒩(0,𝒞) denotes a Gaussian measure on with covariance 𝒞. The reverse-time SDE takes the form (Funcreverse)dut=[12β(t)𝒜utβ(t)𝒞logpt(ut)]dt+β(t)dWt𝒞, where logpt is the function-space score-the Fréchet derivative of the log-density with respect to the -inner product-and W𝒞 is a backward 𝒞-Wiener process.

Theorem 25 (Function-Space Score Matching).

Let pdata be a probability measure on with finite second moments, and let pt denote the marginal law of at time t. A neural operator sϕ:×[0,T] is trained by minimising the function-space denoising score matching objective: (Funcsm)FSM(ϕ)=𝔼t𝔼u0pdata𝔼ξ𝒩(0,𝒞)sϕ(ut,t)+σ(t)1𝒞1(utα(t)u0)𝒞2, where 𝒞2=,𝒞 is the 𝒞-weighted norm. At optimality, sϕ(ut,t)=logpt(ut) for pt-almost every ut.

Proof sketch.

The proof follows the same Tweedie-type argument as in finite dimensions, but replacing n inner products with -inner products and gradients with Fréchet derivatives. The key technical step is establishing that the Cameron–Martin theorem applies to the shifted Gaussian 𝒩(α(t)u0,σ(t)2𝒞), yielding the explicit form of logpt|0(ut|u0). We refer the reader to the detailed proofs in Pidstrigach et al. (2023) and Lim et al. (2023).

Function-space diffusion. The forward SDE corrupts a clean function u0 with 𝒞-coloured noise. The reverse SDE, driven by a neural-operator score network, recovers the clean function. Because the generative model operates on the abstract function space , the same model can be evaluated on any finite-dimensional discretisation (regular grids, unstructured meshes, point clouds) at test time.

FunDPS: guided diffusion on function spaces

A major attraction of diffusion models is their ability to solve inverse problems via posterior sampling: given an observation y=(u)+η of a PDE field u through a (possibly nonlinear) forward operator with noise η, we wish to sample from p(u|y). In finite dimensions, this is achieved by Diffusion Posterior Sampling (DPS), which approximates the posterior score as (DPS Finite)𝐱logp(𝐱t|y)𝐱logpt(𝐱t)ρt𝐱y(𝐱^0)2, where 𝐱^0 is the Tweedie posterior mean.

FunDPS (Cardoso et al., NeurIPS 2025) extends this to function spaces. The key insight is that the Tweedie formula generalises naturally:

Proposition 22 (Function-Space Tweedie Formula).

Under the forward process with 𝒜=, the posterior mean of u0 given ut is (Functweedie)u^0(ut)=𝔼[u0|ut]=1α(t)(ut+σ(t)2𝒞logpt(ut)).

FunDPS uses this to construct a function-space guidance term: (Fundps)logpt(ut|y)sϕ(ut,t)ρty(u^0(ut))𝒴2, where 𝒴 is the observation space and denotes the Fréchet derivative with respect to ut.

Insight.

FunDPS is plug-and-play: the unconditional diffusion model sϕ is trained once on the function-space prior, and different inverse problems (different forward operators ) are solved by swapping only the guidance term-no retraining required. This is especially powerful for PDE inverse problems where the forward operator is an expensive numerical solver.

The method is discretisation-agnostic: the unconditional model and the guidance gradient can be evaluated on different grids, and the posterior samples converge to the same continuous function regardless of how each component is discretised, up to discretisation error.

Example 42 (Darcy flow inversion with FunDPS).

Consider the steady-state Darcy flow equation (Darcy)(a(𝐱)p(𝐱))=f(𝐱),𝐱Ω=[0,1]2, with unknown permeability field a(𝐱). Given sparse pressure observations {p(𝐱i)}i=1m, we wish to recover a. FunDPS proceeds as follows:

  1. Train an unconditional function-space diffusion model on a dataset of permeability fields {a(j)}, using a neural operator (e.g. FNO) as the score network.

  2. At inference, run the reverse SDE with guidance toward the sparse observations via , where is the PDE solver mapping ap.

  3. Generate multiple posterior samples to quantify uncertainty in the recovered permeability field.

On the benchmark Darcy flow dataset, FunDPS achieves 30% lower reconstruction error than finite-dimensional DPS while maintaining consistent performance across resolutions from 32×32 to 256×256 without retraining.

FunDiff: diffusion with function autoencoders

While FunDPS works directly in the ambient function space, an alternative strategy is to first compress the function into a latent representation via a learned encoder, perform diffusion in this latent space, and then decode back to function space. FunDiff (Lim et al., 2024) takes this approach with a carefully designed function autoencoder.

Function autoencoder architecture

The encoder maps a function u to a finite-dimensional latent code zdz, and the decoder maps back: (Funcae)z=Encψ(u),u~=Decψ(z). Crucially, both the encoder and decoder are neural operators: the encoder takes function evaluations at an arbitrary set of input points and produces a fixed-dimensional code via cross-attention or integral transforms, and the decoder produces function evaluations at any queried set of output points. This makes the autoencoder itself discretisation-invariant.

Physics-informed priors

FunDiff incorporates physics via a regularisation term in the autoencoder loss: (Fundiff LOSS)AE(ψ)=𝔼updata[uDecψ(Encψ(u))2+λ𝒩[Decψ(Encψ(u))]2], where 𝒩[u]=0 is the PDE constraint. This encourages the decoded functions to satisfy the governing equations, even when the latent diffusion introduces small artefacts.

Theorem 26 (Minimax-Optimal Density Estimation in Function Space).

Let pdata be supported on functions in the Sobolev ball {uHs(Ω):uHsR} with s>d/2. Then the FunDiff estimator p^n trained on n i.i.d. samples achieves (Fundiff Minimax)𝔼[KL(pdatap^n)]=O(n2s/(2s+d)), matching the classical minimax rate for nonparametric density estimation in d dimensions, where d is the intrinsic dimensionality of the function class (not the ambient discretisation dimension).

This is a remarkable result: the convergence rate depends on the regularity s of the target functions and the intrinsic dimensionality d of the domain, not on the number of grid points used for discretisation.

Score-based diffusion in function space: the JMLR framework

The most comprehensive theoretical treatment of function-space diffusion to date is the framework of Pidstrigach, Berner, Richter, and Schönlieb (JMLR 2025). We summarise the key contributions.

Infinite-dimensional SDE formulation

The authors work with the SPDE (stochastic partial differential equation) (Funcjmlr Forward)dut=12β(t)(Δ)α/2utdt+β(t)dWt𝒞, where (Δ)α/2 is the fractional Laplacian and 𝒞=(Δ)α for α>d/2. This choice ensures that:

  1. The noise Wt𝒞 takes values in (the trace-class condition is satisfied).

  2. The drift operator and noise covariance are spectrally matched: both decay at rate kα in the Fourier basis, ensuring that no frequency band is over-smoothed or under-damped.

  3. The stationary distribution is a centred Gaussian 𝒩(0,𝒞) on .

Well-posedness and convergence

Theorem 27 (Well-Posedness of Function-Space Reverse SDE).

Under mild regularity assumptions on the data distribution (finite second moments, absolute continuity with respect to 𝒩(0,𝒞)), the reverse-time SDE (Funcjmlr Reverse)dut=[12β(t)(Δ)α/2utβ(t)𝒞logpt(ut)]dt+β(t)dWt𝒞 has a unique strong solution for t[0,T], and its time-marginal at t=0 recovers the data distribution pdata.

Theorem 28 (Convergence of Approximate Generation).

Let sϕ be an approximate score satisfying 0T𝔼sϕ(ut,t)logpt(ut)𝒞2dtεscore2. Then the distribution p^0 generated by the approximate reverse SDE satisfies (Funcjmlr Bound)KL(pdatap^0)Cεscore2+Cεdisc2, where εdisc is the time-discretisation error of the numerical SDE solver and C,C are constants depending on T and the noise schedule.

Historical Note.

The study of stochastic evolution equations in infinite-dimensional spaces has a rich history dating back to the work of Da Prato and Zabczyk in the 1990s, whose monograph Stochastic Equations in Infinite Dimensions (1992) remains the standard reference. The application of these ideas to generative modelling is remarkably recent-the first rigorous treatments appeared only in 2023–2024, coinciding with the explosion of interest in diffusion models for scientific computing.

Flow Matching for PDE Solvers

Diffusion models generate samples by simulating a stochastic differential equation, which requires many small steps and injects randomness at every stage. An increasingly popular alternative is flow matching: instead of a stochastic path from noise to data, we learn a deterministic velocity field vϕ:×[0,1] that transports a simple base distribution (typically Gaussian) to the data distribution along smooth trajectories.

Definition 51 (Flow Matching Objective).

Given a target coupling (u0,u1) where u0𝒩(0,𝒞) and u1pdata, the conditional flow matching loss is (Flowmatch)CFM(ϕ)=𝔼t𝒰[0,1]𝔼(u0,u1)vϕ(ut,t)(u1u0)2, where ut=(1t)u0+tu1 is the linear interpolation. At test time, samples are generated by integrating the ODE dut/dt=vϕ(ut,t) from t=0 (noise) to t=1 (data).

Key Idea.

Rectified Flows: Straight Paths are Optimal The linear interpolation path ut=(1t)u0+tu1 defines a rectified flow: the trajectories are straight lines in function space connecting noise to data. Straight paths are attractive because they can be traversed in very few integration steps-in the ideal case, a single Euler step suffices. This is in stark contrast to the curved paths of diffusion SDEs, which typically require 50–1000 steps.

Comparison of diffusion SDE trajectories (left) and flow-matching trajectories (right) in function space. Diffusion paths are stochastic and curved, requiring many neural function evaluations (NFEs). Rectified flow paths are straight and deterministic, enabling few-step generation.

Rectified Flow-Based Operator (RFO)

A particularly elegant application of flow matching to PDEs is the Rectified Flow-based Operator (RFO), which unifies forward and inverse PDE solving in a single framework.

Unified forward and inverse solving

The key observation is that a trained flow vϕ defines a bijection between the noise space and the data space. For PDE applications, we can choose the coupling more creatively: instead of coupling noise to data, we couple PDE inputs (initial/boundary conditions, parameters) to PDE outputs (solution fields).

Definition 52 (RFO: Rectified Flow Operator).

Let a𝒜 denote PDE input functions (e.g., initial conditions) and u𝒰 the corresponding solution fields. The RFO trains a velocity field vϕ:𝒰×[0,1]𝒰 with (RFO)RFO(ϕ)=𝔼t,(a,u)vϕ(wt,t)(ua)2,wt=(1t)a+tu.

The beauty of this formulation is the bidirectional nature:

  • Forward PDE solving: Given input a, integrate dwt/dt=vϕ(wt,t) from t=0 (where w0=a) to t=1 to obtain the solution uw1.

  • Inverse PDE solving: Given a target solution u, integrate backward from t=1 (where w1=u) to t=0 to recover the input aw0.

Proposition 23 (Mathematical Reversibility of RFO).

If the velocity field vϕ is Lipschitz continuous in its first argument uniformly in t, then the ODE dwt/dt=vϕ(wt,t) is uniquely solvable both forward and backward in time. Consequently, the mapping Φ01:𝒜𝒰 defined by aw1 is a diffeomorphism with inverse Φ10=Φ011.

Example 43 (RFO for Navier–Stokes forecasting and inversion).

Consider the 2D incompressible Navier–Stokes equations with initial vorticity ω0 and target vorticity ωT at time T. An RFO is trained on paired snapshots (ω0(i),ωT(i)). At test time:

  • Forward: Given a new ω0, integrate forward to predict ωT. On the Kolmogorov flow benchmark (Re=1000), RFO achieves <3% relative L2 error.

  • Inverse: Given an observed ωT, integrate backward to recover ω0. This solves the ill-posed backward Navier–Stokes problem without explicit regularisation-the flow-matching training implicitly regularises.

Generative latent neural PDE solver

For PDEs on complex geometries, working directly in the ambient function space can be unwieldy. The generative latent neural PDE solver combines an autoencoder with flow matching in the latent space.

Architecture

The pipeline consists of three stages:

  1. Encode: A geometry-aware encoder Encψ maps the PDE field u to a latent code zdz. The encoder uses graph neural network layers to handle unstructured meshes.

  2. Flow match in latent space: A velocity network vϕ:dz×[0,1]dz is trained via conditional flow matching on the latent codes.

  3. Decode: The decoder Decψ maps the generated latent code back to a function on the original mesh.

Flow-matching schedules for PDE trajectories

A subtle design choice is the flow-matching schedule for temporal sequences of PDE fields. Rather than treating each time step independently, the generative latent solver conditions on a window of past latent states and generates the next state autoregressively: (Genlpde)zn+1=Φ01vϕ(znoise;context={zn,zn1,,znK+1}), where Φ01vϕ denotes integration of the learned velocity field from t=0 to t=1, and the context window {znK+1,,zn} provides temporal information.

Remark 29 (Handling complex geometries).

A major advantage of the latent approach is that geometry information is absorbed by the encoder/decoder, while the flow-matching model operates in a geometry-agnostic Euclidean latent space. This enables a single model to handle PDEs on airfoils, cylinders, backward-facing steps, and other industrially relevant geometries, provided the autoencoder is trained on a sufficiently diverse set of meshes.

Fast Sampling and Distillation

The Achilles' heel of diffusion-based PDE solvers is sampling cost: generating a single PDE solution field requires integrating the reverse SDE or probability-flow ODE over many time steps, with each step invoking the score network-typically a large neural operator. For a practical PDE solver that must produce thousands of samples (e.g., for Monte Carlo uncertainty quantification), 100–1000 neural function evaluations (NFEs) per sample is prohibitive.

This section surveys three strategies for breaking the NFE bottleneck: truncated sampling, physics-informed refinement, and knowledge distillation.

Three regimes for sampling cost in diffusion-based PDE solvers. Full sampling uses all N denoising steps. Truncated sampling skips the first K steps (which remove only large-scale noise). Distillation compresses the entire trajectory into 1–4 steps.

Improved sampling for fluid dynamics

The first strategy, introduced at ICLR 2025 for fluid-dynamics applications, is based on the observation that not all denoising steps are equally valuable for PDE fields.

Truncation: skipping early denoising steps

In standard diffusion sampling, the reverse process begins at t=T with pure noise and gradually denoises to t=0. The early steps (t near T) remove only large-scale, low-frequency noise and contribute primarily to the overall “shape” of the field. For PDE applications where the large-scale structure is already known (e.g., from boundary conditions or a coarse solver), these steps are redundant.

The truncation strategy initialises the reverse process not from pure noise but from a partially noised version of a coarse estimate: (Truncation)uTK=α(TK)ucoarse+σ(TK)ξ,ξ𝒩(0,𝒞), and runs the reverse process only from t=TK to t=0, saving K denoising steps.

Iterative refinement with physics guidance

After truncated denoising, the resulting field may violate physical constraints (e.g., divergence-free condition for incompressible flows). An iterative refinement step applies a physics-based projection: (Physrefine)u(k+1)=u(k)ηu𝒩[u(k)]2γuu(k)u^0Tweedie2, where the first term enforces the PDE constraint and the second anchors the solution to the Tweedie posterior mean estimate.

Example 44 (Truncated diffusion for Kolmogorov flow).

On the 2D Kolmogorov flow at Re=1000, truncated sampling with K=0.6N (skipping 60% of the steps) plus two iterations of physics-guided refinement achieves:

  • Speed: 2.5× faster than full diffusion sampling.

  • Quality: Relative L2 error within 0.3% of full sampling; energy spectrum matches to within 1% across all resolved wavenumbers.

  • Physics: Divergence residual reduced by 10× compared to truncated sampling without refinement.

Phys-Instruct: ultra-fast PDE solving via distillation

While truncation reduces the number of steps by a constant factor, knowledge distillation offers a more dramatic reduction: compressing the entire multi-step diffusion trajectory into a student network that generates high-quality PDE solutions in one or a few steps.

Phys-Instruct applies this idea to PDE solvers with a physics-aware twist: the distillation objective is augmented with PDE residual penalties.

Architecture and training

The teacher is a pre-trained diffusion-based PDE solver that generates high-quality solutions in N steps. The student is a neural operator Gθ that maps (noise,conditions)solution in a single forward pass. The training loss combines: (Physinstruct)PI(θ)=𝔼[Gθ(z,c)uteacher2]distillation loss+λ𝔼[𝒩[Gθ(z,c)]2]PDE residual loss, where z𝒩(0,I), c encodes PDE parameters, and uteacher is the teacher's multi-step output.

PDE-guided distillation objectives

The PDE residual term in serves a dual purpose:

  1. It compensates for approximation errors in the teacher's output, ensuring that even when the student imperfectly mimics the teacher, the generated solutions still satisfy the governing equations.

  2. It provides gradient signal in regions of solution space where the teacher has low sample density, effectively regularising the student.

Insight.

Physics-aware distillation is more than “faster sampling.” By incorporating PDE constraints into the distillation loss, the student can sometimes outperform the teacher on physical fidelity metrics (conservation laws, divergence-free conditions), even while using 100× fewer function evaluations. This is because the student receives direct gradient feedback from the governing equations, whereas the teacher's physics knowledge is only implicit in the training data.

PIDDM: physics-informed distillation revisited

A subtler challenge in distilling diffusion models for PDE applications was identified in the PIDDM framework (ICLR 2026). The issue is Jensen's gap: when physics constraints are applied to the expected output of a multi-step diffusion process, they do not guarantee that individual samples satisfy those constraints.

Jensen's Gap in physics-informed diffusion

Consider a diffusion model that generates PDE fields upϕ. We might hope that if 𝔼[𝒩[u]2] is small, then individual samples u have small PDE residuals. However, by Jensen's inequality, (Jensen)𝒩[𝔼[u]]2𝔼[𝒩[u]2], but the reverse direction does not hold. The gap between these two quantities can be large when the generated distribution is multi-modal, as is typical for chaotic PDEs.

Caution.

A diffusion model can have low expected PDE residual while generating individual samples that grossly violate conservation laws. This is the Jensen's gap problem: the physics constraint on the mean says nothing about the physics of individual samples. PIDDM addresses this by enforcing constraints sample-by-sample.

Post-hoc physical constraint enforcement

PIDDM resolves Jensen's gap through a two-stage approach:

  1. Distillation: Train a few-step (or single-step) student model via standard consistency distillation.

  2. Post-hoc projection: After each generated sample, apply a differentiable physics projection: (Piddm PROJ)uphys=argminu~u~ustudent2s.t.𝒩[u~]δ, where δ is a tolerance parameter. In practice, this projection is implemented via a few steps of projected gradient descent.

Theorem 29 (Physics Guarantee under PIDDM).

Let ustudent be the output of the distilled student and uphys the result of the post-hoc projection . Then for every generated sample: (Piddm Guarantee)𝒩[uphys]δ, and (Piddm Close)uphysustudent1μ𝒩[ustudent], where μ>0 is the strong convexity constant of u~𝒩[u~]2 near the constraint manifold.

Example 45 (Single-step Navier–Stokes with PIDDM).

On the 2D incompressible Navier–Stokes equations at Re=500:

  • The teacher diffusion model requires 256 NFEs and achieves a relative L2 error of 1.8%.

  • The distilled student (1 NFE) achieves 2.3% error before projection.

  • After PIDDM projection (5 gradient steps), the error drops to 1.9% and the divergence residual is reduced to machine precision (<1012).

  • Total cost: 1 NFE + 5 cheap gradient steps 60× faster than the teacher.

Latent Space Methods for PDE Fields

The PDE fields we wish to generate-velocity, pressure, temperature, concentration-live in high-dimensional spaces: a turbulent flow snapshot on a 256×256×256 grid with 5 field variables contains over 8×107 degrees of freedom. Performing diffusion or flow matching in this ambient space is computationally punishing. Latent space methods address this by first compressing the high-dimensional field to a compact latent representation, performing generative modelling in the low-dimensional latent space, and then decoding back to the physical field.

Key Idea.

The Latent Diffusion Pipeline for PDEs The latent approach to generative PDE solving consists of three stages:

  1. Encode: Train an autoencoder that compresses the PDE field uNdof to a latent code zdz with dzNdof.

  2. Generate: Train a diffusion model, flow-matching model, or other generative model on the latent codes {z(i)}.

  3. Decode: Map generated latent codes back to PDE fields via the decoder.

This decouples the compression problem (learning an efficient representation of PDE fields) from the generation problem (learning the distribution over latent codes).

Why compress PDE fields?

Three practical reasons motivate latent space approaches:

  1. Computational cost: Diffusion models require O(Ndof) operations per denoising step. Reducing Ndof from 107 to 103 yields a 104× reduction in per-step cost.

  2. Structured priors: PDE fields are not arbitrary high-dimensional vectors; they lie on (or near) a low-dimensional manifold determined by the governing equations. The autoencoder learns this manifold, and the generative model only needs to learn a distribution on a low-dimensional space.

  3. Multi-resolution compatibility: The encoder can accept fields at any resolution (using, e.g., point-cloud or graph-based architectures), while the latent space has fixed dimensionality. This provides resolution invariance without the full machinery of function-space diffusion.

CoNFiLD: conditional neural-field latent diffusion

CoNFiLD (Conditional Neural-Field Latent Diffusion) represents PDE fields as neural fields-implicit neural representations that map coordinates to field values-and performs diffusion in the space of neural-field parameters.

Neural field representation

Each PDE field u is parameterised by a small neural network fω:Ωm with weights ω. The weights are obtained by fitting fω to the discrete field values: (Confild FIT)ω(u)=argminωi=1Nfω(𝐱i)u(𝐱i)2. The latent code is then z=ωdz, where dz is the number of parameters of the small network.

Conditional generation

CoNFiLD conditions the latent diffusion on PDE parameters c (Reynolds number, boundary conditions, etc.) using classifier-free guidance: (Confild CFG)s~ϕ(zt,t,c)=(1+w)sϕ(zt,t,c)wsϕ(zt,t,), where w is the guidance scale and denotes the null condition (dropout of c during training).

Remark 30 (CoNFiLD for turbulent flows).

CoNFiLD has been demonstrated on several turbulent flow benchmarks, including channel flow at Reτ=180 and isotropic turbulence. The neural-field representation naturally provides continuous output: the generated field can be queried at any spatial coordinate, not just grid points, enabling super-resolution without additional training.

Variational autoencoders for PDE fields

A natural choice for the encoder-decoder pair is a variational autoencoder (VAE), which provides a probabilistic latent space with a known prior (typically 𝒩(0,I)). The ELBO for PDE fields is: (VAE)VAE(ψ,φ)=𝔼updata[𝔼zqφ(z|u)[logpψ(u|z)]+KL(qφ(z|u)p(z))]. The decoder likelihood pψ(u|z) can be augmented with a PDE residual penalty: (VAE PHYS)logpψ(u|z)uDecψ(z)2λ𝒩[Decψ(z)]2.

ECHO: extreme compression for spatiotemporal fields

For spatiotemporal PDE data (e.g., time series of 3D flow fields), the compression ratios achievable by standard autoencoders may be insufficient. ECHO (Efficient Compression for High-dimensional Output) pushes compression to the extreme: 100× reduction in spatiotemporal dimensionality.

The key ideas are:

  1. Temporal factorisation: Separate the spatial and temporal dimensions, compressing each independently before combining them in the latent space.

  2. Physics-aware bottleneck: The latent space is structured to respect conservation laws-e.g., the latent code decomposes into a “conserved” subspace (encoding total mass, energy, etc.) and a “dynamic” subspace (encoding the evolving spatial structure).

  3. Multi-scale encoding: A hierarchical encoder captures both large-scale structures and fine-grained details, with coarser levels receiving more aggressive compression.

The latent diffusion pipeline for PDE fields. An encoder compresses the high-dimensional PDE field to a compact latent code. A generative model (diffusion or flow matching) learns the distribution over latent codes. The decoder maps generated codes back to physical fields. Compression ratios of 100×10,000× are typical.

Example 46 (ECHO for 3D turbulence).

On a dataset of 3D isotropic turbulence snapshots on a 1283 grid with 3 velocity components (total Ndof6.3×106):

  • ECHO compresses each snapshot to dz=4,096 (1,500× compression).

  • A latent diffusion model trained on the compressed codes generates new turbulence snapshots in 0.3,s on a single GPU.

  • The energy spectrum of generated snapshots matches DNS data across the entire inertial range (k5/3 scaling), with deviations only in the dissipation range (k>kmax/2).

  • The probability density functions of velocity increments (a stringent test of intermittency) agree with DNS to within statistical uncertainty.

Comparing latent and function-space approaches

Both function-space diffusion (Section Function-Space Diffusion: Beyond Grids) and latent diffusion address the resolution-dependence problem, but via different mechanisms. We summarise the tradeoffs:

PropertyFunction-SpaceLatent
Resolution invarianceBuilt-inVia encoder/decoder
Physics guaranteesDirect (in )Indirect (post-hoc)
Computational cost per stepHigh (-valued ops)Low (dz ops)
Architecture requirementsNeural operatorsStandard networks
Training complexityHigherLower
Geometry handlingNaturalRequires graph encoder
Compression artefactsNonePossible

Remark 31 (Hybrid approaches).

An emerging trend is to combine the best of both worlds: use a function-space formulation for the theoretical framework and convergence guarantees, but implement the score network via a latent autoencoder for computational efficiency. FunDiff (Section FunDiff: diffusion with function autoencoders) is an early example of this hybrid approach, and we expect it to become the dominant paradigm.

Exercises

Exercise 33 (Function-space score matching).

Consider the one-dimensional function space =L2([0,1]) with the Fourier basis ek(x)=2sin(kπx) for k=1,2,, and covariance operator 𝒞 with eigenvalues λk=k3.

  1. (a)

    Verify that 𝒞 is trace-class: k=1λk<.

  2. (b)

    Write out the 𝒞-Wiener process explicitly using the Fourier basis.

  3. (c)

    For the Ornstein–Uhlenbeck forward process with 𝒜= and β(t)=β0 (constant), compute α(t) and σ(t) explicitly.

  4. (d)

    Derive the function-space score logpt|0(ut|u0) and verify that it matches the target in .

Exercise 34 (Flow matching versus diffusion).

Consider a one-dimensional toy example where pdata=𝒩(μ,σ2) and the base distribution is 𝒩(0,1).

  1. (a)

    Write down the optimal velocity field v(x,t) for the rectified flow interpolation xt=(1t)x0+tx1.

  2. (b)

    How many Euler steps are needed to exactly transport the base to the target in this case?

  3. (c)

    Compare with the number of steps required by the DDPM reverse process for the same problem. What is the fundamental reason for the difference?

Exercise 35 (Distillation with physics constraints).

Consider a 1D heat equation tu=κxxu on [0,π] with homogeneous Dirichlet boundary conditions.

  1. (a)

    The analytical solution with initial condition u0(x)=sin(x) is u(x,t)=eκtsin(x). Suppose a distilled student generates u^(x,t)=aebtsin(x) with a1 or bκ. Compute the PDE residual tu^κxxu^L22 as a function of a, b, and κ.

  2. (b)

    Show that the PIDDM projection with the PDE residual as constraint recovers the correct values a=1, b=κ (assuming the student output is close to the true solution).

  3. (c)

    Discuss why this toy example understates the difficulty of the projection step for nonlinear PDEs.

Exercise 36 (Latent space dimensionality).

Consider PDE solutions in Hs([0,1]d) with uHsR.

  1. (a)

    The Kolmogorov ε-entropy of this Sobolev ball in the L2 norm is known to scale as εεd/s. Use this to argue that the latent dimension needed for ε reconstruction error scales as dz=O(εd/s).

  2. (b)

    For 2D Navier–Stokes solutions with s=2 (two derivatives of regularity) on a unit square, estimate the latent dimension needed for 1% relative error.

  3. (c)

    Compare your estimate with the ECHO result (dz=4,096 for 3D turbulence). Is the discrepancy surprising? Discuss the role of the data distribution being concentrated on a manifold much smaller than the full Sobolev ball.

Challenge 5 (Implementing function-space diffusion).

Implement a minimal function-space diffusion model for 1D functions:

  1. (a)

    Generate a dataset of 1,000 random functions in L2([0,1]) by sampling Fourier coefficients ak𝒩(0,k3) for k=1,,64 and evaluating the truncated Fourier series on a grid of 256 points.

  2. (b)

    Implement the forward process with 𝒞=diag(13,23,,643) in the Fourier basis.

  3. (c)

    Train a small neural network to approximate the function-space score. Evaluate the generated samples on grids of 128, 256, and 512 points and verify that the statistics (mean, variance, spectral decay) are consistent across resolutions.

  4. (d)

    Compare with a standard finite-dimensional diffusion model trained on the 256-point discretisation and evaluated on 512 points via interpolation.

PDE-Constrained Inverse Problems

In all of the preceding sections, we have been concerned with the forward problem: given the PDE parameters θ-initial conditions, boundary data, material coefficients, source terms-compute the solution field u(𝐱,t). We now turn the arrow around. In the inverse problem, we observe partial, noisy measurements of the solution and wish to recover the unknown parameters θ that gave rise to it.

“The inverse problem is the question that nature answers every time we make a measurement, and the one that scientists struggle with every time they try to interpret one.” - Albert Tarantola

Inverse problems are ubiquitous in science and engineering:

  • Medical imaging: given X-ray or ultrasound measurements, reconstruct the internal tissue density (a coefficient in the wave equation).

  • Geophysics: given seismic waveforms recorded at the surface, infer the subsurface velocity model (a coefficient in the elastic wave equation).

  • Astrophysics: given sparse telescope data, reconstruct black hole accretion disk images (governed by radiative transfer equations).

  • Climate science: given satellite observations of sea surface temperature, infer subsurface ocean currents (governed by the primitive equations).

Mathematical formulation

Consider a PDE parameterised by θΘ: (PDE)𝒩θ[u]=0in Ω×(0,T], where 𝒩θ is a (possibly nonlinear) differential operator depending on the parameter θ. We do not observe the full solution u; instead, we measure (OBS)𝒚=(u)+𝝐, where :𝒰m is the observation operator (mapping the infinite-dimensional solution to finitely many sensor readings) and 𝝐𝒩(0,Γ) is additive Gaussian noise with covariance Γm×m.

Definition 53 (PDE-Constrained Inverse Problem).

Given observations 𝒚m, the PDE-constrained inverse problem is to find θΘ such that 𝒚(u(θ)), where u(θ) denotes the solution of corresponding to parameter θ.

This is typically cast as an optimisation problem: (Optimisation)θ^=arg minθΘ12𝒚(u(θ))Γ12+λR(θ), where 𝒗Γ12=𝒗Γ1𝒗 is the Mahalanobis norm, R(θ) is a regularisation functional, and λ>0 controls the strength of regularisation. The PDE 𝒩θ[u]=0 enters as an equality constraint-hence the name PDE-constrained optimisation.

Ill-posedness and the Hadamard conditions

Jacques Hadamard (1902) defined a problem as well-posed if it satisfies three conditions:

Definition 54 (Hadamard Well-Posedness).

A problem is well-posed in the sense of Hadamard if:

  1. Existence: For every admissible data, a solution exists.

  2. Uniqueness: The solution is unique.

  3. Stability: The solution depends continuously on the data-small perturbations in the data produce small changes in the solution.

A problem that fails any of these conditions is ill-posed.

Historical Note.

Hadamard originally believed ill-posed problems to be “physically meaningless.” It was not until the mid-twentieth century, through the work of Tikhonov, Phillips, and others, that the systematic study of ill-posed problems became a central pillar of applied mathematics. Today, virtually every imaging, remote sensing, and parameter estimation problem encountered in practice is ill-posed in the Hadamard sense, and regularisation theory provides the mathematical tools to tame them.

Most PDE inverse problems are severely ill-posed: the observation operator typically loses information (it maps an infinite-dimensional field to finitely many measurements), so multiple parameters θ can produce observations consistent with the data. Uniqueness fails. Even when a unique solution exists, it may be extremely sensitive to noise-stability fails.

Example 47 (Ill-posedness in the backward heat equation).

Consider the heat equation tu=κ2u on [0,π] with Dirichlet boundaries. The forward problem-given u(x,0), find u(x,T)-is well-posed. The inverse problem-given u(x,T), find u(x,0)-is catastrophically ill-posed. In Fourier space, the k-th mode of the initial condition is related to the final state by u^k(0)=eκk2Tu^k(T). The exponential amplification factor eκk2T means that even infinitesimal noise in the high-frequency modes of the final state gets amplified to arbitrarily large errors in the reconstructed initial condition.

Bayesian formulation

The modern approach to ill-posed inverse problems is Bayesian: instead of seeking a single point estimate θ^, we characterise the full posterior distribution (Posterior)p(θ|𝒚)=p(𝒚|θ)p(θ)p(𝒚)p(𝒚|θ)p(θ), where:

  • p(θ) is the prior, encoding our beliefs about θ before seeing the data;

  • p(𝒚|θ)=𝒩(𝒚|(u(θ)),Γ) is the likelihood, measuring the fit of the PDE prediction to the observations;

  • p(𝒚)=p(𝒚|θ)p(θ)dθ is the evidence (a normalising constant);

  • p(θ|𝒚) is the posterior, our updated belief about θ given the observations.

Key Idea.

Bayesian Inversion as Regularisation The Bayesian framework provides a principled alternative to ad hoc regularisation. The prior p(θ) plays the role of the regulariser: a Gaussian prior p(θ)=𝒩(0,λ1I) yields the Tikhonov penalty R(θ)=θ2 when one takes the maximum a posteriori (MAP) estimate. But the Bayesian approach goes further: instead of returning a single estimate, it delivers the entire posterior distribution, encoding all uncertainty about θ that is compatible with the data and prior knowledge.

The challenge, of course, is that computing the posterior requires solving the PDE (within the likelihood) for each candidate θ. In Markov chain Monte Carlo (MCMC) methods, this may mean running the PDE solver millions of times-a prohibitive cost for any but the simplest equations. This is precisely where generative models enter the picture.

Forward vs. inverse problems in PDE-based modelling. The forward problem maps parameters to observations; the inverse problem reverses this mapping. The Bayesian approach characterises the full posterior distribution over parameters.

Classical approaches: adjoint methods and Tikhonov regularisation

Before diving into diffusion-based methods, let us briefly review the classical workhorses of PDE-constrained optimisation.

Tikhonov regularisation.

The simplest approach to is the quadratic penalty R(θ)=θθ02 for some reference value θ0 (often zero). The resulting estimator is (Tikhonov)θ^λ=arg minθ12𝒚(u(θ))Γ12+λ2θθ02. This is the MAP estimate under a Gaussian prior θ𝒩(θ0,λ1I). The regularisation parameter λ balances data fidelity against prior belief.

The adjoint method.

Computing the gradient θJ(θ) of the objective J(θ)=12𝒚(u(θ))Γ12 requires differentiating through the PDE solve. The adjoint method achieves this at a cost comparable to one additional PDE solve (the adjoint equation), regardless of the dimension of θ.

Theorem 30 (Adjoint Gradient Formula).

Let u=u(θ) solve the PDE F(u,θ)=0 and define J(θ)=j(u(θ)) for some smooth functional j. If p solves the adjoint equation (Fu)p=ju, then the gradient of J with respect to θ is (Adjoint)dJdθ=jθ+p,Fθ.

Proof.

By the chain rule and the implicit function theorem applied to F(u(θ),θ)=0, we have Fududθ+Fθ=0. Therefore dJdθ=jududθ+jθ=(Fu)ju,Fθ+jθ. Defining p via the adjoint equation yields the result.

Remark 32 (Adjoint methods vs. automatic differentiation).

Modern deep learning frameworks (PyTorch, JAX) provide automatic differentiation (AD) that can differentiate through entire PDE solvers. For simple problems, AD is convenient and correct. However, for large-scale simulations with millions of degrees of freedom, the memory cost of storing the entire forward computational graph for backpropagation can be prohibitive. The adjoint method, which requires storing only the forward solution (and possibly checkpointing), remains the method of choice for industrial-scale PDE-constrained optimisation.

Diffusion Models as Priors for Inverse Problems

The key insight connecting diffusion models to inverse problems is deceptively simple:

Key Idea.

Diffusion Models as Learned Priors A pre-trained diffusion model defines a prior p(u) over solution fields. To solve an inverse problem with observations 𝒚=(u)+𝝐, we sample from the posterior p(u|𝒚)p(𝒚|u)p(u) by modifying the reverse diffusion process to incorporate the likelihood. The diffusion prior replaces hand-crafted regularisers (Tikhonov, total variation, sparsity) with a data-driven prior learned from a corpus of physically plausible solutions.

Posterior sampling via guided diffusion

Recall from the diffusion chapter that a score-based generative model learns the score function ulogpt(u) at each noise level t. The reverse-time SDE that generates samples from p(u) is (Reverse SDE)du=[f(u,t)g(t)2ulogpt(u)]dt+g(t)dW, where f and g are the drift and diffusion coefficients.

To sample from the posterior p(u|𝒚) instead of the prior p(u), we apply Bayes' rule at each noise level: (Posterior Score)ulogpt(u|𝒚)=ulogpt(u)prior score (learned)+ulogpt(𝒚|u)likelihood score. The prior score is provided by the pre-trained diffusion model. The likelihood score requires approximation, since pt(𝒚|u) at intermediate noise levels is generally intractable.

Approximation strategies.

Several approaches have been proposed for the likelihood score:

  1. Diffusion Posterior Sampling (DPS): Approximate pt(𝒚|ut)p(𝒚|u^0(ut)) where u^0 is the denoised estimate from Tweedie's formula: u^0(ut)=𝔼[u|ut]. The gradient is then utlogpt(𝒚|ut)ut𝒚(u^0(ut))Γ12/2.

  2. Pseudoinverse guidance: Project the measurement residual back to the data space using the pseudoinverse of the linearised observation operator.

  3. ΠGDM (Projected Gradient Descent in Measurement space): Alternate between unconditional denoising steps and projection steps that enforce measurement consistency.

Proposition 24 (Consistency of DPS).

Suppose is a linear operator, 𝝐𝒩(0,σ2I), and the diffusion model perfectly learns pt(u) at all noise levels. Then in the limit of infinitely many discretisation steps (i.e., Δt0), the DPS procedure produces samples from the exact posterior p(u|𝒚).

Proof sketch.

For linear and Gaussian noise, the posterior p(u|𝒚)𝒩(𝒚|u,σ2I)p(u) has score ulogp(u|𝒚)=ulogp(u)σ2(u𝒚). The DPS approximation converges to this expression as t0 because u^0(ut)u in the zero-noise limit, and the linearisation of (u^0) around u recovers . The result follows from the convergence theory of the Euler–Maruyama scheme applied to the reverse-time SDE.

The plug-and-play paradigm

A remarkable feature of the diffusion-prior approach is that it is plug-and-play: the diffusion model (prior) and the forward model (likelihood) are completely separate modules. One can train a single unconditional diffusion model on a corpus of PDE solutions and then re-use it for any downstream inverse problem-tomography, data assimilation, parameter estimation-simply by changing the observation operator and the noise model. No retraining or fine-tuning of the diffusion model is required.

The plug-and-play paradigm for diffusion-based inverse problems. A pre-trained unconditional diffusion model provides the prior score, while the physics-based observation model provides the likelihood score. Their sum gives the posterior score, from which samples are drawn via the reverse-time SDE. Changing the inverse problem only requires swapping the observation model.

Remark 33 (Comparison with classical regularisation).

Table Table 4 compares diffusion-based priors with classical regularisers along several axes. The key advantage of diffusion priors is their ability to capture complex, high-dimensional, non-Gaussian structure learned directly from data, whereas classical regularisers impose simple, analytically tractable penalties.

PropertyClassical (e.g. Tikhonov/TV)Diffusion Prior
Prior formHand-crafted penaltyLearned from data
ExpressivenessLow (smooth/sparse)High (multimodal)
Retraining neededNoNo (plug-and-play)
Uncertainty quantificationVia MCMC (expensive)Via sample diversity
Nonlinear structureLimitedFully captured
Computational costLow per iterationModerate (many NFEs)
Theoretical guaranteesStrong (regularisation theory)Emerging
Comparison of classical regularisation and diffusion-based priors for PDE inverse problems.

RED-DiffEq: Full Waveform Inversion

The geophysical inverse problem

Full Waveform Inversion (FWI) is one of the most challenging inverse problems in the geosciences. The goal is to reconstruct the subsurface velocity model c(𝐱)-which determines how fast seismic waves propagate through the Earth-from seismograms recorded at the surface.

The forward model is the acoustic wave equation: (WAVE)1c(𝐱)22pt2=2p+s(𝐱,t), where p(𝐱,t) is the pressure field and s is the source term (an impulsive or swept-frequency excitation at a known location). Receivers at the surface record p at discrete positions, yielding the observed seismograms 𝒚.

Caution.

FWI is notoriously ill-posed and non-convex. The objective landscape contains many local minima (“cycle skipping”) because the wave equation relates velocity to phase shifts: a small change in velocity can cause a large shift in waveform timing, creating a highly oscillatory misfit functional. Gradient-based methods routinely converge to physically meaningless local minima unless the starting model is already close to the true velocity structure.

The RED-DiffEq framework

RED-DiffEq (Sun et al., 2024) addresses FWI by combining a physics-driven inversion loop with a diffusion model acting as a Regularisation by Denoising (RED) prior. The core idea is elegant: at each iteration of the inversion, the current velocity estimate is “cleaned up” by a diffusion denoising step, which projects it back onto the manifold of geologically plausible velocity models.

Algorithm 1 (RED-DiffEq for Full Waveform Inversion).

  1. Initialise: Starting velocity model c(0); noise schedule {tk}k=1K.

  2. For k=1,2,,K: enumerate

  3. Physics step: Compute the gradient of the data misfit: g(k)=c12𝒚(p(c(k1)))2 using the adjoint-state method applied to the wave equation .

  4. Gradient update: c~(k)=c(k1)αkg(k).

  5. Diffusion denoising step: Add noise at level tk to c~(k), then denoise using the pre-trained diffusion model: c(k)=Dψ(c~(k)+σtkξ,tk),ξ𝒩(0,I), where Dψ is a single-step denoiser derived from the score network. enumerate

  6. Return c(K).

Insight.

The diffusion denoising step in RED-DiffEq acts as a learned projector: after each gradient step potentially pushes the velocity model toward physically implausible regions (negative velocities, discontinuities in the wrong places), the denoiser pulls it back onto the data-driven manifold of realistic velocity structures. This is far more expressive than Tikhonov regularisation, which merely penalises the norm, or total variation, which penalises the gradient magnitude.

Domain decomposition for large-scale problems

Real-world FWI problems involve domains of tens or hundreds of kilometres, discretised at sub-wavelength resolution. The velocity field c(𝐱) may live on a grid of 106108 unknowns. Training a diffusion model on the full domain at this resolution is impractical.

RED-DiffEq addresses this via domain decomposition: the large domain is partitioned into overlapping patches, each of moderate resolution (e.g., 128×128). The diffusion model is trained on individual patches and applied independently during the denoising step. Consistency across patch boundaries is enforced by the physics-based gradient step, which operates on the full domain. In practice, this strategy has been shown to reconstruct velocity models on domains 8× larger than the diffusion model's training resolution.

Example 48 (Subsurface velocity reconstruction).

Consider the Marmousi velocity model, a standard benchmark in exploration geophysics consisting of complex faulted structures with velocities ranging from 1500 m/s (water) to 5500 m/s (deep sedimentary rock). The forward problem is the 2D acoustic wave equation with 16 sources and 128 receivers at the surface.

Using RED-DiffEq with a diffusion model trained on 64×64 patches of the SEG/EAGE salt model:

  • Standard FWI (L-BFGS): Converges to a smooth, low-resolution estimate. Structural errors of 12–18%.

  • FWI + Total Variation: Recovers sharper interfaces but introduces staircasing artefacts. Structural errors of 8–12%.

  • RED-DiffEq: Recovers the fine-scale geological structure, including thin layers and fault zones, with structural errors of 3–5%. The diffusion prior successfully disambiguates geologically plausible structures from artefacts.

InverseBench: A Community Benchmark for PDE Inverse Problems

The rapid growth of diffusion-based methods for inverse problems has created an urgent need for standardised evaluation. InverseBench (Ye et al., ICLR 2025) addresses this by providing a unified benchmark spanning diverse PDE inverse problems with standardised datasets, metrics, and evaluation protocols.

Benchmark tasks

InverseBench covers five tasks drawn from different physical domains:

  1. Optical diffuse tomography: Reconstruct the spatially varying absorption coefficient μa(𝐱) from boundary measurements of diffuse light. Governed by the diffusion approximation to the radiative transfer equation.

  2. Electrical impedance tomography (EIT): Reconstruct the conductivity distribution σ(𝐱) from boundary voltage measurements. Governed by Laplace's equation (σV)=0.

  3. Black hole imaging: Reconstruct the emission profile of a black hole accretion disk from sparse interferometric measurements (as in the Event Horizon Telescope). Governed by radiative transfer in curved spacetime.

  4. Turbulent flow reconstruction: Recover the full velocity field of a turbulent flow from sparse point measurements. Governed by the incompressible Navier–Stokes equations.

  5. Seismic wave inversion: A simplified FWI task: recover the velocity model from surface seismograms.

Evaluated methods

InverseBench evaluates several plug-and-play diffusion methods:

  • DPS (Diffusion Posterior Sampling)

  • DiffPIR (Diffusion-based Plug-and-Play Image Restoration)

  • ΠGDM (Pseudoinverse-Guided Diffusion Models)

  • DDRM (Denoising Diffusion Restoration Models)

  • RED-Diff (Regularisation by Denoising with Diffusion)

MethodOpt. Tomo.EITBlack HoleTurbulenceSeismic
Tikhonov21.318.716.219.820.1
DPS26.824.122.524.325.7
DiffPIR27.223.823.125.026.3
ΠGDM27.525.323.825.226.8
DDRM25.122.621.923.124.5
RED-Diff28.124.924.426.127.5
InverseBench results summary: PSNR (dB) across five inverse problems. Best result in each column is bolded. Results from Ye et al. (ICLR 2025).

Remark 34 (Key findings from InverseBench).

Several important findings emerge from InverseBench:

  1. All diffusion-based methods significantly outperform classical Tikhonov regularisation, confirming the power of learned priors.

  2. No single diffusion method dominates across all tasks; the best method depends on the nature of the observation operator (linear vs. nonlinear, degree of ill-posedness).

  3. Methods that approximate the likelihood score via Tweedie's formula (DPS, RED-Diff) tend to perform well on severely nonlinear problems.

  4. The gap between diffusion methods narrows as the number of observations increases, suggesting that the prior matters most in the low-data regime.

Exercise 37 (Implementing DPS for a linear inverse problem).

Consider the 1D heat equation on [0,1] with unknown initial condition u0(x) and known thermal diffusivity κ=0.01. Suppose we observe the solution at time T=0.5 at m=10 equally spaced sensor locations, corrupted by Gaussian noise with σ=0.05.

  1. (a)

    Train an unconditional DDPM on a dataset of 10,000 random initial conditions (e.g., random Fourier series with 20 modes).

  2. (b)

    Implement DPS by modifying the reverse diffusion sampling loop to include the likelihood gradient at each step.

  3. (c)

    Generate 50 posterior samples and compute the posterior mean and pointwise 95% credible intervals.

  4. (d)

    Compare with the Tikhonov-regularised MAP estimate for three values of λ{0.01,0.1,1.0}.

Score Matching via Differentiable Physics (SMDP)

While the plug-and-play approach separates the diffusion prior from the physics, an alternative paradigm integrates the physics simulator directly into the diffusion process. Score Matching via Differentiable Physics (SMDP, Holzschuh et al., 2023) embeds the physics simulator in the drift term of the SDE that defines the generative process.

The SMDP framework

Consider a parameterised PDE family with parameters θ. SMDP constructs a diffusion process whose forward SDE gradually corrupts a pair (θ,u(θ)) of parameter and solution: (Forward)d(θtut)=f(t)(θtut)dt+g(t)dWt. The reverse-time SDE then generates joint samples (θ,u)p(θ,u).

The key innovation is in the score network architecture: instead of predicting the full joint score (θ,u)logpt(θ,u), SMDP factorises it as (Score)ulogpt(u|θ)u[12σt2uS(θ)2]=S(θ)uσt2, where S(θ) is a differentiable PDE simulator (e.g., a neural PDE surrogate or a differentiable finite-difference solver). The parameter score θlogpt(θ) is learned by a separate network.

Proposition 25 (SMDP Posterior Sampling).

Given observations 𝒚=(u)+𝝐 where u is the true solution, SMDP generates approximate posterior samples θp(θ|𝒚) by running the reverse-time SDE with the modified score θlogpt(θ|𝒚)θlogpt(θ)+θlogp(𝒚|S(θ)), where θlogp(𝒚|S(θ)) is computed via backpropagation through the differentiable simulator S.

Example 49 (SMDP for heat equation parameter estimation).

Consider the 2D heat equation tu=(κ(𝐱)u) with spatially varying thermal conductivity κ(𝐱). The inverse problem is to recover κ(𝐱) from temperature measurements at the final time.

SMDP is trained on a dataset of (κ,u) pairs generated by a differentiable finite-difference solver. At inference time, given sparse temperature observations, SMDP generates 200 posterior samples κ(i)p(κ|𝒚).

Results on a test set of 50 problems:

  • Posterior mean error: 4.2% relative L2 error, compared to 8.7% for adjoint-based MAP and 6.1% for DPS.

  • Coverage: 95% credible intervals achieve 93% empirical coverage (well calibrated).

  • Inference speed: Each posterior ensemble of 200 samples takes 15 seconds on an A100 GPU, compared to 4 hours for MCMC with the same PDE solver.

Exercise 38 (Comparing inversion approaches).

Consider the Poisson equation 2u=f on the unit square [0,1]2 with homogeneous Dirichlet boundary conditions. The source term is unknown and takes the parameterised form f(x,y)=k=1Kakϕk(x,y) where {ϕk} are given basis functions and 𝒂=(a1,,aK) are the unknown coefficients. You observe u at m=25 random interior points with noise σ=0.01.

  1. (a)

    Derive the adjoint equation for the gradient 𝒂J where J=12𝒚Hu(𝒂)2.

  2. (b)

    Implement Tikhonov-regularised inversion for K=10.

  3. (c)

    Train a conditional diffusion model on a training set of 5000 (𝒂,u) pairs and use DPS for posterior sampling.

  4. (d)

    Compare the MAP estimates (Tikhonov vs. DPS posterior mean) and the uncertainty estimates (Tikhonov Hessian-based vs. DPS sample-based).

Uncertainty Quantification in Neural PDE Solvers

A neural PDE solver that produces a single prediction without any indication of confidence is of limited use in safety-critical applications. When a bridge designer uses a surrogate model to estimate stress distributions, or a weather forecaster relies on a neural operator for rapid prediction, the question is not just “what is the predicted solution?” but “how much should I trust this prediction?

“It is better to be approximately right than precisely wrong.” - attributed to John Maynard Keynes

Why UQ matters

Key Idea.

Uncertainty Quantification for Trustworthy Surrogates Uncertainty quantification (UQ) transforms a neural PDE solver from a black-box predictor into a decision-support tool. A well-calibrated uncertainty estimate enables:

  • Risk assessment: quantifying the probability that a physical quantity exceeds a safety threshold;

  • Active learning: identifying regions of parameter space where the model is uncertain, to guide adaptive data acquisition;

  • Model selection: comparing competing surrogates based on their predictive uncertainty;

  • Downstream optimisation: incorporating uncertainty into robust design and control.

Epistemic vs. aleatoric uncertainty

It is essential to distinguish two fundamentally different sources of uncertainty:

Definition 55 (Epistemic and Aleatoric Uncertainty).

  • Epistemic uncertainty (reducible) arises from insufficient knowledge: limited training data, model misspecification, or incomplete physics. It can, in principle, be reduced by collecting more data or using a better model.

  • Aleatoric uncertainty (irreducible) arises from inherent randomness in the system: stochastic forcing, measurement noise, chaotic sensitivity to initial conditions. It cannot be reduced by collecting more data.

For PDE surrogates, both types are relevant:

  • Epistemic: The neural operator has been trained on a finite dataset of PDE solutions. In regions of parameter space far from the training distribution, its predictions are uncertain due to lack of exposure.

  • Aleatoric: For chaotic systems (turbulence, weather), the solution at long times is inherently unpredictable: tiny perturbations in initial conditions lead to vastly different trajectories. No amount of data can eliminate this uncertainty.

Uncertainty bands for a neural PDE surrogate. The aleatoric uncertainty (orange band) is roughly constant and reflects irreducible noise. The epistemic uncertainty (blue band) widens in regions far from training data, reflecting the model's lack of knowledge.

Bayesian neural operators

The most principled approach to epistemic UQ is to place a prior p(ϕ) over the neural operator's parameters ϕ and compute the posterior p(ϕ|𝒟) given training data 𝒟. Predictions are then made by marginalising over parameters: (Bayesian PRED)p(u|θ,𝒟)=p(u|θ,ϕ)p(ϕ|𝒟)dϕ. The predictive variance decomposes as (VAR Decomp)𝖵ar[u|θ,𝒟]total=𝔼ϕ[𝖵ar[u|θ,ϕ]]aleatoric+𝖵arϕ[𝔼[u|θ,ϕ]]epistemic.

In practice, exact Bayesian inference over the millions of parameters of a neural operator is intractable. Common approximations include:

MC Dropout.

At test time, keep dropout active and run M forward passes. The empirical variance of the M predictions provides an estimate of epistemic uncertainty. This corresponds to an approximate variational posterior (Gal and Ghahramani, 2016).

Deep ensembles.

Train M independent copies of the neural operator with different random seeds and/or data orderings. The ensemble mean approximates the Bayesian predictive mean, and the ensemble variance captures epistemic uncertainty. Despite its simplicity, deep ensembles consistently provide well-calibrated uncertainty estimates and are often hard to beat.

Laplace approximation.

Fit a Gaussian 𝒩(ϕ^,H1) to the posterior, where ϕ^ is the MAP estimate and H is the Hessian of the negative log-posterior. Modern implementations use the Generalised Gauss–Newton approximation to make this scalable.

Theorem 31 (Ensemble Uncertainty Decomposition).

Let {u(i)}i=1M be predictions from an ensemble of M neural PDE solvers evaluated at parameters θ. Define the ensemble mean u=1Miu(i) and ensemble variance s2(𝐱)=1M1i(u(i)(𝐱)u(𝐱))2. If each ensemble member u(i) additionally predicts a noise variance σ^i2(𝐱), then (Ensemble Decomp)1Miσ^i2(𝐱)estimated aleatoric+s2(𝐱)estimated epistemictotal predictive variance.

Proof.

This follows directly from the law of total variance applied to the empirical ensemble distribution. Writing 𝖵ar[u|𝐱]=𝔼[𝖵ar[u|𝐱,model]]+𝖵ar[𝔼[u|𝐱,model]] and replacing population expectations with ensemble averages yields the result.

Diffusion models as natural UQ tools

One of the most compelling advantages of generative PDE solvers over deterministic surrogates is that they provide uncertainty quantification “for free.” A conditional diffusion model pψ(u|θ) can generate diverse samples u(1),u(2),,u(M)pψ(u|θ). The spread of these samples directly quantifies the model's uncertainty about the solution.

Key Idea.

Sample Diversity as Uncertainty In a well-trained conditional diffusion model:

  • Where the PDE has a unique, well-determined solution, all samples will cluster tightly-low variance, low uncertainty.

  • Where the solution is sensitive to small perturbations (chaotic regime, near bifurcation points), samples will spread out-high variance, high uncertainty.

  • Where the conditioning data is sparse or ambiguous (ill-posed inverse problem), samples will explore the manifold of consistent solutions-the spread reflects posterior uncertainty.

Unlike ensemble methods that require training M separate models, diffusion-based UQ requires only one trained model.

Example 50 (UQ for turbulent flow).

Consider a conditional diffusion model trained to predict the vorticity field of 2D turbulent flow at Reynolds number Re=10,000, conditioned on the initial vorticity at t=0.

At short prediction horizons (t=0.1Teddy), the diffusion model produces near-identical samples: the flow is essentially deterministic. The pointwise standard deviation across 100 samples is <1% of the root-mean-square vorticity.

At long prediction horizons (t=5Teddy), the samples diverge significantly: each sample is a physically plausible turbulent field, but the detailed vortex positions differ. The pointwise standard deviation reaches 4060% of the RMS vorticity.

Crucially, even at long times, the statistical properties (energy spectrum, structure functions, PDF of vorticity) are consistent across samples-the diffusion model has learned the turbulent statistics, not just individual realisations.

Calibration

Generating uncertainty estimates is useful only if those estimates are reliable. A model is said to be calibrated if its predicted confidence levels match empirical frequencies.

Definition 56 (Calibration for Regression).

A probabilistic model p(u|θ) is perfectly calibrated if, for all confidence levels α(0,1): Pr(u(𝐱)Cα(𝐱;θ))=α, where Cα(𝐱;θ) is the predicted α-level credible region and u is the true solution.

In practice, we assess calibration by the calibration plot: for each nominal level α (e.g., 50%, 80%, 90%, 95%), we compute the fraction of test points that fall within the predicted α-credible interval. A well-calibrated model yields points that lie on the diagonal of this plot.

Caution.

Neural network ensembles and diffusion models are often miscalibrated out of the box. Common pathologies include:

  • Overconfidence: The model reports narrow uncertainty bands that fail to cover the true solution. This is common when the ensemble members are too similar (lack of diversity).

  • Underconfidence: The model reports overly wide uncertainty bands. This wastes information and can lead to excessively conservative decisions.

  • Miscalibration in the tails: Even when the mean calibration is acceptable, the model may be overconfident for extreme events (the 99% credible interval covers only 90% of the time).

Post-hoc calibration methods (temperature scaling, isotonic regression, conformal prediction) can correct these issues.

Conformal prediction for PDE control

Conformal prediction provides distribution-free, finite-sample coverage guarantees for uncertainty estimates, requiring only the assumption of exchangeability (a weaker condition than i.i.d.).

Definition 57 (Conformal Prediction).

Given a calibration set {(θi,ui)}i=1n and a score function s(θ,u) measuring the “non-conformity” of a prediction, conformal prediction constructs prediction sets (Conformal)Cα(θ)={u:s(θ,u)qα}, where qα is the (1α)(n+1)/n quantile of the calibration scores {s(θi,ui)}i=1n. Under exchangeability, Pr(uCα(θ))1α for any new test point.

SafeDiffCon (Wei et al., 2024) applies this idea to PDE-based control: a diffusion model generates candidate control trajectories, conformal prediction wraps these in guaranteed coverage bands, and a safety filter ensures that the executed control action keeps the system state within the conformal uncertainty tube. This provides formal safety guarantees for neural PDE-based controllers, even when the underlying diffusion model is imperfect.

Proposition 26 (SafeDiffCon Coverage Guarantee).

Let {u(j)}j=1M be samples from a conditional diffusion model pψ(u|θ), and let Cα(θ) be the conformal prediction set constructed from a calibration dataset of size n. Then for any new test parameter θnew exchangeable with the calibration data: Pr(u(θnew)Cα(θnew))1α. This guarantee holds regardless of the quality of the diffusion model and without any distributional assumptions on u.

Exercise 39 (Calibration assessment for an FNO ensemble).

Consider the Darcy flow problem (a(𝐱)u)=f on [0,1]2 with random permeability field aμ and fixed source f1.

  1. (a)

    Train an ensemble of M=5 FNO models with different random initialisations on 1000 training pairs (a,u).

  2. (b)

    For a test set of 200 pairs, compute the ensemble mean prediction, pointwise variance, and 90% prediction intervals.

  3. (c)

    Construct a calibration plot. Is the ensemble well-calibrated?

  4. (d)

    Apply conformal prediction with a calibration set of n=100 held-out examples. Verify that the 90% conformal prediction sets achieve at least 90% coverage on a fresh test set.

  5. (e)

    Compare the width of the conformal prediction sets with the ensemble-based 90% intervals. Which is tighter?

Exercise 40 (Diffusion UQ vs. ensemble UQ).

For the same Darcy flow problem as Exercise Exercise 39:

  1. (a)

    Train a conditional DDPM to generate solution fields u conditioned on the permeability field a.

  2. (b)

    For each test permeability, generate M=50 solution samples and compute the sample mean and pointwise variance.

  3. (c)

    Compare the predictive mean error (diffusion mean vs. ensemble mean) and the calibration quality.

  4. (d)

    Measure the wall-clock time for generating 50 diffusion samples vs. running 5 FNO forward passes. Discuss the trade-off between UQ quality and computational cost.

Benchmarks and Evaluation Practice

The scientific machine learning community has experienced explosive growth over the past five years. Hundreds of papers propose new neural PDE solvers each year, each reporting results on a different set of equations, resolutions, training protocols, and metrics. This heterogeneity makes it nearly impossible to compare methods fairly or to identify genuine progress.

The antidote is standardised benchmarking: community-maintained datasets, evaluation protocols, and metrics that allow apples-to-apples comparison. In this section, we survey the major PDE benchmarks, discuss evaluation metrics beyond the ubiquitous L2 relative error, and distill principles for designing good benchmarks.

“Without data, you're just another person with an opinion.” - W. Edwards Deming

PDEBench

PDEBench (Takamoto et al., NeurIPS 2022) was the first large-scale, community benchmark for neural PDE solvers. It provides high-resolution simulation data for a diverse collection of PDEs, together with standardised training/test splits and evaluation code.

Datasets

PDEBench covers the following equations:

  1. 1D Advection equation: tu+βxu=0 with varying advection speed β.

  2. 1D/2D Burgers equation: tu+uxu=νx2u with varying viscosity ν.

  3. 1D/2D Diffusion-reaction equation: tu=D2u+R(u) with varying diffusion coefficient D and reaction rate.

  4. 1D/2D Diffusion-sorption equation: t(u+s(u))=D2u modelling contaminant transport with nonlinear sorption.

  5. 2D Compressible Navier–Stokes: The Euler equations with a Mach number ranging from 0.1 to 1.0, including shock formation.

  6. 2D Darcy flow: (a(𝐱)u)=f with log-normal random permeability fields.

  7. 2D Shallow water equations: Modelling surface gravity waves with varying bathymetry.

Each dataset contains 10,000 simulation instances at resolutions ranging from 128 to 1024 grid points per spatial dimension, stored in HDF5 format with metadata.

Baseline methods

PDEBench evaluates three baseline architectures:

  • U-Net: A standard encoder-decoder CNN with skip connections, operating on the solution field at a fixed resolution.

  • FNO: The Fourier Neural Operator, learning mappings in Fourier space.

  • PINN: The physics-informed approach, trained on PDE residuals without data.

EquationU-NetFNOPINN
1D Advection (β=0.4)0.120.082.31
1D Burgers (ν=0.01)1.840.938.72
1D Diff.-React.0.450.314.18
2D Darcy Flow1.210.566.93
2D Comp. Navier–Stokes5.733.8215.4
2D Shallow Water3.412.1712.8
PDEBench results: relative L2 error (%) for selected equations. Best result per equation is bolded. Adapted from Takamoto et al. (NeurIPS 2022).

Remark 35 (Lessons from PDEBench).

Several important patterns emerge from PDEBench:

  1. FNO consistently outperforms U-Net, confirming the value of spectral representations for PDEs with smooth solutions.

  2. PINNs lag significantly behind data-driven methods in accuracy, consistent with the known optimisation difficulties discussed in Section Physics-Informed Neural Networks.

  3. The gap between methods widens for more complex equations (compressible Navier–Stokes, shallow water), suggesting that architecture design matters most for challenging problems.

  4. All methods degrade when the resolution at test time differs from the training resolution-a key motivation for resolution-invariant architectures (Transformer-based, discretisation-agnostic operators).

Reproducibility infrastructure

PDEBench provides:

  • Standardised data loaders in PyTorch with consistent normalisation, train/validation/test splits, and augmentation protocols.

  • Reference implementations of all baseline models with hyperparameter configurations.

  • Evaluation scripts computing all reported metrics.

  • Leaderboard for community submissions.

This infrastructure has made PDEBench the de facto standard for evaluating new neural PDE solvers, with over 200 papers using it as of early 2025.

PINNacle

While PDEBench evaluates data-driven surrogates, PINNacle (Hao et al., NeurIPS 2024) focuses specifically on the evaluation of Physics-Informed Neural Networks.

Scope and design

PINNacle includes over 20 PDEs spanning:

  • Fluid dynamics: Navier–Stokes (lid-driven cavity, cylinder wake), Stokes flow, Kovasznay flow.

  • Solid mechanics: linear elasticity, plate bending.

  • Heat transfer: steady and unsteady conduction, convection-diffusion.

  • Electromagnetism: Poisson, Helmholtz.

  • Nonlinear PDEs: Allen–Cahn, Cahn–Hilliard, Korteweg–de Vries (KdV), Burgers.

  • High-dimensional PDEs: Black–Scholes in up to 10 dimensions, Hamilton–Jacobi–Bellman.

For each PDE, PINNacle provides:

  • Reference solutions (high-resolution FEM/spectral).

  • Multiple PINN variants: vanilla, causal, gradient-reweighted, domain-decomposition, and hard-constraint architectures.

  • Systematic hyperparameter sweeps: learning rate, network width/depth, activation function, number of collocation points.

Key findings

  1. Optimisation pathologies are pervasive: Across the benchmark, PINNs frequently fail to converge to accurate solutions, especially for problems with sharp gradients, multiscale features, or complex geometries. The failure rate (defined as >10% relative error) exceeds 30% for challenging problems even with extensive hyperparameter tuning.

  2. No universal PINN architecture: Different PINN variants excel on different problem classes. Causal PINNs help for time-dependent problems but not for steady-state. Hard-constraint architectures help for problems with important boundary conditions but introduce their own optimisation issues.

  3. Scaling limits: Increasing the network size beyond 4 layers and 256 neurons per layer provides diminishing returns for most problems. The bottleneck is optimisation, not capacity.

  4. Collocation point distribution matters more than quantity: Adaptive sampling strategies (e.g., residual-based refinement) consistently outperform uniform random sampling, often achieving the same accuracy with 5× fewer points.

Stylised PINNacle results: as problem difficulty increases (left to right), the relative L2 error grows for all PINN variants. Vanilla PINNs (red) cross the 10% failure threshold earliest, while the best-tuned variant (green) maintains lower error but still degrades on the hardest problems. No single PINN architecture dominates across all difficulty levels.

Evaluation Metrics Beyond L2

The most commonly reported metric in the neural PDE literature is the relative L2 error: (L2)eL2=upredutrueL2utrueL2, where the L2 norm is computed over the spatial domain (and possibly time). While convenient and widely understood, the L2 error has significant limitations.

Energy norms: H1 and H2

Many PDEs have natural energy norms associated with their variational formulations. For instance, the Poisson equation 2u=f has the energy norm (H1)uH12=uL22+uL22. The H1 error penalises errors in the gradient field, which is physically relevant because the gradient often corresponds to a physical flux (heat flux, stress, velocity gradient).

Example 51 (Why L2 can be misleading).

Consider two approximate solutions to the Poisson equation:

  • Approximation A: a smooth function that captures the overall shape of u but misses fine-scale oscillations. eL2=2%, eH1=15%.

  • Approximation B: a function with small L2 error but incorrect gradient (e.g., piecewise constant interpolation of the nodal values). eL2=1%, eH1=45%.

By L2 error alone, Approximation B looks better. But its gradient field-the physically relevant heat flux-is wildly inaccurate. The H1 norm correctly identifies Approximation A as the superior solution for any application requiring gradient information.

The H2 seminorm ||H2=2uL2 is relevant for fourth-order problems (plate bending, Cahn–Hilliard) where second derivatives carry physical meaning.

Spectral metrics

For turbulent flows, the energy spectrum E(k)-the distribution of kinetic energy across wavenumbers k-is a fundamental diagnostic. A surrogate that matches the solution pointwise in L2 may nevertheless produce a completely wrong energy spectrum (too much energy at high wavenumbers, or too little).

Definition 58 (Spectral Error).

Given the energy spectra Epred(k) and Etrue(k) of the predicted and true solutions, the spectral error is (Spectral)espec=(k=1kmax|Epred(k)Etrue(k)|2)1/2(k=1kmax|Etrue(k)|2)1/2.

For turbulence, the Kolmogorov 5/3 scaling law predicts E(k)k5/3 in the inertial range. A good generative model should reproduce this scaling, even if the individual vortex positions differ from the reference solution.

Conservation residuals

Physical PDEs are derived from conservation laws: conservation of mass, momentum, and energy. A surrogate that violates these laws may produce plausible-looking but physically meaningless solutions.

Definition 59 (Conservation Residual).

For a conservation law tρ+𝑭=0, the conservation residual of a predicted solution is (Conservation)rcons=|ddtΩρd𝐱+Ω𝑭𝒏^dS|, which should be zero (up to numerical precision) for any physically consistent solution.

Common conservation checks include:

  • Mass conservation: Is Ωρ(t)d𝐱 constant over time?

  • Energy conservation/dissipation: Does the total energy Ω12|𝒖|2d𝐱 decay at the correct rate for viscous flows?

  • Momentum conservation: For inviscid flows, is the total momentum preserved?

  • Divergence-free condition: For incompressible flows, is 𝒖=0 satisfied pointwise?

Physically relevant statistics

For stochastic or chaotic systems, pointwise comparison is meaningless at long times. Instead, we compare statistical properties:

  • Vorticity PDF: The probability distribution of vorticity values, capturing the prevalence of extreme events.

  • Structure functions: Sp(r)=|δu(r)|p where δu(r)=u(𝐱+𝐫)u(𝐱) and |𝐫|=r. For Kolmogorov turbulence, S2(r)r2/3 in the inertial range.

  • Temporal autocorrelation: How rapidly decorrelation occurs-a key indicator of whether the model captures the correct dynamical timescales.

  • Extreme value statistics: The distribution of the maximum vorticity, peak stress, or other extreme quantities-crucial for engineering applications where failure is governed by extremes.

Complementary evaluation metrics for a turbulent flow solver. (a) Energy spectrum comparison: Model A closely follows the true Kolmogorov k5/3 scaling, while Model B has too much energy at high wavenumbers (spectral pile-up). (b) Conservation residual: Model A maintains near-zero mass residual, while Model B accumulates mass error over time. Both models might have similar L2 errors.

Stability-informed metrics

For time-dependent problems, it is important to assess not just accuracy at a single time but stability over long rollouts. Key metrics include:

  • Valid prediction time: The time Tvalid until the relative L2 error first exceeds a threshold (e.g., 50%). For chaotic systems, this is analogous to the Lyapunov time.

  • Error growth rate: The rate at which the L2 error grows with time. Physically consistent models should exhibit error growth rates consistent with the system's Lyapunov exponents.

  • Blow-up detection: Does the model produce divergent predictions (NaN, exponentially growing values) during long rollouts? A metric measuring the fraction of test trajectories that remain bounded provides a crude but important stability measure.

CategoryMetricWhat it captures
3*PointwiseL2 relative errorOverall solution accuracy
L errorWorst-case local error
MSE at sensorsPrediction at observation points
2*RegularityH1 errorGradient accuracy
H2 errorCurvature accuracy
2*SpectralEnergy spectrum errorScale-by-scale fidelity
Spectral rolloffHigh-frequency content
3*ConservationMass residualMass conservation
Energy residualEnergy conservation/dissipation
Divergence errorIncompressibility constraint
3*StatisticalVorticity PDF errorDistributional accuracy
Structure functionsMulti-scale correlations
Temporal autocorrelationDynamical timescales
3*StabilityValid prediction timeTemporal stability
Error growth rateLyapunov-like behaviour
Blow-up fractionNumerical stability
Summary of evaluation metrics for neural PDE solvers, organised by the physical property they assess.

What Makes a Good Benchmark?

Having surveyed existing benchmarks and metrics, we now distill principles for designing effective PDE benchmarks.

Key Idea.

Principles for PDE Benchmark Design A good benchmark for neural PDE solvers should satisfy the following criteria:

  1. Diversity: Cover multiple PDE types (elliptic, parabolic, hyperbolic, mixed), dimensions (1D, 2D, 3D), and physical regimes (smooth vs. shock, laminar vs. turbulent).

  2. Graduated difficulty: Include easy problems (smooth, low-dimensional) and hard problems (multiscale, chaotic, singular) to reveal the scaling behaviour of methods.

  3. Multiple metrics: Report not just L2 error but also energy norms, spectral accuracy, conservation residuals, and stability measures.

  4. Standardised protocols: Fix training/test splits, data normalisation, hyperparameter budgets, and hardware specifications to enable fair comparison.

  5. Open-source: Provide code, data, and evaluation scripts under a permissive licence.

The five pillars of a good PDE benchmark. Diversity ensures broad coverage, graduated difficulty reveals scaling behaviour, multiple metrics prevent gaming, standardised protocols enable fair comparison, and open-source access ensures reproducibility.

Remark 36 (The benchmark trap).

There is a well-known risk in machine learning of “teaching to the test”: optimising methods for benchmark performance at the expense of genuine scientific utility. In the PDE context, this can manifest as models that achieve low L2 error on smooth benchmark solutions but fail catastrophically on out-of-distribution regimes (higher Reynolds numbers, different geometries, longer time horizons).

The remedy is continuous evolution of benchmarks: as the community solves existing benchmarks, new, harder challenges must be introduced. The progression from PDEBench (2022) to PINNacle (2024) to InverseBench (2025) represents healthy growth in this direction.

FeaturePDEBenchPINNacleInverseBench
FocusData-driven surrogatesPINNsInverse problems
Number of PDEs7 families20+5
Spatial dims1D, 2D1D–3D2D
MetricsL2, MSEL2, LPSNR, SSIM, LPIPS
Conservation checksNoNoNo
Spectral metricsNoNoNo
Open-sourceYesYesYes
Year202220242025
Comparison of major PDE benchmarks.

Exercise 41 (Designing a benchmark for turbulent flow surrogates).

Suppose you are tasked with creating a benchmark for evaluating generative models applied to 2D turbulent flow.

  1. (a)

    Select three Reynolds numbers spanning laminar, transitional, and fully turbulent regimes. For each, specify the PDE (incompressible Navier–Stokes), domain, boundary conditions, and forcing.

  2. (b)

    Propose a set of at least five evaluation metrics covering pointwise accuracy, spectral fidelity, conservation, and statistical properties. Justify each choice.

  3. (c)

    Define a standardised training protocol: dataset size, resolution, time span, train/validation/test split ratios, and normalisation procedure.

  4. (d)

    Identify at least three potential pitfalls (e.g., data leakage, resolution dependence, evaluation at a single snapshot vs. trajectory-level metrics) and propose mitigations.

  5. (e)

    Discuss how you would handle the evaluation of generative models (which produce distributions, not single predictions). What metrics capture sample quality vs. sample diversity?

Challenge 6 (Building a mini-PDEBench).

Implement a simplified version of PDEBench covering three equations:

  1. (a)

    1D Burgers equation with ν{0.001,0.01,0.1}.

  2. (b)

    2D heat equation with random initial conditions drawn from a Gaussian random field.

  3. (c)

    2D Darcy flow with log-normal permeability.

For each equation:

  • Generate 1000 training and 200 test solutions using a standard numerical solver (e.g., finite differences for Burgers/heat, finite elements for Darcy).

  • Train a simple FNO and a U-Net baseline.

  • Evaluate using L2, H1, and (for Burgers) conservation residuals.

  • Store all data in HDF5 with appropriate metadata.

  • Release your code and data on GitHub.

Insight.

The sections on inverse problems, uncertainty quantification, and benchmarking form a coherent triad: inverse problems demand UQ because the solution is inherently non-unique; UQ demands benchmarks because claimed uncertainties must be validated; and benchmarks demand diverse metrics because no single number captures the quality of a probabilistic PDE solver. Together, they define the infrastructure needed to move neural PDE solvers from proof-of-concept demonstrations to trustworthy, deployable tools.

Open Problems and Future Challenges

“In so far as the laws of mathematics refer to reality, they are not certain; and in so far as they are certain, they do not refer to reality.” - Albert Einstein, 1921

We have now traversed a long path-from the classical PDE solvers of the twentieth century through physics-informed neural networks, neural operators, Transformer-based architectures, and diffusion models on function spaces. The tools are powerful, the progress remarkable, and the pace of discovery exhilarating. Yet the honest truth is that we are still near the beginning. The most profound questions-about turbulence, about guarantees, about the relationship between data-driven and physics-driven understanding-remain wide open.

This section surveys the frontier. We revisit the most famous unsolved problem in mathematical physics, chart the challenges that must be overcome for generative PDE solvers to fulfil their promise, and close with philosophical reflections that we hope will inspire the next generation of researchers.

The Navier–Stokes Millennium Prize Revisited

In Section A First Look at PDEs and Why They Matter we encountered the Navier–Stokes equations and mentioned that the question of their regularity in three dimensions is one of the seven Clay Millennium Prize Problems, carrying a prize of one million US dollars. Now that we have developed the full machinery of generative PDE solvers, we can ask a more pointed question: can machine learning help crack this problem?

The formal statement

Let us state the problem precisely.

Definition 60 (Navier–Stokes Existence and Smoothness Problem).

Consider the three-dimensional incompressible Navier–Stokes equations on 3: (NS Momentum)𝐮t+(𝐮)𝐮=p+νΔ𝐮+𝐟,𝐮=0, where 𝐮(𝐱,t)3 is the velocity field, p(𝐱,t) is the pressure, ν>0 is the kinematic viscosity, and 𝐟(𝐱,t) is a smooth, bounded external force. Given smooth, divergence-free initial data 𝐮(𝐱,0)=𝐮0(𝐱) with rapid decay at infinity, either:

  1. (A)

    (Existence and smoothness.) Prove that there exists a smooth solution 𝐮C(3×[0,)) satisfying with bounded energy 3|𝐮(𝐱,t)|2d𝐱<C for all t>0; or

  2. (B)

    (Breakdown.) Exhibit smooth initial data and smooth forcing for which no such smooth solution exists.

At first glance, this problem may seem remote from machine learning. It is a question about the mathematical existence and regularity of solutions, not about their numerical computation. But as we shall argue, there are surprising and potentially transformative connections.

Why 3D is fundamentally different from 2D

The key to understanding why the 3D problem is so hard lies in a single mechanism: vortex stretching. Define the vorticity 𝝎=×𝐮. Taking the curl of , we obtain the vorticity equation: (Vorticity)𝝎t+(𝐮)𝝎=(𝝎)𝐮vortex stretching+νΔ𝝎.

Key Idea.

The Vortex Stretching Mechanism In two dimensions, the vortex stretching term (𝝎)𝐮 vanishes identically, because 𝝎 is perpendicular to the plane of motion. This makes the 2D Navier–Stokes equations much tamer: global existence and smoothness were proved by Ladyzhenskaya in 1959. In three dimensions, however, vortex tubes can stretch, amplifying vorticity exponentially-and it is unknown whether the viscous dissipation term νΔ𝝎 is always strong enough to prevent the vorticity from blowing up in finite time.

Proposition 27 (Beale–Kato–Majda Criterion).

A smooth solution of the 3D Navier–Stokes equations develops a singularity at time T< if and only if (BKM)0T𝝎(,t)Ldt=+. That is, the only way a smooth solution can break down is through the blow-up of the maximum vorticity.

This criterion tells us exactly what to look for: scenarios where the pointwise maximum of vorticity grows without bound.

Partial results: from Leray to the present

Historical Note.

Leray's 1934 masterpiece. In 1934, the French mathematician Jean Leray published a landmark paper that introduced the concept of weak solutions (solutions in an integral sense that may lack classical smoothness) and proved that for any smooth initial data, at least one global weak solution of the 3D Navier–Stokes equations exists. These “Leray–Hopf” weak solutions satisfy the energy inequality 123|𝐮(𝐱,t)|2d𝐱+ν0t3|𝐮(𝐱,s)|2d𝐱ds123|𝐮0(𝐱)|2d𝐱. Leray's result is over 90 years old, and we still do not know whether his weak solutions are actually smooth. The gap between the existence of weak solutions and the existence of smooth solutions is the essence of the Millennium Prize problem.

Theorem 32 (Conditional Regularity Results (Summary)).

The following conditions, any one of which would suffice to guarantee that a Leray–Hopf weak solution is smooth:

  1. Prodi–Serrin condition: 𝐮Lp(0,T;Lq(3)) with 2p+3q1, q>3.

  2. Vorticity condition: 𝝎L1(0,T;L(3)) (the Beale–Kato–Majda criterion).

  3. Pressure condition: pLp(0,T;Lq(3)) with 2p+3q2, q>3/2.

  4. One-component regularity: u3Lp(0,T;Lq(3)) with suitable exponents (various results by Neustupa–Penel, Cao–Titi, and others).

None of these conditions has been verified unconditionally.

Can ML help? Probing near-singular behaviour

Here is where generative models enter the picture. Even if they cannot prove theorems directly, they can serve as extraordinarily powerful experimental tools for probing the landscape of possible Navier–Stokes solutions.

Insight.

Generative Models as Experimental Mathematics The strategy is as follows. Train a conditional generative model (e.g., a diffusion model on function space) to produce 3D velocity fields 𝐮(𝐱,t) that approximately solve the Navier–Stokes equations. Then use the model to systematically search for initial conditions that lead to extreme vorticity growth-configurations that come “close” to singularity formation. Even if the model cannot produce a true singularity (which would require infinite resolution), it can identify candidate scenarios that classical high-resolution simulations can then investigate.

Several concrete research directions are emerging:

  1. Diffusion models for extreme vorticity sampling. Train a score-based generative model on the distribution of vorticity fields from turbulent simulations. Condition the model on high values of 𝝎 and sample configurations that push the envelope of vorticity concentration. This is an instance of rare-event sampling using generative models.

  2. AI-assisted conjecture generation. Feed a large language model the corpus of partial regularity results and ask it to propose new conditional regularity criteria-new functional norms or geometric conditions under which smoothness can be guaranteed. The model can suggest candidates; formal theorem provers (see the mathematics chapter) can attempt to verify them.

  3. Learned Lyapunov functionals. A classical approach to proving regularity is to construct a Lyapunov functional (an energy-like quantity that decreases along solutions). Neural networks can be trained to parameterise candidate Lyapunov functionals, with the loss function penalising violations of the monotonicity condition. If a valid Lyapunov functional is found, it constitutes a machine-generated proof of regularity.

  4. Symmetry-aware search. The Navier–Stokes equations have rich symmetry groups (spatial translations, rotations, scaling). Generative models that respect these symmetries (equivariant architectures) can focus the search on genuinely distinct configurations, avoiding redundant exploration of symmetry-related states.

Remark 37.

We should be honest about the limitations. The Millennium Prize problem is a question about the behaviour of solutions at all scales simultaneously, including infinitesimally small ones. Any numerical or neural computation operates on a finite grid and at finite precision. Machine learning can suggest where to look and what to conjecture, but the final proof (or disproof) will almost certainly require new mathematical ideas. The most likely scenario is that AI serves as a powerful telescope-helping mathematicians see patterns that would otherwise be invisible-rather than as the telescope and the astronomer.

A proposed pipeline for using generative models to attack the Navier–Stokes regularity problem. Diffusion models generate extreme vorticity configurations; pattern analysis extracts geometric features; an LLM proposes regularity criteria; and a formal theorem prover attempts to verify them. Failed proofs refine the generative search.

Discretisation-Agnostic Generation

Every method we have studied in this chapter operates, at some level, on a discrete representation: grid points, mesh nodes, spectral coefficients, or tokens. This discretisation is both a practical necessity and a fundamental limitation.

The grid-dependence problem

Consider training a diffusion model on fluid-flow snapshots at resolution 64×64. The model learns to generate fields at precisely that resolution. If we need a 256×256 field-perhaps because a fine-scale feature demands higher resolution-the trained model cannot help. We must retrain on higher-resolution data, which is expensive to generate and requires more GPU memory.

Definition 61 (Discretisation-Agnostic Generative Model).

A generative model pθ for PDE solutions is discretisation-agnostic if, once trained, it can produce samples at any desired spatial or temporal resolution without retraining or fine-tuning. Formally, for any finite set of query points {𝐱1,,𝐱N}Ω, the model returns consistent marginals: pθ(u(𝐱1),,u(𝐱N))=pθ(u)i=1Nδ(uiu(𝐱i))𝒟u, where pθ(u) is a distribution over the infinite-dimensional function space 𝒰.

Function-space methods as the solution

The key idea is to work directly in function space rather than in N for a fixed N. We encountered this perspective in the diffusion-on-function-space formulation: the forward process adds noise in a Hilbert space H, and the reverse process denoises back to a clean function. The resulting model is, in principle, resolution-independent.

Key Idea.

From Finite Vectors to Infinite Functions The paradigm shift is: pθ(𝐮N)grid-dependentpθ(u𝒰)function-space. Models operating in function space (neural processes, Gaussian neural operators, functional diffusion models) can be queried at arbitrary resolution. The challenge is making them computationally tractable and ensuring that the infinite-dimensional objects are well-defined.

Open questions abound:

  1. Can we define well-posed diffusion processes in infinite-dimensional Hilbert spaces with convergence guarantees for the score-matching objective?

  2. How do we efficiently parameterise score functions on function spaces? Current approaches use discretised approximations-can we avoid this entirely?

  3. What is the correct notion of “distribution” over solutions of a nonlinear PDE? For linear PDEs, Gaussian measures on Sobolev spaces provide a natural framework. For nonlinear PDEs, the situation is far less clear.

  4. Can neural implicit representations (NeRF-like coordinate networks for PDE solutions) achieve true resolution independence, or do they inherit the spectral bias of MLPs?

Real-Time Turbulence and Interactive Simulation

“The goal is not to replace DNS, but to make its insights available in real time.” - Karthik Duraisamy, 2023

For many applications-flight simulators, digital twins of industrial processes, real-time weather nowcasting, interactive surgical planning-the speed of a PDE solver matters as much as its accuracy. Classical high-fidelity solvers deliver accuracy but require hours or days of computation. Generative PDE solvers promise a qualitative leap: from offline batch processing to interactive, real-time simulation.

The 1000× speedup challenge

Definition 62 (Real-Time PDE Solving).

A PDE solver operates in real time for a given application if its wall-clock computation time Tcompute satisfies TcomputeTphysicalα, where Tphysical is the physical time span being simulated and α1 is an application-dependent real-time factor. For interactive applications (e.g., flight simulators), α1/30 is typical (30 fps rendering). For digital twins with control loops, α1/10 may suffice.

Current state-of-the-art neural surrogates achieve speedups of 1001000× over classical solvers for moderate-complexity problems. But for industrially relevant turbulent flows at high Reynolds numbers (Re106), we still fall short of real-time requirements by one to two orders of magnitude.

Latent-space approaches

The most promising path to real-time performance is to operate entirely in a compressed latent space:

  1. Encode the high-dimensional PDE state u(𝐱,t) into a low-dimensional latent vector 𝐳(t)d using a trained encoder.

  2. Evolve the latent state using a lightweight temporal model: 𝐳(t+Δt)=fθ(𝐳(t)). This step is fast because dN (the number of grid points).

  3. Decode back to the physical state: u^(𝐱,t+Δt)=gψ(𝐳(t+Δt)).

The challenge is ensuring that the latent dynamics respect the physics: conservation laws, stability, and long-time accuracy.

Hardware co-design: neural PDE accelerators

Insight.

Beyond GPUs: Custom Silicon for PDE Solving Just as the rise of deep learning spurred the development of specialised hardware (GPUs, TPUs, Cerebras wafer-scale engines), the rise of neural PDE solvers may eventually motivate custom silicon optimised for the specific computational patterns of operator learning and diffusion-based generation. Imagine a chip that implements the Fourier Neural Operator's spectral convolution natively, achieving orders-of-magnitude speedups over general-purpose GPUs. This is not science fiction: FPGA implementations of neural operators are already being explored in the aerospace industry.

Example 52 (Application Areas for Real-Time Neural PDE Solving).

  • Digital twins: A virtual replica of a jet engine that runs in real time, ingesting sensor data and predicting remaining useful life under current operating conditions.

  • Flight simulators: Turbulence response in real time for pilot training, replacing look-up-table approximations with physics-faithful generative models.

  • Weather nowcasting: Probabilistic 0–6 hour precipitation forecasts at 1,km resolution, updated every 5 minutes.

  • Surgical planning: Interactive blood-flow simulation through patient-specific arterial geometries, enabling surgeons to explore “what if” scenarios before operating.

  • Autonomous vehicles: Real-time aerodynamic prediction for control systems, adapting to changing vehicle configurations (windows open, roof rack, etc.).

Generative PDE Foundation Models

“Can we build one model that understands all of physics?” - Animashree Anandkumar, 2024

The success of foundation models in natural language (GPT, Claude, Gemini) and vision (DALL-E, Stable Diffusion) naturally raises the question: can we build a foundation model for PDEs? A single, large, pre-trained model that, given a PDE specification (equations, domain geometry, initial/boundary conditions, material parameters), generates accurate solution fields-without any task-specific fine-tuning.

The vision: one model for all PDEs

Definition 63 (PDE Foundation Model).

A PDE foundation model is a pre-trained generative model pθ(u|) that takes as input a complete PDE specification =(𝒩,Ω,,u0,𝝀), comprising the differential operator 𝒩, the spatial domain Ω, boundary conditions , initial conditions u0, and physical parameters 𝝀, and produces samples from the distribution of solutions. The model is trained on a diverse corpus of PDE families (heat, wave, advection, Navier–Stokes, Maxwell, Schrödinger, elasticity, ) and generalises to unseen PDE types without retraining.

Scaling laws: does more data help?

In language modelling, the “scaling laws” of Kaplan et al. (2020) and Hoffmann et al. (2022) showed that test loss decreases as a power law in model size, dataset size, and compute budget. Do similar scaling laws hold for PDE foundation models?

Proposition 28 (Conjectured Scaling Law for PDE Surrogates).

Let ϵ(N,D) denote the expected relative L2 error of a neural PDE surrogate with N parameters trained on D PDE solution pairs. Empirical evidence suggests: (Scaling LAW)ϵ(N,D)(NcN)αN+(DcD)αD+ϵ, where αN,αD>0 are PDE-family-dependent exponents, Nc,Dc are critical scales, and ϵ is an irreducible error from approximation theory (analogous to the entropy of language). Preliminary experiments suggest αN[0.2,0.5] and αD[0.3,0.7], with significant variation across PDE classes.

Remark 38.

There is a crucial difference from language modelling: for PDEs, the “data” can be generated synthetically by running classical solvers. In principle, the dataset is unlimited. The bottleneck is not data scarcity but data generation cost: a single high-fidelity turbulence simulation can take weeks on a supercomputer. This creates an intriguing optimisation problem: how to allocate a fixed compute budget between generating more training data and training a larger model.

Current state of the art

Several groups have taken first steps towards PDE foundation models:

  • MPP (Multiple Physics Pretraining, McCabe et al., 2023): Pre-trained on 14 PDE families, demonstrated zero-shot transfer to unseen PDEs, achieving competitive accuracy with specialised models.

  • Unisolver (Unified PDE Solver with PDE-Conditioned Transformers, 2024): Conditions the Transformer attention mechanism directly on the PDE coefficients via “physics cross-attention,” enabling a single model to handle diverse PDE families.

  • PROSE-FD (Pre-trained Neural Operator for PDE Families, 2024): Learns symbolic representations of PDE operators and conditions the neural solver on these representations.

  • PDEformer (2024): Uses a tokenised representation of PDE specifications (akin to a “PDE language”) to condition a Transformer-based solver.

What's missing

Despite these promising beginnings, significant gaps remain:

Caution.

Current PDE foundation models lack:

  1. Theoretical guarantees: No convergence rates, no approximation bounds, no worst-case error estimates.

  2. Physical consistency: Conservation laws are not guaranteed; solutions may violate fundamental physics.

  3. Safety certification: None of these models is certified for deployment in safety-critical systems.

  4. Out-of-distribution detection: When the model encounters a PDE outside its training distribution, it may produce plausible-looking but wildly incorrect solutions without warning.

  5. Compositionality: The models do not “understand” the structure of PDEs; they cannot derive conservation laws from the equations or predict qualitative behaviour changes.

Bridging these gaps is the central challenge for the next decade.

Physical Guarantees and Trustworthiness

If we are to deploy neural PDE solvers in applications where lives or infrastructure are at stake-nuclear reactor safety, aircraft design, climate policy-we need guarantees, not just empirical performance metrics.

Conservation laws

Theorem 33 (Noether's Theorem-Informal Statement).

Every continuous symmetry of a physical system's action functional corresponds to a conserved quantity: time translation invariance gives conservation of energy, spatial translation invariance gives conservation of momentum, rotational invariance gives conservation of angular momentum.

Classical numerical schemes-finite volumes, symplectic integrators, structure-preserving discretisations-are carefully designed to respect these conservation laws exactly (at the discrete level). Neural surrogates, trained by minimising a data-driven loss, generally do not conserve these quantities. The mass, energy, or momentum of a neural solution may drift over long time horizons, leading to physically meaningless predictions.

Example 53 (Energy Drift in Neural Surrogates).

Consider training a neural operator to predict the evolution of an inviscid fluid governed by the Euler equations, which conserve total energy. In a typical experiment, the neural surrogate produces visually convincing solutions for the first 50 time steps, but the total energy drifts by 5–15% over 200 time steps, rendering long-time predictions physically meaningless. A structure-preserving classical solver maintains energy to machine precision over the same time span.

Several approaches are being explored:

  1. Hard constraints: Design the neural architecture so that conservation laws are satisfied by construction. For divergence-free fields, use curl-based parameterisations 𝐮=×𝝍; for energy-preserving dynamics, use Hamiltonian neural networks.

  2. Soft constraints: Add conservation-law penalties to the loss function. This is simpler but provides no guarantees: the constraints are satisfied approximately, not exactly.

  3. Projection methods: After each neural prediction, project the output onto the constraint manifold (e.g., onto the space of divergence-free fields). This guarantees satisfaction of the constraint at the cost of additional computation.

  4. Hybrid solvers: Use the neural model for fast prediction and a classical solver for correction, in a predict-correct cycle.

A posteriori error estimation

Definition 64 (Certified Neural Surrogate).

A neural PDE surrogate u^θ is certified with respect to a PDE operator 𝒩 if, for each input, it provides both a solution estimate and a computable error bound: utrueu^θ𝒰η(u^θ), where the estimator η() is efficiently computable and provably reliable (i.e., the bound holds without exception).

The key idea is to exploit the residual: even without knowing the true solution utrue, we can evaluate the PDE residual r(𝐱,t)=𝒩[u^θ](𝐱,t), which should be zero for a perfect solution. Classical a posteriori error estimation theory relates the norm of the residual to the norm of the error, provided stability estimates for the PDE are available.

Out-of-distribution detection

Key Idea.

Knowing What You Don't Know A trustworthy neural PDE solver must not only produce accurate answers when it can, but also refuse to answer-or at least flag high uncertainty-when the input falls outside its training distribution. This is the “knowing what you don't know” problem, and it is arguably harder for PDE surrogates than for image classifiers, because the input space (PDE specifications) is infinite-dimensional and its structure is poorly understood.

High-Dimensional PDEs and the Curse of Dimensionality

Most of this chapter has focused on PDEs in two or three spatial dimensions-the “natural” setting for fluid dynamics, electromagnetism, and elasticity. But some of the most important PDEs in science and engineering live in much higher dimensions.

Where high-dimensional PDEs arise

  • Quantum mechanics: The Schrödinger equation for N particles lives in 3N spatial dimensions. For a molecule with 100 electrons, this is a PDE in 300 dimensions.

  • Optimal control and finance: The Hamilton–Jacobi–Bellman (HJB) equation for an optimal control problem with d state variables is a PDE in d dimensions. Realistic portfolio optimisation problems can have d100.

  • Mean-field games: Models of large populations of interacting agents (traffic flow, epidemic spreading, economic markets) lead to coupled systems of high-dimensional PDEs.

  • Kinetic theory: The Boltzmann equation for a gas lives in 6-dimensional phase space (3 positions + 3 velocities), and its numerical solution is already at the edge of feasibility.

Classical grid-based methods are hopeless in high dimensions: a grid with M points per dimension requires Md total points, which exceeds the number of atoms in the observable universe for d>15 and M=100. This is the infamous curse of dimensionality.

Deep BSDE methods

One of the most striking success stories of deep learning for PDEs is the deep BSDE method of E, Han, and Jentzen (2017), which exploits a beautiful connection between parabolic PDEs and stochastic processes.

Theorem 34 (Feynman–Kac Formula-Informal).

The solution u(𝐱,t) of a parabolic PDE ut+12tr(σσ2u)+μu=0,u(𝐱,T)=g(𝐱), can be represented as the conditional expectation u(𝐱,t)=𝔼[g(𝐗T)|𝐗t=𝐱], where 𝐗s is the diffusion process d𝐗s=μ(𝐗s,s)ds+σ(𝐗s,s)d𝐖s.

The deep BSDE method parameterises the gradient u at each time step by a neural network and optimises the terminal condition u(𝐱,T)g(𝐱) along sampled stochastic trajectories. Crucially, the method's computational cost scales polynomially in dimension d-breaking the curse of dimensionality.

Insight.

The SDE–PDE Duality and Diffusion Models There is a deep and beautiful symmetry here. Diffusion-based generative models work by converting a data distribution into noise via a forward SDE, then learning to reverse the process. The deep BSDE method works by converting a PDE problem into a forward SDE problem, then learning the gradient along trajectories. Both exploit the Feynman–Kac duality between PDEs and stochastic processes. This suggests a unified framework: a generative diffusion model that simultaneously solves high-dimensional PDEs and generates samples from complex distributions. Building this unification rigorously is an open problem.

The potential of generative models

Can generative models go further than the deep BSDE method? Several tantalising directions exist:

  1. Score-based solvers for HJB equations: The Hamilton–Jacobi–Bellman equation can be viewed as defining a score function (the gradient of the value function) on a high-dimensional state space. Score-based generative models are designed precisely to learn such gradients-can they be repurposed as HJB solvers?

  2. Mean-field generative models: For mean-field games, the coupled PDE system involves a forward Fokker–Planck equation and a backward HJB equation. A generative model could learn the joint distribution of trajectories, from which both the density and the value function can be extracted.

  3. Quantum many-body wavefunctions: The Schrödinger equation for many particles is a high-dimensional PDE. Recent work (PauliNet, FermiNet, DiffusionQMC) uses neural networks to represent many-body wavefunctions. Generative models could sample from the Born probability distribution |ψ(𝐱)|2 directly.

Climate and Weather: The Ultimate Test

“Prediction is very difficult, especially if it's about the future.” - Niels Bohr (attributed)

If there is one domain where the promise and peril of generative PDE solvers converge with maximum intensity, it is weather and climate prediction. The atmosphere is governed by the Navier–Stokes equations coupled with thermodynamics, radiation transfer, moisture transport, and ocean-atmosphere interaction. The system is chaotic, multi-scale, and of existential importance to humanity.

Weather prediction as a PDE problem

Numerical Weather Prediction (NWP) has been one of the great scientific and computational achievements of the twentieth century. The basic approach-discretise the atmospheric equations on a global grid and time-step them forward-has been refined over 70 years at operational centres like ECMWF, NOAA, and the Met Office. The current state of the art, ECMWF's IFS (Integrated Forecasting System), uses a spectral transform method at roughly 9,km horizontal resolution with 137 vertical levels, producing 51-member ensemble forecasts that take approximately one hour of wall-clock time on a dedicated supercomputer.

The AI weather revolution

In 2022–2024, a series of landmark results showed that AI models can match or exceed the accuracy of IFS for medium-range weather forecasting:

  • Pangu-Weather (Huawei, 2023): A 3D Swin Transformer trained on 39 years of ERA5 reanalysis data, producing 5-day global forecasts in seconds.

  • GraphCast (DeepMind, 2023): A graph neural network operating on an icosahedral mesh, achieving state-of-the-art accuracy on 90% of 1,380 verification targets.

  • GenCast (DeepMind, 2024): A conditional diffusion model that generates probabilistic ensemble forecasts, providing not just a single prediction but a distribution over possible weather outcomes. GenCast outperformed ECMWF's operational ensemble on probabilistic skill metrics.

Three eras of weather prediction: classical numerical weather prediction (NWP), deterministic AI weather models, and generative (probabilistic) AI weather models. Each transition brought a qualitative improvement: the first in speed, the second in uncertainty quantification.

Climate modelling: the century-scale challenge

Weather prediction operates on a time horizon of days to weeks. Climate modelling asks a much harder question: what will the statistical distribution of weather look like decades or centuries from now, under different greenhouse gas emission scenarios?

This is a problem of a fundamentally different character. Weather prediction is an initial-value problem (given today's atmospheric state, predict tomorrow's). Climate modelling is a boundary-value problem in the space of forcing scenarios: given a trajectory of CO2 concentrations, predict the long-term statistical equilibrium of the climate system.

Exercise 42.

Explain the fundamental difference between weather prediction and climate projection in terms of initial-value problems vs. boundary-value problems. Why does skill at weather prediction not automatically imply skill at climate projection? Hint: Think about sensitivity to initial conditions vs. sensitivity to boundary conditions.

Remark 39.

Generative models for climate have an additional ethical dimension. If an AI model produces century-scale climate projections that diverge from established physics-based models, the implications for policy could be enormous. Overconfident AI predictions could lead to either dangerous complacency or unnecessary alarm. Any AI climate model must be thoroughly validated against the understood physics and against the historical record-and its limitations must be communicated transparently to policymakers.

A Grand Challenge: Twenty Open Questions

“The formulation of a problem is often more essential than its solution, which may be merely a matter of mathematical or experimental skill.” - Albert Einstein

We now present twenty concrete open research questions. They range from deep theoretical problems that may take decades to resolve, to practical engineering challenges that a determined team could tackle in a year. We have marked each question with a difficulty rating: -1pt[defblue] (0,0) circle (3pt); for problems accessible to motivated undergraduates, -1pt[exorange] (0,0) circle (3pt);[exorange] (8pt,0) circle (3pt); for PhD-level research, and -1pt[exrcoral] (0,0) circle (3pt);[exrcoral] (8pt,0) circle (3pt);[exrcoral] (16pt,0) circle (3pt); for “Millennium Prize”-level challenges.

I. Theoretical Foundations

  1. Convergence of function-space diffusion. -1pt[exorange] (0,0) circle (3pt);[exorange] (8pt,0) circle (3pt); Prove that score-matching in infinite-dimensional Hilbert spaces converges to the true score as the number of training samples and network capacity grow. What are the rates?

  2. Approximation theory for neural operators. -1pt[exorange] (0,0) circle (3pt);[exorange] (8pt,0) circle (3pt); Determine tight upper and lower bounds on the number of parameters needed for a neural operator to approximate a solution map 𝒢:𝒜𝒰 to within ϵ error. How do these bounds depend on the smoothness and nonlinearity of the PDE?

  3. Navier–Stokes regularity via learned Lyapunov functionals. -1pt[exrcoral] (0,0) circle (3pt);[exrcoral] (8pt,0) circle (3pt);[exrcoral] (16pt,0) circle (3pt); Can a neural network discover a Lyapunov-type energy functional that proves global regularity (or yields a finite-time blow-up scenario) for the 3D Navier–Stokes equations?

  4. Generative models and ergodic theory. -1pt[exorange] (0,0) circle (3pt);[exorange] (8pt,0) circle (3pt); For chaotic PDEs (e.g., turbulent Navier–Stokes), the long-time statistics are governed by an invariant measure. Can a diffusion model learn this invariant measure, and if so, does sampling from the model produce trajectories with the correct ergodic properties?

  5. Complexity of PDE solving with neural networks. -1pt[exrcoral] (0,0) circle (3pt);[exrcoral] (8pt,0) circle (3pt);[exrcoral] (16pt,0) circle (3pt); Is there a complexity-theoretic separation between neural PDE solvers and classical solvers? Can neural networks solve certain PDE families in polynomial time (in dimension) where classical grid methods require exponential time?

II. Architectures and Methods

  1. Equivariant diffusion on function spaces. -1pt[exorange] (0,0) circle (3pt);[exorange] (8pt,0) circle (3pt); Design a diffusion model on function space that is equivariant to the full symmetry group of the PDE (spatial translations, rotations, Galilean boosts, scaling). Does symmetry equivariance improve sample quality and data efficiency?

  2. Autoregressive vs. diffusion for temporal rollouts. -1pt[defblue] (0,0) circle (3pt); Systematically compare autoregressive (one-step-at-a-time) and diffusion-based (full-trajectory) generation for time-dependent PDEs. Under what conditions does each approach dominate?

  3. Latent-space dynamics with physical constraints. -1pt[exorange] (0,0) circle (3pt);[exorange] (8pt,0) circle (3pt); Develop an encoder-decoder architecture for PDE states where the latent dynamics provably conserve energy, momentum, and mass. Can symplectic or Hamiltonian structures be imposed in the latent space?

  4. Tokenisation of PDE specifications. -1pt[defblue] (0,0) circle (3pt); What is the optimal way to represent a PDE specification (equations, domain, boundary conditions) as a sequence of tokens for a Transformer? Can symbolic tokenisation (parsing the PDE into an abstract syntax tree) outperform naive string tokenisation?

  5. Multi-fidelity generative training. -1pt[defblue] (0,0) circle (3pt); Train a generative PDE model on a mix of cheap low-resolution and expensive high-resolution simulation data. Can multi-fidelity training achieve the accuracy of high-fidelity training at a fraction of the data-generation cost?

III. Applications and Deployment

  1. Certified neural surrogates for nuclear safety. -1pt[exorange] (0,0) circle (3pt);[exorange] (8pt,0) circle (3pt); Develop a neural PDE surrogate for reactor thermal-hydraulics that comes with provable error bounds sufficient for regulatory certification.

  2. Real-time turbulence for flight simulation. -1pt[exorange] (0,0) circle (3pt);[exorange] (8pt,0) circle (3pt); Build a generative model that produces realistic turbulent flow fields around an aircraft at interactive frame rates (30,fps), with statistical properties matching high-fidelity LES or DNS within specified tolerances.

  3. Generative climate emulators. -1pt[exorange] (0,0) circle (3pt);[exorange] (8pt,0) circle (3pt); Train a generative model that produces physically consistent century-scale climate trajectories conditioned on emission scenarios, matching the statistical behaviour of CMIP6 models but running 10,000× faster.

  4. Inverse design with generative PDE solvers. -1pt[defblue] (0,0) circle (3pt); Use a conditional diffusion model to solve inverse design problems: given a desired flow property (e.g., minimum drag), generate the geometry that achieves it. Compare with classical adjoint-based optimisation.

  5. Patient-specific surgical planning. -1pt[exorange] (0,0) circle (3pt);[exorange] (8pt,0) circle (3pt); Build a generative cardiovascular flow solver that takes a patient's CT/MRI-derived vascular geometry, produces an ensemble of possible haemodynamic scenarios, and runs fast enough for intraoperative use.

IV. Benchmarks and Evaluation

  1. A unified benchmark for generative PDE solvers. -1pt[defblue] (0,0) circle (3pt); Create a comprehensive benchmark suite (analogous to ImageNet for vision or GLUE for NLP) covering diverse PDE families, geometries, and evaluation metrics, with standardised train/test splits and evaluation protocols.

  2. Perceptual metrics for PDE solutions. -1pt[defblue] (0,0) circle (3pt); Pointwise L2 error fails to capture the perceptual quality of turbulent flow fields (analogous to how MSE fails for images). Develop physically motivated perceptual metrics that assess the statistical, spectral, and structural fidelity of generated PDE solutions.

  3. Stress-testing out-of-distribution. -1pt[defblue] (0,0) circle (3pt); Systematically characterise the failure modes of neural PDE solvers under distribution shift: changes in Reynolds number, domain geometry, boundary conditions, and PDE coefficients. Build a “breaking point” dataset.

V. Connections and Unifications

  1. PDE solving as language modelling. -1pt[exorange] (0,0) circle (3pt);[exorange] (8pt,0) circle (3pt); Is there a meaningful sense in which PDE solutions can be “narrated” as sequences, and autoregressive language models can serve as PDE solvers? What are the theoretical limitations of this analogy?

  2. The grand unification: one model for science. -1pt[exrcoral] (0,0) circle (3pt);[exrcoral] (8pt,0) circle (3pt);[exrcoral] (16pt,0) circle (3pt); Can we build a single foundation model that simultaneously handles fluid dynamics, solid mechanics, electromagnetism, quantum mechanics, and their couplings? What are the fundamental obstacles-architectural, data-related, or information-theoretic-to such a model?

Exercise 43.

Choose one of the twenty open questions above and write a 2-page research proposal outlining: (a) the precise problem formulation, (b) your proposed approach, (c) the expected difficulties, and (d) how you would evaluate success. This is excellent practice for writing real research proposals.

Philosophical Reflections

“The miracle of the appropriateness of the language of mathematics for the formulation of the laws of physics is a wonderful gift which we neither understand nor deserve.” - Eugene Wigner, 1960

We close this chapter-and this part of the book-with some reflections that are more philosophical than technical. They are offered not as definitive answers but as invitations to thought.

Does a Neural PDE Solver “Understand” Physics?

When a Fourier Neural Operator produces a flow field that matches DNS to within 2% relative error, does it “understand” fluid mechanics? The question may seem idle, but it has practical implications.

Consider two scenarios:

  1. A student who memorises the answers to every problem in a fluid mechanics textbook without understanding the derivations. Ask them a problem they have seen before, and they answer correctly. Ask them a genuinely novel problem, and they fail.

  2. A student who understands the Navier–Stokes equations deeply-the role of each term, the physical mechanisms, the dimensional analysis. They may not have memorised any answers, but they can derive solutions to problems they have never seen.

Current neural PDE solvers are closer to the first student. They excel at interpolation (problems “between” training examples) but struggle at extrapolation (problems genuinely outside the training distribution). A model trained on flows at Reynolds numbers 103 to 105 may fail catastrophically at 106.

Key Idea.

Understanding vs. Pattern Matching We propose a practical definition: a neural PDE solver “understands” a physical phenomenon to the extent that it can extrapolate correctly to regimes not seen during training. By this criterion, current models have limited understanding. The quest for genuine physical understanding in neural networks is closely connected to the quest for compositional generalisation: the ability to combine learned primitives in novel ways.

Data-Driven vs. Physics-Driven: The Central Tension

The field of scientific machine learning is animated by a fundamental tension between two philosophies:

  • The data-driven philosophy: “Let the data speak. Given enough data and a sufficiently flexible model, the physics will emerge automatically. We do not need to encode physical laws; the model will discover them.”

  • The physics-driven philosophy: “Physical laws are hard-won distillations of centuries of human understanding. Ignoring them is wasteful and dangerous. Encode them into the model architecture and loss function; use data only to fill in what physics alone cannot determine.”

The truth, as usual, lies somewhere in between-but the optimal balance is far from obvious and likely depends on the application.

The physics–data spectrum. Classical solvers use only physics (left); pure data-driven models use no physics (right). Current methods occupy various positions along this spectrum. Finding the optimal balance remains an open question.

Historical Note.

The two cultures. This tension echoes an older debate in statistics. In 2001, Leo Breiman published a provocative paper entitled “Statistical Modelling: The Two Cultures,” contrasting data-modelling (assuming a generative process and fitting parameters) with algorithmic modelling (using flexible models like random forests to predict without assumptions). Breiman argued that the algorithmic culture was undervalued. Twenty-five years later, the pendulum has swung dramatically: data-driven methods dominate many benchmarks. But for physical systems, where we have strong prior knowledge in the form of conservation laws and symmetries, the question of how to incorporate this knowledge remains critical.

Symbolic AI vs. Connectionist AI for Scientific Discovery

The tension between physics-driven and data-driven approaches is a specific instance of a much older debate in artificial intelligence: symbolic vs. connectionist AI.

Symbolic AI-exemplified by expert systems, theorem provers, and symbolic regression-represents knowledge as explicit rules and manipulates them logically. Connectionist AI-exemplified by neural networks-represents knowledge as distributed patterns of activation in high-dimensional weight spaces.

For scientific discovery, the ideal would be a system that combines:

  1. The generalisation and pattern recognition abilities of connectionist models (finding structure in vast datasets that no human could survey);

  2. The interpretability and compositionality of symbolic models (producing results that humans can understand, verify, and build upon);

  3. The rigour of formal mathematical proof (ensuring that discovered relationships are not just correlations but provable truths).

Remark 40.

The integration of these three capabilities is the central challenge of “AI for Science.” Some recent systems-notably those combining LLMs with formal theorem provers-take steps in this direction. But a truly unified neuro-symbolic-formal system for scientific discovery remains a distant goal.

Two Kinds of Unreasonable Effectiveness

In 1960, the physicist Eugene Wigner published his celebrated essay The Unreasonable Effectiveness of Mathematics in the Natural Sciences. He marvelled at the fact that abstract mathematical structures-developed by pure mathematicians with no physical application in mind-turn out, again and again, to be precisely the right language for describing physical reality. Riemannian geometry, conceived in the abstract, turned out to be the language of general relativity. Group theory, developed for its own beauty, became the foundation of particle physics.

Six decades later, we face an analogous puzzle: the unreasonable effectiveness of deep learning. Neural networks-universal function approximators with no built-in physical knowledge-turn out to be extraordinarily effective at learning the solutions of PDEs. A generic architecture (Transformer, U-Net) trained on examples can match or exceed decades of domain-specific numerical method development.

Conjecture 4 (The Double Effectiveness Hypothesis).

The effectiveness of mathematics for physics and the effectiveness of deep learning for PDE solving are not unrelated coincidences but manifestations of a shared underlying principle: both exploit compositionality and symmetry in the structure of physical laws. Mathematics is effective because physical laws are compositional (complex phenomena emerge from simple, symmetric building blocks). Deep learning is effective because neural networks are universal approximators of compositional functions, and their inductive biases (locality in CNNs, attention in Transformers) align with the compositional structure of physics.

The Role of Human Intuition in an AI-Augmented World

Perhaps the most important question of all is not technical but human: in a world where AI can solve PDEs faster and more accurately than humans, what is the role of human intuition?

We believe the answer is: more important than ever.

Insight.

The Augmented Scientist AI does not replace the need for physical intuition-it amplifies it. When a classical simulation took weeks, a scientist could test only a handful of hypotheses. When a generative model produces solutions in seconds, the bottleneck shifts from computation to imagination: which questions to ask, which parameter regimes to explore, which anomalies to investigate. The scientist who combines deep physical intuition with fluency in AI tools will be vastly more productive than either the pure theorist or the pure ML engineer.

The history of science suggests that the greatest discoveries occur not when a tool replaces human thought but when it extends it. The telescope did not replace the astronomer; it gave the astronomer new eyes. The computer did not replace the mathematician; it gave the mathematician new hands. Generative PDE solvers will not replace the physicist or engineer; they will give them new powers of exploration.

Exercise 44.

Write a short (1-page) science fiction scenario set in 2040 in which a researcher uses a generative PDE foundation model to make a major scientific discovery. What role does human intuition play in the story? What role does the AI play? How do they complement each other?

0.50.4pt

“We stand at the beginning of a new relationship between humans and the mathematical laws that govern the physical world. For three centuries, we have used our minds to derive solutions; for seventy years, we have used our computers to approximate them. Now, for the first time, we can learn them. The question is not whether AI will transform computational physics-it already has. The question is whether we will be wise enough to wield this power with the care it demands, and bold enough to ask the questions it makes possible.”

We close with a grand challenge and a conjecture, offered in the spirit of Hilbert's 1900 address and the Clay Millennium Problems, as a beacon for the next generation.

Challenge 7.

The Generative PDE Grand Challenge. Build a single generative model that, given any well-posed PDE specification (equation, domain, initial/boundary conditions, parameters), produces physically consistent solution fields with certified error bounds, at a computational cost that is polynomial in the spatial dimension and independent of the grid resolution. Demonstrate the model on at least five fundamentally different PDE families (including at least one in dimension d10), and show that its solutions respect the conservation laws implied by the PDE's symmetries.

Conjecture 5 (The Physics–Learning Duality).

There exists a formal duality between structure-preserving numerical methods for PDEs (symplectic integrators, divergence-free discretisations, entropy-stable schemes) and inductive biases in neural architectures (equivariance, conservation layers, Hamiltonian networks). Specifically, for every class of structure-preserving numerical method, there is a corresponding class of neural architecture that achieves the same conservation properties with provably fewer parameters; and conversely, every conservation-respecting neural architecture implicitly implements a structure-preserving discretisation of the underlying PDE. Establishing this duality rigorously would unify classical numerical analysis and geometric deep learning into a single theoretical framework.

“The important thing is not to stop questioning. Curiosity has its own reason for existence.” - Albert Einstein

This is not the end. It is not even the beginning of the end. But it is, perhaps, the end of the beginning.

Pen-and-Paper Exercises

The exercises in this section are designed to solidify the theoretical foundations developed throughout the chapter. They range from straightforward calculations (3570END) to demanding proofs that require combining ideas from multiple sections (3571END). We encourage the reader to attempt each exercise before consulting any hints, and to write complete, rigorous solutions.

Key Idea.

Difficulty Ratings Throughout this section we use a star rating to indicate difficulty: = direct computation or definition check; = requires combining two ideas; = requires a short proof or careful calculation; = demands significant technical sophistication; = research-level, open to creative approaches.

Exercise 45 (PDE Classification).

3577END Classify each of the following second-order linear PDEs in two variables as elliptic, parabolic, or hyperbolic by computing the discriminant B24AC of the principal part:

  1. uxx+2uxy+uyy+ux=0.

  2. uxx4uyy=0.

  3. uxx+4uxy+5uyyu=0.

  4. 3uxx+10uxy+3uyy=0.

  5. ut=ν(uxx+uyy) (interpret as a PDE in (x,y) with t as a parameter vs. as a PDE in (x,t)).

For each case, state whether the PDE is well-suited to steady-state, initial-value, or boundary-value formulations, and briefly explain why.

Exercise 46 (PINN Loss for the Heat Equation).

3587END Consider the one-dimensional heat equation on Ω=(0,1): (HEAT)ut=κ2ux2,x(0,1),t(0,T], with u(x,0)=sin(πx) and u(0,t)=u(1,t)=0.

  1. Write down the full PINN loss (ϕ)=λrr+λbb+λ00 explicitly, identifying each term.

  2. Compute the exact solution u(x,t)=eκπ2tsin(πx) and verify it satisfies (HEAT).

  3. Using the exact solution, show that for any MLP uϕ(x,t), the PDE residual loss r is exactly zero if and only if uϕ satisfies the heat equation pointwise at the collocation points.

  4. Discuss what happens to the training dynamics if λrλ0, and conversely if λ0λr.

Exercise 47 (PINN Loss for the Wave Equation).

3599END Derive the PINN loss function for the one-dimensional wave equation: 2ut2=c22ux2,x(0,L),t(0,T], with u(x,0)=f(x), ut(x,0)=g(x), and homogeneous Dirichlet boundary conditions.

  1. Write down each component of the composite loss, noting that the initial condition now involves two constraints (displacement and velocity).

  2. The wave equation has characteristic speed c. Explain, using the notion of a domain of dependence, why PINNs with uniform random collocation tend to struggle with sharp wave fronts.

  3. Propose a modified sampling strategy for the collocation points that could mitigate this issue.

Hint: Think about how causal training (The core idea) addresses temporal causality.

Exercise 48 (PINN Loss for Burgers' Equation).

3604END The viscous Burgers' equation is: ut+uux=ν2ux2,x(1,1),t(0,1].

  1. Write down the PINN residual rϕ(x,t)=tuϕ+uϕxuϕνxxuϕ. Note which derivatives must be computed via automatic differentiation.

  2. Show that the nonlinear term uϕxuϕ requires careful treatment: compute the total number of backward passes needed to evaluate rϕ at a single collocation point.

  3. For ν=0.01/π, sketch (qualitatively) the expected solution profile at t=0.5, explaining the formation of a steep gradient. Why does this steep gradient cause difficulty for PINNs?

Exercise 49 (Properties of the Fourier Neural Operator Kernel).

3611END Recall that the Fourier layer in the FNO applies the update (FNO Layer)v(+1)(x)=σ(W()v()(x)+(𝒦()v())(x)), where the integral operator 𝒦() is defined via (𝒦()v)(x)=1(R()v^)(x), with R()dv×dv×kmax being the learnable frequency-domain weights, v^ the discrete Fourier transform (DFT) of v, and kmax a frequency cutoff.

  1. Show that 𝒦() is a linear integral operator: i.e., 𝒦()(αv1+βv2)=α𝒦()v1+β𝒦()v2.

  2. Prove that the kernel κ()(xy)=1[R()](xy) is translation-invariant (i.e., depends only on xy).

  3. Show that truncating to kmax modes is equivalent to projecting onto a finite-dimensional subspace of L2, and estimate the approximation error in terms of the Fourier decay rate of v.

  4. If vHs(𝕋d) (a Sobolev space of regularity s), show that the truncation error is O(kmaxs).

Hint: For part (d), recall that vHs implies |v^(k)|C|k|s for some constant C.

Exercise 50 (Attention Approximates Integral Operators).

3632END Consider a general integral operator on functions v:Ωd: (𝒯v)(x)=ΩK(x,y)v(y)dy, where K:Ω×Ωd×d is a kernel function.

  1. Write the softmax attention mechanism Attn(Q,K,V)i=jexp(qikj/dk)jexp(qikj/dk)vj as a discretised integral operator over Ω, identifying the kernel Kattn(xi,xj).

  2. Show that as the number of discretisation points N, the attention output converges (under mild regularity conditions) to the integral (𝒯attnv)(x) with a normalised kernel.

  3. Prove that this normalised kernel satisfies ΩKattn(x,y)dy=𝐈 for all x, making it a Markov-type kernel.

  4. Discuss the implications for learning Green's functions of PDEs: what symmetry properties of the true Green's function G(x,y) are not naturally captured by softmax attention?

Hint: For part (d), recall that Green's functions of self-adjoint operators satisfy G(x,y)=G(y,x).

Exercise 51 (Score of a Gaussian Field).

3645END Let u𝒢𝒫(0,𝒞) be a zero-mean Gaussian random field on Ω=[0,1] discretised on a uniform grid of N points, yielding a vector 𝐮N with 𝐮𝒩(𝟎,𝐂) where Cij=exp(|xixj|2/(22)) is a squared-exponential covariance.

  1. Write down the probability density p(𝐮) and compute the score function 𝐮logp(𝐮).

  2. Show that the score is linear in 𝐮: 𝐮logp(𝐮)=𝐂1𝐮.

  3. For the forward diffusion process 𝐮t=αt𝐮0+1αt𝝐, derive the score of the noised distribution pt(𝐮t) and show it takes the form 𝐮tlogpt(𝐮t)=(αt𝐂+(1αt)𝐈)1𝐮t.

  4. Discuss why this closed-form result is useful for sanity-checking score-based diffusion models on PDE solution distributions.

Exercise 52 (Kolmogorov Microscale Computation).

3659END The Kolmogorov microscale is η=(ν3/ε)1/4, where ν is the kinematic viscosity and ε is the turbulent dissipation rate. For homogeneous isotropic turbulence in a periodic box of side L with integral-scale Reynolds number ReL=uL/ν (where u is the rms velocity fluctuation), the dissipation scales as εu3/L.

  1. Show that η/LReL3/4.

  2. Compute η for: itemize

  3. ReL=100 (low turbulence, lab scale),

  4. ReL=10,000 (moderate turbulence),

  5. ReL=106 (atmospheric boundary layer), itemize assuming L=1m in each case.

  6. For DNS on a periodic box, the grid spacing must satisfy Δxη. In three dimensions, show that the total number of grid points scales as NReL9/4 and compute N for each of the above Reynolds numbers.

  7. Estimate the wall-clock time for each DNS if a single time-step costs 109N seconds and the simulation requires O(N1/3) time-steps. Use this to argue that DNS at atmospheric Reynolds numbers is intractable.

Exercise 53 (The Cole–Hopf Transformation).

3678END The Cole–Hopf transformation converts the nonlinear Burgers' equation into the linear heat equation. Let u satisfy ut+uux=νuxx.

  1. Define ψ=exp(12νxu(x,t)dx). Show that u=2νψx/ψ.

  2. Substitute u=2νψx/ψ into Burgers' equation and show that ψ satisfies the heat equation ψt=νψxx.

  3. Starting from the initial condition u(x,0)=sin(πx) on (1,1), write down (without solving) the initial condition for ψ and explain how the exact Burgers' solution can be recovered.

  4. Discuss why this analytical technique does not generalise to higher-dimensional or non-integrable PDEs, motivating the need for neural network-based approaches.

Exercise 54 (Deriving the Stefan Condition).

3689END Consider a one-dimensional phase-change problem where a material occupies x[0,L] and melts at temperature Tm. The solid–liquid interface is at x=s(t), with temperature fields Ts in the solid (x>s(t)) and T in the liquid (x<s(t)), each satisfying the heat equation in their respective domains.

  1. By considering conservation of energy across the interface, derive the Stefan condition: ρdsdt=kTx|x=sksTsx|x=s+, where ρ is the density, is the latent heat, and k, ks are the thermal conductivities.

  2. Explain why this moving-boundary problem poses a challenge for standard PINNs (which assume a fixed domain).

  3. Propose a neural network architecture that could handle the moving boundary by parameterising both the temperature fields and the interface location.

Hint: For part (a), integrate the heat equation across a thin strip [s(t)ϵ,s(t)+ϵ] and take ϵ0.

Exercise 55 (Antisymmetry of Slater Determinants).

3704END In quantum mechanics, an N-electron wavefunction must be antisymmetric under exchange of any two electrons. The Slater determinant constructs such a wavefunction from single-particle orbitals {ψ1,,ψN}: Ψ(𝐫1,,𝐫N)=1N!det(ψ1(𝐫1)ψ2(𝐫1)ψN(𝐫1)ψ1(𝐫2)ψ2(𝐫2)ψN(𝐫2)ψ1(𝐫N)ψ2(𝐫N)ψN(𝐫N)).

  1. Prove that Ψ is antisymmetric: swapping 𝐫i𝐫j (for ij) gives Ψ.

  2. Show that if ψi=ψj for some ij, then Ψ0 (the Pauli exclusion principle).

  3. Explain why neural network architectures for quantum many-body PDEs (such as FermiNet and PauliNet) must build in this antisymmetry structurally, and how a Slater-determinant backbone achieves this.

Exercise 56 (Function-Space Forward SDE).

3715END In a function-space diffusion model, we define a forward process on fields uL2(Ω) via the SDE: (FUNC SDE)dut=12β(t)utdt+β(t)dWt, where Wt is a cylindrical Wiener process on L2(Ω) and β(t) is a noise schedule.

  1. Show that the marginal distribution at time t, starting from a deterministic field u0, is Gaussian: ut𝒩(αtu0,(1αt)), where αt=exp(0tβ(s)ds) and is the identity operator.

  2. Explain why the use of a cylindrical Wiener process (rather than a trace-class process) leads to samples that are only distributions (generalised functions), not smooth fields. What practical consequences does this have for discretisation?

  3. If we instead use a coloured noise dWt(𝒞)=𝒞1/2dWt for some trace-class covariance operator 𝒞, derive the marginal distribution and show that the terminal distribution is 𝒩(0,𝒞) rather than white noise.

  4. Discuss the trade-off: coloured noise preserves regularity but requires knowledge of 𝒞. Propose a practical scheme for choosing 𝒞 from training data.

Hint: For part (a), write the Ornstein–Uhlenbeck solution in integral form and compute the first two moments.

Exercise 57 (Grid Points for Direct Numerical Simulation).

3731END For DNS of three-dimensional homogeneous turbulence:

  1. Verify that the number of grid points per direction is N1d=L/ηReL3/4, so the total three-dimensional grid has N3d=N1d3ReL9/4 points.

  2. The CFL condition requires ΔtCCFLΔx/umax. Assuming umaxu and Δx=η, show that the number of time-steps for a simulation of duration TL/u (one large-eddy turnover time) is NtReL3/4.

  3. Conclude that the total computational cost (proportional to N3d×Nt) scales as ReL3.

  4. Fill in the following table:

    ReLN3dNtCost (relative)
    Lab scale102???
    Wind tunnel104???
    Atmosphere106???
    Astrophysical109???
    Express answers in scientific notation.

Exercise 58 (FNO Zero-Shot Super-Resolution).

3748END A key property of the FNO is that it can be trained at one resolution and evaluated at a different (typically higher) resolution without retraining. This is called zero-shot super-resolution.

  1. Explain why this property follows from the fact that the FNO parameterises its kernel in Fourier space with a fixed set of modes kkmax. Show that the learned weights R()(k) can be applied unchanged when the DFT is computed on a finer grid.

  2. Suppose the FNO is trained on grids of size 64. If we evaluate on a grid of size 256, what happens to the Fourier modes k>kmax? Are they zero, or do they carry information?

  3. Prove that if the underlying solution uHs and the FNO has kmax modes, then the super-resolution error is bounded by the sum of (i) the training-resolution approximation error and (ii) an aliasing term of order O(kmaxs).

  4. DeepONet does not enjoy zero-shot super-resolution by default. Explain why, in terms of its trunk-net architecture.

Exercise 59 (Neural Tangent Kernel Spectral Bias for PINNs).

3757END Consider a two-layer network fϕ(x)=1mj=1majσ(wjx+bj) with σ=tanh and random initialisation wj,bj𝒩(0,1), aj𝒩(0,1).

  1. Compute the Neural Tangent Kernel (NTK) Θ(x,x)=ϕfϕ(x)ϕfϕ(x) at initialisation and show it converges (as m) to Θ(x,x)=𝔼[σ(wx+b)σ(wx+b)]xx+𝔼[σ(wx+b)σ(wx+b)].

  2. Compute the eigenvalues {λk} of Θ on [1,1] numerically (or argue qualitatively about their decay rate). Show that high-frequency eigenfunctions have small eigenvalues.

  3. Recall that gradient descent on the squared loss converges exponentially in each eigendirection at rate λk. Conclude that PINNs learn low-frequency components of the PDE solution much faster than high-frequency components (the “spectral bias”).

  4. Discuss how Fourier feature embeddings γ(x)=[cos(2πω1x),sin(2πω1x),] with large ωj can mitigate spectral bias by reshaping the NTK spectrum.

Exercise 60 (Causal Training Weights and Monotonicity).

3771END In the causal training formulation for PINNs, the loss at time ti is weighted by (Causal Weights)wi=exp(ϵj=1i1r(tj)), where r(tj) is the PDE residual loss at the j-th time slice and ϵ>0 is a steepness parameter.

  1. Show that w1=1 and 0<wi+1wi for all i, i.e., the weights are monotonically non-increasing.

  2. Prove that if r(tj)=0 for all j=1,,i1 (the PDE is satisfied exactly at earlier times), then wi=1, so the loss at time ti is given full weight.

  3. Conversely, show that if j<ir(tj) is large, then wi0, effectively ignoring future time slices until earlier ones are resolved.

  4. Interpret this mechanism in terms of the “causal structure” of time-dependent PDEs and explain why it prevents the optimizer from fitting the solution at late times before getting early times correct.

  5. Describe what happens in the limits ϵ0 and ϵ.

Exercise 61 (Break-Even: Neural Operators vs. FEM).

3788END Suppose a finite element solver requires CFEM(N)=αNlogN time to solve a PDE on a mesh with N degrees of freedom, where α is a hardware-dependent constant. A neural operator has:

  • Offline training cost: Ctrain=βNtrainEN, where Ntrain is the number of training samples, E is the number of epochs, and β is a constant.

  • Online inference cost per query: Cinfer=γN.

  1. Derive the break-even number of queries Q above which the neural operator is cheaper than running the FEM solver Q times. That is, find Q such that Ctrain+QCinfer=QCFEM(N).

  2. Compute Q for N=104, Ntrain=1000, E=500, α=107, β=108, γ=106. Is the break-even point practical for engineering design-space exploration?

  3. How does Q scale with N? At what problem size does the neural operator become most advantageous?

  4. Discuss factors this simple model ignores (accuracy degradation, GPU vs. CPU differences, data generation cost, etc.).

Exercise 62 (DeepONet and the Universal Approximation Theorem for Operators).

3810END The universal approximation theorem for operators (Chen & Chen, 1995) states that any continuous operator 𝒢:C(Ω1)C(Ω2) can be approximated to arbitrary accuracy by a network of the form 𝒢(v)(y)k=1pbk(v(x1),,v(xm))branch nettk(y)trunk net, where {x1,,xm}Ω1 are fixed sensor locations, bk are continuous functions, and tk are continuous functions of the output coordinate.

  1. Explain why this architecture can be viewed as a finite-rank approximation to the operator 𝒢, with rank p.

  2. Show that if 𝒢 is a linear operator (e.g., the solution operator of a linear PDE), then the branch outputs bk can be chosen as linear functions of the sensor values.

  3. Discuss the limitation: the sensor locations {xi} are fixed at training time. Why does this prevent straightforward super-resolution, and how do recent “continuous sensor” extensions address this?

  4. Contrast DeepONet's approximation-theoretic guarantee with the FNO's: which architecture provides stronger guarantees for operators with translation-invariant kernels, and why?

Exercise 63 (Denoising Score Matching on Discretised Fields).

3821END Let {𝐮(i)}i=1M be a dataset of discretised PDE solutions, each 𝐮(i)N (values on an N-point grid). A score network 𝐬θ(𝐮t,t) is trained with the denoising score matching loss: (DSM)DSM(θ)=𝔼t,𝐮0,𝝐[𝐬θ(𝐮t,t)+𝝐1αt2].

  1. Show that the optimal score network satisfies 𝐬θ(𝐮t,t)=𝐮tlogpt(𝐮t).

  2. If 𝐮0 comes from a distribution supported on smooth functions (e.g., Hs for large s), argue that the score at small noise levels concentrates near a lower-dimensional manifold in N.

  3. Discuss the implications for architecture choice: why might a U-Net (which respects spatial locality) or an FNO (which operates in frequency space) be more appropriate than a generic MLP as the backbone for 𝐬θ?

Exercise 64 (Variational Formulation of Causal PINNs).

3833END Consider the loss functional over the time domain [0,T]: 𝒥[uϕ]=0Tw(t)rϕ(,t)L2(Ω)2dt, where rϕ is the PDE residual and w(t) is a non-negative weight function.

  1. Show that if w(t)1 (standard PINN), then the optimizer may reduce rϕ(,t) at late times t while ignoring early times, violating causality.

  2. Define w(t)=exp(ϵ0trϕ(,s)L22ds) (the continuous analogue of (Causal Weights)). Show that w(t)0 whenever rϕ(,t)>0.

  3. Prove that in the limit ϵ, the causal loss converges to a time-stepping scheme: only the earliest time t at which rϕ(,t)>0 receives nonzero weight.

  4. Show that this limit recovers the sequential-in-time training strategy where we solve on [0,t1] first, then [t1,t2], and so on.

Hint: For part (c), use the fact that eϵx0 for any x>0 as ϵ.

Insight.

Connecting Exercises to Practice The pen-and-paper exercises above establish the mathematical scaffolding for the coding projects that follow. In particular: the PINN loss derivations (Exercises Exercise 46Exercise 48) are directly implemented in Project Exercise 65; the FNO kernel analysis (Exercise 49) underpins Project Exercise 66; and the score function derivation (Exercise 51) is essential for Projects Exercise 68 and Exercise 73.

Coding Projects

The following projects are designed to be completed in two to four weeks each, assuming familiarity with PyTorch (or JAX) and basic numerical PDE methods. Each project specifies the expected deliverables, suggested architecture, and evaluation criteria. Projects marked with require GPU access; all others can be completed on a laptop CPU (though GPU acceleration is always welcome).

Key Idea.

Project Infrastructure All projects assume the following common infrastructure:

  • Framework: PyTorch 2.0 or JAX 0.4.

  • Visualisation: Matplotlib for 1D/2D plots; optionally Plotly for interactive 3D visualisation.

  • Data: Unless stated otherwise, training data should be generated using a reference solver (e.g., scipy.integrate, spectral methods, or PDEBench datasets).

  • Reproducibility: Fix random seeds and report all hyperparameters.

Exercise 65 (PINN for the 2D Heat Equation ).

3856END Goal: Implement a Physics-Informed Neural Network to solve the two-dimensional heat equation ut=κ(2ux2+2uy2),(x,y)(0,1)2,t(0,1], with initial condition u(x,y,0)=sin(πx)sin(πy) and homogeneous Dirichlet boundary conditions.

Architecture:

  • MLP with 4 hidden layers of width 64, tanh activations.

  • Input: (x,y,t)3. Output: u^.

  • Use Xavier initialisation for all weight matrices.

Tasks:

  1. Implement the PINN loss with Nr=10,000 interior collocation points (sampled uniformly), Nb=2,000 boundary points, and N0=2,000 initial condition points.

  2. Train using Adam for 20,000 iterations with learning rate 103, then L-BFGS for fine-tuning.

  3. Compare the PINN solution against the exact solution u(x,y,t)=e2κπ2tsin(πx)sin(πy) for κ=0.1.

  4. Experiment with loss weights λr,λb,λ0 and document the effect on accuracy.

  5. Add Fourier feature embeddings γ(x,y,t)=[cos(2π𝐁𝐳),sin(2π𝐁𝐳)] with 𝐳=(x,y,t) and random 𝐁, and compare convergence speed.

Deliverables:

  • Convergence curves (loss vs. iteration) for all experiments.

  • Heat maps of u^(x,y,t) at t=0,0.25,0.5,1.0.

  • Pointwise error maps |uexactu^| at the same time snapshots.

  • Table of relative L2 errors: uexactu^L2/uexactL2.

Exercise 66 (FNO for the 1D Burgers Equation ).

3878END Goal: Build and train a Fourier Neural Operator (FNO) that maps initial conditions to solutions of the 1D viscous Burgers equation at time t=1, and test its zero-shot super-resolution capability.

Data generation:

  • Generate Ntrain=1,000 initial conditions u0(x)𝒢𝒫(0,k) on [0,2π) with periodic boundary conditions, where k is a Matérn-5/2 kernel with length-scale =0.5.

  • Solve each instance using a pseudo-spectral method on a 1024-point grid with ν=0.1.

  • Downsample to 256 points for training.

Architecture:

  • 4 Fourier layers with kmax=16 modes, hidden width dv=64.

  • Lifting layer: pointwise MLP from 1 to 64.

  • Projection layer: pointwise MLP from 64 to 1.

  • GeLU activations after each Fourier layer.

Tasks:

  1. Train the FNO on 256-point data for 500 epochs with the relative L2 loss.

  2. Evaluate on held-out test data (Ntest=200) at the training resolution (256).

  3. Zero-shot super-resolution: Without retraining, evaluate the same model on 512-point and 1024-point grids. Report how the relative L2 error changes.

  4. Ablation: vary kmax{4,8,16,32} and plot test error vs. kmax.

  5. Compare against a purely convolutional baseline (U-Net) and show the U-Net fails at super-resolution.

Deliverables:

  • Training curves and test errors at all resolutions.

  • Visualisation of 5 predicted vs. ground-truth solutions.

  • Super-resolution comparison figure (FNO vs. U-Net at 1024 points).

  • Ablation table for kmax.

Exercise 67 (DeepONet for the Parametric Poisson Equation).

3907END Goal: Implement a DeepONet to learn the solution operator 𝒢:fu of the Poisson equation Δu=f(x,y) on (0,1)2 with homogeneous Dirichlet boundary conditions.

Data:

  • Generate 1,500 random source terms f(x,y)=k=1Kcksin(k1πx)sin(k2πy) with random coefficients ck𝒩(0,k2) and K=20 modes.

  • Solve using a spectral method (exact for this basis) on a 64×64 grid.

Architecture:

  • Branch net: MLP taking sensor values (f(x1s),,f(xms)) at m=100 fixed sensor locations (uniform grid), outputting 𝐛p with p=100.

  • Trunk net: MLP taking (x,y) and outputting 𝐭p.

  • Prediction: u^(x,y;f)=k=1pbk(f)tk(x,y).

Tasks:

  1. Train the DeepONet on the MSE loss with 1,000 training pairs and 500 for validation.

  2. Evaluate generalisation to source terms not in the training set.

  3. Experiment with the number of trunk/branch basis functions p and the number of sensor points m.

  4. Compare against the FNO (adapted for this problem) in terms of accuracy and inference speed.

Deliverables:

  • Scatter plots of predicted vs. true solution values.

  • Relative L2 error distribution over the test set (histogram).

  • Ablation study over p and m.

Exercise 68 (Diffusion Model for 1D PDE Solution Fields ).

3931END Goal: Train a denoising diffusion probabilistic model (DDPM) to generate samples from the distribution of 1D Burgers equation solutions at t=1, conditioned on the viscosity ν.

Data:

  • Generate 5,000 solution fields on a 128-point grid for random initial conditions and viscosities ν{0.001,0.01,0.1} (uniformly sampled).

Architecture:

  • Score network: 1D U-Net with 3 downsampling/upsampling levels, residual blocks, and sinusoidal time embeddings.

  • Conditioning: concatenate ν (after MLP embedding) to the time embedding.

  • Noise schedule: linear βt from 104 to 0.02 over T=1000 steps.

Tasks:

  1. Implement the forward diffusion process and verify that 𝐮T is approximately standard Gaussian.

  2. Train the score network using the simplified DDPM loss 𝝐θ(𝐮t,t,ν)𝝐2.

  3. Generate 500 samples for each viscosity value and compute: itemize

  4. The marginal distribution of the solution at each grid point.

  5. The energy spectrum E(k)=|u^(k)|2 averaged over samples, compared to the ground-truth spectrum.

  6. Point-wise mean and standard deviation of generated fields vs. the true statistics. itemize

  7. Implement classifier-free guidance for the viscosity condition and show that higher guidance scales produce solutions that more faithfully match the conditioned viscosity (at the cost of diversity).

Deliverables:

  • Generated solution fields (10 per condition) overlaid on training data.

  • Energy spectrum comparison plots.

  • FID-like metric adapted to 1D fields (e.g., Wasserstein distance between the generated and true marginals at each grid point).

  • Guidance scale ablation.

Exercise 69 (Causal PINN for Advection-Dominated PDEs).

3945END Goal: Implement the causal training scheme for PINNs and demonstrate its advantage over standard PINNs on the 1D advection equation and the inviscid Burgers equation.

Problem 1 (linear advection): ut+cux=0,x(0,2π),t(0,2],u(x,0)=sin(x),c=1.

Problem 2 (inviscid Burgers): ut+uux=0,x(1,1),t(0,1],u(x,0)=sin(πx).

Tasks:

  1. Implement the standard PINN (uniform collocation) for both problems. Document the failure mode: the PINN “cheats” by fitting the solution globally rather than respecting temporal causality.

  2. Implement causal weighting ((Causal Weights)) with Nt=100 time slices.

  3. Compare standard vs. causal PINNs: itemize

  4. Plot the predicted solution at t=0.5,1.0,1.5 for Problem 1.

  5. Plot the predicted solution at t=0.25,0.5,0.75 for Problem 2.

  6. Plot the causal weights wi as a function of training iteration to visualise the “wavefront” of learning propagating forward in time. itemize

  7. Ablation over ϵ{1,10,100,1000}.

Deliverables:

  • Side-by-side comparison of standard vs. causal PINN solutions.

  • Animation (or multi-panel figure) showing causal weight evolution during training.

  • Relative L2 error table for both methods and both problems.

Exercise 70 (Conditional Diffusion Model for Darcy Flow Inversion ).

3955END Goal: Build a conditional diffusion model that samples from the posterior distribution of permeability fields a(x,y) given sparse pressure observations, for the steady-state Darcy flow equation: (a(x,y)p(x,y))=f(x,y),(x,y)(0,1)2.

Data:

  • Use the Darcy flow dataset from PDEBench (or generate your own): 2,000 log-Gaussian permeability fields loga𝒢𝒫(0,k) on a 64×64 grid.

  • For each a, solve the PDE to obtain p(x,y).

  • Simulate “observations”: extract pressure values at M=25 randomly placed sensor locations with additive Gaussian noise (σobs=0.01).

Architecture:

  • 2D U-Net score network taking at (the noised permeability field) and outputting the denoised prediction.

  • Conditioning: concatenate the sparse observation map (a 64×64 image with zeros except at sensor locations) as an extra input channel.

Tasks:

  1. Train the conditional diffusion model.

  2. For 20 held-out test cases, generate 50 posterior samples each.

  3. Evaluate: itemize

  4. Posterior mean vs. true permeability (relative L2 error).

  5. Posterior standard deviation (uncertainty map)-does it correctly identify regions far from sensors as more uncertain?

  6. Calibration: do 90% credible intervals contain the true value approximately 90% of the time? itemize

  7. Compare against a simple MAP estimate (e.g., from gradient descent on the log-posterior).

Deliverables:

  • Posterior samples visualised alongside ground truth for 5 test cases.

  • Uncertainty maps and calibration plots.

  • Quantitative comparison table (RMSE, calibration score, etc.).

Exercise 71 (Transformer Neural Operator on PDEBench ).

3969END Goal: Implement a simple Transformer-based neural operator and evaluate it on PDEBench datasets, comparing against the FNO baseline.

Architecture:

  • Tokenise the spatial field into patches (e.g., 8×8 patches for a 64×64 field).

  • Add learnable positional embeddings.

  • Apply L=6 Transformer encoder layers with dmodel=256 and nheads=8.

  • Decode via a linear projection back to patch space, then reshape to the output field.

Tasks:

  1. Implement the architecture in PyTorch, paying careful attention to how spatial structure is encoded through patch tokenisation and positional embeddings.

  2. Train on the PDEBench 2D diffusion–reaction equation dataset (or the compressible Navier–Stokes dataset if GPU resources permit).

  3. Compare against the FNO baseline provided by PDEBench using: itemize

  4. Relative L2 error on the test set.

  5. Inference time per sample.

  6. Memory footprint (peak GPU memory during training). itemize

  7. Experiment with patch size: compare 4×4, 8×8, and 16×16 patches.

  8. (Bonus) Implement cross-attention conditioning on PDE parameters (viscosity, diffusion coefficient) and evaluate whether it improves over simple concatenation.

Deliverables:

  • Predicted vs. ground-truth solution fields for 5 test cases.

  • Comparison table: Transformer vs. FNO (error, speed, memory).

  • Patch size ablation.

Exercise 72 (Deterministic vs. Generative Surrogates on Turbulent Flow ).

3980END Goal: Compare a deterministic neural operator (FNO) against a conditional diffusion model on 2D turbulent Kolmogorov flow, focusing on whether the generative model produces physically meaningful statistics.

Data:

  • Simulate 2D Navier–Stokes with Kolmogorov forcing 𝐟=(sin(4y),0) on a doubly-periodic domain [0,2π]2 at Re=1,000, using a pseudo-spectral solver on a 256×256 grid.

  • Generate 5,000 snapshots of the vorticity field ω(x,y) from the statistically stationary regime.

  • Task: given ω at time t, predict ω at time t+Δt for Δt corresponding to 0.5 large-eddy turnover times.

Tasks:

  1. Train an FNO to predict ω(t+Δt) given ω(t) using the MSE loss.

  2. Train a conditional DDPM with the same U-Net backbone, conditioning on ω(t).

  3. Evaluate both models on: itemize

  4. Pointwise error: relative L2 error on 200 test snapshots.

  5. Energy spectrum: compute the 2D energy spectrum E(k)=|𝐤|=k|ω^(𝐤)|2 averaged over test samples.

  6. Vorticity PDF: compare the probability distribution of vorticity values across the field.

  7. Structure functions: Sp(r)=|ω(𝐱+𝐫)ω(𝐱)|p for p=2,4. itemize

  8. Show that the FNO produces solutions that are blurrier (suppressed high-k energy) while the diffusion model produces sharp, physically realistic vorticity fields.

Deliverables:

  • Side-by-side visualisations of ground truth, FNO prediction, and diffusion model samples.

  • Energy spectrum comparison (log-log plot).

  • Vorticity PDF comparison.

  • Structure function comparison.

  • Discussion of when each approach is preferable.

Exercise 73 (Physics-Informed Diffusion Model (PIDM) ).

4002END Goal: Implement a simplified physics-informed diffusion model that incorporates PDE residual constraints into the diffusion training and/or sampling process.

Approach: Choose one (or compare both) of the following strategies:

  • Training-time physics: Add a PDE residual penalty to the DDPM loss: =DDPM+λ𝔼t,𝐮0[𝒩[𝐮^0]2], where 𝐮^0 is the denoised prediction from the ϵ-network at step t.

  • Sampling-time physics (guidance): During the reverse diffusion process, add a gradient correction at each step: 𝝐~t=𝝐θ(𝐮t,t)1αtλ𝐮t𝒩[𝐮^0]2.

Test problem: Steady-state Darcy flow (au)=f on (0,1)2, generating solution fields u given fixed f and varying permeability a.

Tasks:

  1. Implement both physics-integration strategies.

  2. Compare against: (i) a data-only diffusion model (no physics) and (ii) a pure PINN.

  3. Evaluate with varying amounts of training data (N{100,500,1000,5000}) to test whether physics constraints improve data efficiency.

  4. Measure the fraction of generated samples that satisfy a physics-consistency check (PDE residual below a threshold).

Deliverables:

  • Comparison table: data-only diffusion vs. training-time PIDM vs. sampling-time PIDM vs. PINN.

  • Data efficiency curves (test error vs. Ntrain).

  • Physics consistency histograms.

  • Discussion of computational overhead of each approach.

Exercise 74 (Reproducing PDEBench Results with FNO ).

4016END Goal: Reproduce the key FNO baseline results from the PDEBench benchmark paper across three different PDE families, establishing a personal understanding of the state of the art.

Datasets (from PDEBench):

  1. 1D advection equation (varying wave speed c).

  2. 1D diffusion–reaction equation (varying diffusion coefficient ν).

  3. 2D compressible Navier–Stokes (if GPU resources allow; otherwise, 2D diffusion–reaction).

Tasks:

  1. Download and preprocess the PDEBench datasets.

  2. Implement the FNO architecture matching the PDEBench paper specifications (or use the official PDEBench code).

  3. Train the FNO on each dataset with the hyperparameters reported in the paper.

  4. Report relative L2 errors and compare against the published values. Identify and explain any discrepancies (random seed sensitivity, hardware differences, etc.).

  5. (Bonus) Add one additional baseline (e.g., U-Net or DeepONet) and compare.

Deliverables:

  • Reproduction table matching the format of the PDEBench paper.

  • Training curves for all experiments.

  • Analysis of any discrepancies between your results and the published numbers.

  • (Bonus) Extended comparison table with additional baselines.

Insight.

Scaling Your Projects These projects are intentionally scoped for educational purposes. To extend them toward research-level work, consider: (i) scaling to 3D domains and higher resolutions; (ii) incorporating multi-step autoregressive rollouts for time-dependent problems; (iii) adding physical invariances (conservation laws, symmetries) as hard constraints; (iv) testing on real-world engineering datasets rather than synthetic benchmarks.

Challenge Problems

The following challenge problems are deliberately open-ended and sit at the frontier of current research. There is no single “correct” answer; instead, the goal is to develop creative solutions, identify fundamental limitations, and-ideally-push the state of the art. Each problem could form the basis of a research paper or a master's thesis.

Key Idea.

What Makes a Good Research Contribution A strong response to these challenges should include: (1) a clear formulation of the problem; (2) a principled approach grounded in the theory of this chapter; (3) careful experimental evaluation with appropriate baselines; (4) honest discussion of limitations and failure modes; and (5) concrete suggestions for future work.

Challenge 8 (Discovering Scaling Laws in Turbulence via Generative Models).

4020END

Motivation. One of the most celebrated results in turbulence theory is the Kolmogorov 1941 (K41) prediction that the energy spectrum in the inertial range scales as E(k)k5/3, and that the p-th order structure functions scale as Sp(r)rζp with ζp=p/3. However, real turbulence exhibits anomalous scaling: the exponents ζp deviate from p/3 for p4, a phenomenon known as intermittency. Measuring these exponents accurately requires vast amounts of data, which is expensive to obtain from DNS or experiments.

The Challenge. Can a generative model trained on moderate-Reynolds-number DNS data learn the correct anomalous scaling exponents? Can it extrapolate scaling behaviour to Reynolds numbers beyond the training data?

Suggested Approach:

  1. Generate DNS data for 2D or 3D Navier–Stokes at Re{500,1000,2000,4000}.

  2. Train a conditional diffusion model on vorticity snapshots, conditioned on Re.

  3. Generate large ensembles of vorticity fields at each Re-orders of magnitude more samples than available from DNS.

  4. Compute structure functions Sp(r) for p=1,,8 from the generated ensembles and estimate the scaling exponents ζp.

  5. Compare against: (i) exponents from the DNS data directly; (ii) K41 predictions; (iii) the She–Lévêque model ζp=p/9+2(1(2/3)p/3).

  6. Test extrapolation: condition the model on Re=8000 (unseen during training) and evaluate whether the generated statistics are physically plausible.

Key Questions:

  • Does the diffusion model capture the non-Gaussian tails of the vorticity gradient distribution (a hallmark of intermittency)?

  • At what order p do the generated structure functions begin to deviate from the ground truth? Is this a fundamental limitation of the generative model, or a training data issue?

  • Can you identify a neural scaling law: how does the quality of the generated turbulence statistics scale with model size, training data volume, and Reynolds number?

Challenge 9 (Discretisation-Agnostic Diffusion Model for 2D PDEs).

4037END

Motivation. Most neural PDE solvers are tied to a specific grid: the FNO uses uniform grids and the FFT; U-Nets use regular pixel grids; DeepONet uses fixed sensor locations. Real-world engineering meshes are unstructured: they contain triangles of varying sizes, refined near boundaries and coarsened in the interior. A truly general generative PDE solver should be invariant to the choice of discretisation.

The Challenge. Design a diffusion model that operates on point clouds or unstructured meshes rather than regular grids, and demonstrate that it generates valid PDE solutions regardless of the mesh used at test time.

Suggested Approach:

  1. Choose a test problem: e.g., flow around a cylinder at varying Reynolds numbers, or heat conduction in domains with complex geometry.

  2. Generate training data on multiple different meshes (varying resolution, topology, and element type).

  3. Design a score network that is permutation-equivariant over mesh nodes. Options include: itemize

  4. Graph neural networks (GNNs) operating on the mesh connectivity.

  5. Point-cloud Transformers with positional encoding of node coordinates.

  6. A hybrid: local GNN message passing + global attention. itemize

  7. Train the diffusion model on data from multiple meshes simultaneously, ensuring the model sees a variety of discretisations.

  8. Test on held-out meshes that differ from any seen during training.

Key Questions:

  • How do you define the forward diffusion process on an irregular mesh? Is it sufficient to add i.i.d. noise at each node, or should the noise covariance reflect the mesh geometry (e.g., scale with the local element area)?

  • How does the quality of generated solutions depend on the mesh quality (aspect ratio, element size variation)?

  • Can the model generate solutions on meshes with significantly more nodes than those seen during training?

Challenge 10 (Compositional Multiphysics Generation).

4038END

Motivation. Real-world physical systems involve coupled PDEs: fluid–structure interaction (Navier–Stokes + elasticity), conjugate heat transfer (fluid flow + solid conduction), reactive flows (Navier–Stokes + species transport + chemical kinetics). Training a single monolithic model for each coupling is expensive and inflexible. The vision of compositional generation is to train individual diffusion models for each physics domain and compose them at sampling time to generate solutions to the coupled system.

The Challenge. Implement a simplified version of compositional multiphysics generation and demonstrate it on a coupled problem.

Suggested Approach:

  1. Choose a coupled problem, e.g., 2D natural convection (Boussinesq equations): the Navier–Stokes equations for velocity 𝐯 are coupled to an advection–diffusion equation for temperature T via a buoyancy term.

  2. Train two separate diffusion models: itemize

  3. Model A: generates velocity fields 𝐯(x,y) conditioned on a temperature field T.

  4. Model B: generates temperature fields T(x,y) conditioned on a velocity field 𝐯. itemize

  5. At sampling time, compose the two models using an alternating Gibbs-like scheme: enumerate[label=()]

  6. Initialise T(0) from prior.

  7. Sample 𝐯(k)pA(𝐯|T(k1)).

  8. Sample T(k)pB(T|𝐯(k)).

  9. Repeat until convergence. enumerate

  10. Compare against: (i) a single monolithic diffusion model trained on the coupled system; (ii) a traditional iterative solver.

Key Questions:

  • Does the compositional scheme converge? Under what conditions?

  • How does the quality of compositional samples compare to the monolithic model?

  • What is the wall-clock advantage, if any, of training two smaller models vs. one large model?

  • Can you compose more than two physics domains? What are the scaling challenges?

Challenge 11 (PDE Foundation Model).

4048END

Motivation. Language models have demonstrated remarkable transfer across tasks through large-scale pretraining. Can the same paradigm work for PDEs? A PDE foundation model would be pretrained on a diverse collection of PDE solutions and fine-tuned to new, unseen equation types with minimal data.

The Challenge. Build a neural operator that handles at least three qualitatively different PDE families using a single set of model weights, and demonstrate that pretraining on a mixture improves performance on each individual family compared to training from scratch.

Suggested Approach:

  1. Assemble a multi-PDE training dataset from PDEBench (or self-generated data) covering at least: itemize

  2. An elliptic PDE (e.g., Poisson, Darcy flow).

  3. A parabolic PDE (e.g., heat equation, diffusion–reaction).

  4. A hyperbolic PDE (e.g., advection, Burgers, compressible Euler). itemize

  5. Design a unified architecture. Key design decisions: itemize

  6. Tokenisation: How do you represent inputs/outputs from different PDEs in a common format? Options: shared spatial tokens with a PDE-type embedding; natural language descriptions of the equation; coefficient fields as extra input channels.

  7. Architecture: Transformer or FNO backbone? Shared weights or per-PDE heads?

  8. Loss: Multi-task loss with per-PDE weighting? itemize

  9. Pretrain on the mixture, then evaluate: itemize

  10. Zero-shot performance: without fine-tuning, how well does the model solve each PDE type?

  11. Few-shot transfer: given only 50 examples of a new PDE type (e.g., the KdV equation), how quickly can the model adapt?

  12. Negative transfer: does the mixture ever hurt performance on a specific PDE compared to training on that PDE alone? itemize

Key Questions:

  • What shared inductive biases, if any, does the model learn across PDE families? Can you visualise the learned representations to identify common features?

  • How should you balance the dataset sizes across PDE families to avoid the model being dominated by one family?

  • Is there a scaling law relating the total pretraining data volume (across PDE families) to downstream performance?

Challenge 12 (Probing Navier–Stokes Near-Singularity via Diffusion Sampling).

4049END

Motivation. The existence or non-existence of finite-time singularities in the 3D incompressible Navier–Stokes equations is one of the Clay Millennium Prize Problems. While a full resolution is far beyond current capabilities (analytical or computational), one can study near-singular behaviour: initial conditions that produce extremely large vorticity amplification before viscosity intervenes. Traditional DNS struggles to resolve such events because the grid must be refined adaptively to capture the near-singular vortex structures.

The Challenge. Use a diffusion model to explore the space of initial conditions that lead to extreme vorticity amplification in 3D Navier–Stokes, going beyond what a uniform-sampling approach would discover.

Suggested Approach:

  1. Work in a simplified setting: 3D Navier–Stokes on a periodic box [0,2π]3 at moderate resolution (643 or 1283) with Re=1,600 (the Taylor–Green vortex regime).

  2. Generate a dataset of initial vorticity fields ω0 and their corresponding maximum vorticity amplification A=maxt[0,T]ω(,t)/ω0.

  3. Train a conditional diffusion model to generate ω0 conditioned on a target amplification factor A.

  4. Use importance-guided sampling: bias the diffusion sampling toward initial conditions with high A values (analogous to classifier guidance).

  5. Analyse the geometry of the discovered high-amplification initial conditions: itemize

  6. Do they exhibit anti-parallel vortex tubes (as predicted by the Beale–Kato–Majda criterion)?

  7. How does the maximum enstrophy ωL22 scale with A?

  8. Is there a pattern in the Fourier spectrum of high-amplification initial conditions? itemize

Key Questions:

  • Can the diffusion model discover initial conditions with amplification factors significantly higher than any in the training set? (This would constitute a form of extrapolation.)

  • How does the maximum observed amplification scale with the Reynolds number? The Beale–Kato–Majda theorem implies that singularity requires 0Tωdt=. Can you observe trends approaching this regime?

  • What are the fundamental limitations of this approach? The resolution 643 clearly cannot resolve a true singularity; how do you distinguish genuine near-singular behaviour from numerical artefacts?

  • Could this approach serve as a complement to traditional numerical analysis of singularity formation, by efficiently searching the (infinite-dimensional) space of initial conditions?

!

figureWorkflow for Challenge Challenge 12: using diffusion models to discover near-singular initial conditions for 3D Navier–Stokes, followed by high-resolution verification and geometric analysis.

Key Idea.

From Exercises to Research The trajectory from pen-and-paper exercises through coding projects to challenge problems mirrors the path from student to researcher. The exercises build fluency with the mathematical language; the projects develop practical skills with modern frameworks and datasets; and the challenges require the creative synthesis of ideas that defines original scientific work. We encourage every reader to attempt at least one challenge problem-even a partial attempt that fails instructively is worth more than a polished reproduction.

Notes

  1. We assume well-posedness-existence, uniqueness, and continuous dependence on data-as guaranteed by the Lax–Milgram theorem, the Banach fixed-point theorem, or other classical PDE theory, depending on the equation class.