Physics-Constrained Flow Matching: Sampling Generative Models with Hard Constraints
Utkarsh Utkarsh, Pengfei Cai, Alan Edelman, Rafael Gomez-Bombarelli, Christopher Vincent Rackauckas

TL;DR
This paper introduces PCFM, a novel framework for enforcing hard physical constraints in flow-based generative models, improving simulation accuracy for PDE-governed systems with complex features.
Contribution
We propose a zero-shot physics-constrained sampling method that guarantees arbitrary nonlinear constraints in pretrained flow models, addressing limitations of soft penalty approaches.
Findings
Outperforms baseline methods on PDEs with shocks and discontinuities
Ensures exact satisfaction of physical constraints at the final solution
Effective in both scientific and general-purpose generative modeling
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
Taxonomy
TopicsModel Reduction and Neural Networks · Generative Adversarial Networks and Image Synthesis · Machine Learning in Materials Science
