Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Physics-Constrained Flow Matching: Sampling Generative Models with Hard Constraints

About

Deep generative models have recently been applied to physical systems governed by partial differential equations (PDEs), offering scalable simulation and uncertainty-aware inference. However, enforcing physical constraints, such as conservation laws (linear and nonlinear) and physical consistencies, remains challenging. Existing methods often rely on soft penalties or architectural biases that fail to guarantee hard constraints. In this work, we propose Physics-Constrained Flow Matching (PCFM), a zero-shot inference framework that enforces arbitrary nonlinear constraints in pretrained flow-based generative models. PCFM continuously guides the sampling process through physics-based corrections applied to intermediate solution states, while remaining aligned with the learned flow and satisfying physical constraints. Empirically, PCFM outperforms both unconstrained and constrained baselines on a range of PDEs, including those with shocks, discontinuities, and sharp features, while ensuring exact constraint satisfaction at the final solution. Our method provides a flexible framework for enforcing hard constraints in both scientific and general-purpose generative models, especially in applications where constraint satisfaction is essential.

Utkarsh Utkarsh, Pengfei Cai, Alan Edelman, Rafael Gomez-Bombarelli, Christopher Vincent Rackauckas• 2025

Related benchmarks

TaskDatasetResultRank
Generative Flow ModelingDynamic Stall (test)
RE0.143
5
Forward problemDarcy (test)
RE3.13
5
Joint sparse reconstructionDarcy equation
Reconstruction Error (RE)22.1
5
Forward problemPoisson (test)
RE2.18
5
Inverse ProblemHelmholtz (test)
RE9.96
5
Joint sparse reconstructionHelmholtz equation
Relative Error (RE)88.1
5
Forward problemHelmholtz (test)
RE244
5
Inverse ProblemDarcy (test)
Relative Error10.7
5
Trajectory reconstructionBurgers' Equation (Boundary Condition)
Reconstruction Error (RE)179
5
Trajectory reconstruction1-dimensional dynamic Burgers' equation Sparse Obs. (test)
RE30.5
5
Showing 10 of 10 rows

Other info

Follow for update