Table of Contents
Fetching ...

Gradient-Free Generation for Hard-Constrained Systems

Chaoran Cheng, Boran Han, Danielle C. Maddix, Abdul Fatir Ansari, Andrew Stuart, Michael W. Mahoney, Yuyang Wang

TL;DR

This paper tackles the challenge of hard-constrained generation for PDE systems by proposing ECI sampling, a gradient-free framework that steers a pre-trained unconstrained flow-matching model toward exact constraint satisfaction in a zero-shot setting. The method interleaves extrapolation, correction, and interpolation at each sampling step to transfer constraint information from the final prediction back through the iterative flow, while controlling stochasticity via re-sampling. Empirically, ECI achieves state-of-the-art or competitive performance across multiple PDEs (Stokes, Heat, Darcy, Navier–Stokes) in generative and regression tasks, delivering exact constraint satisfaction, improved distributional fidelity (e.g., Fréchet Poseidon distance), and substantial efficiency gains over gradient-based baselines. This gradient-free approach enables robust zero-shot constrained generation and uncertainty-aware predictions, with potential applicability to broader SciML tasks beyond PDEs.

Abstract

Generative models that satisfy hard constraints are critical in many scientific and engineering applications, where physical laws or system requirements must be strictly respected. Many existing constrained generative models, especially those developed for computer vision, rely heavily on gradient information, which is often sparse or computationally expensive in some fields, e.g., partial differential equations (PDEs). In this work, we introduce a novel framework for adapting pre-trained, unconstrained flow-matching models to satisfy constraints exactly in a zero-shot manner without requiring expensive gradient computations or fine-tuning. Our framework, ECI sampling, alternates between extrapolation (E), correction (C), and interpolation (I) stages during each iterative sampling step of flow matching sampling to ensure accurate integration of constraint information while preserving the validity of the generation. We demonstrate the effectiveness of our approach across various PDE systems, showing that ECI-guided generation strictly adheres to physical constraints and accurately captures complex distribution shifts induced by these constraints. Empirical results demonstrate that our framework consistently outperforms baseline approaches in various zero-shot constrained generation tasks and also achieves competitive results in the regression tasks without additional fine-tuning.

Gradient-Free Generation for Hard-Constrained Systems

TL;DR

This paper tackles the challenge of hard-constrained generation for PDE systems by proposing ECI sampling, a gradient-free framework that steers a pre-trained unconstrained flow-matching model toward exact constraint satisfaction in a zero-shot setting. The method interleaves extrapolation, correction, and interpolation at each sampling step to transfer constraint information from the final prediction back through the iterative flow, while controlling stochasticity via re-sampling. Empirically, ECI achieves state-of-the-art or competitive performance across multiple PDEs (Stokes, Heat, Darcy, Navier–Stokes) in generative and regression tasks, delivering exact constraint satisfaction, improved distributional fidelity (e.g., Fréchet Poseidon distance), and substantial efficiency gains over gradient-based baselines. This gradient-free approach enables robust zero-shot constrained generation and uncertainty-aware predictions, with potential applicability to broader SciML tasks beyond PDEs.

Abstract

Generative models that satisfy hard constraints are critical in many scientific and engineering applications, where physical laws or system requirements must be strictly respected. Many existing constrained generative models, especially those developed for computer vision, rely heavily on gradient information, which is often sparse or computationally expensive in some fields, e.g., partial differential equations (PDEs). In this work, we introduce a novel framework for adapting pre-trained, unconstrained flow-matching models to satisfy constraints exactly in a zero-shot manner without requiring expensive gradient computations or fine-tuning. Our framework, ECI sampling, alternates between extrapolation (E), correction (C), and interpolation (I) stages during each iterative sampling step of flow matching sampling to ensure accurate integration of constraint information while preserving the validity of the generation. We demonstrate the effectiveness of our approach across various PDE systems, showing that ECI-guided generation strictly adheres to physical constraints and accurately captures complex distribution shifts induced by these constraints. Empirical results demonstrate that our framework consistently outperforms baseline approaches in various zero-shot constrained generation tasks and also achieves competitive results in the regression tasks without additional fine-tuning.

Paper Structure

This paper contains 60 sections, 1 theorem, 23 equations, 25 figures, 11 tables, 5 algorithms.

Key Result

Proposition 1

Suppose the corrected algorithm $C(u_1,\mathcal{G})$ in Equation eqn:eci satisfies the constraint $\mathcal{G}$ exactly, then for any number of mixing steps $M\ge 1$, the ECI sampling scheme described in Algorithm alg:eci exactly recovers the constraint in the final generation at $t=1$.

Figures (25)

  • Figure 1: Hard-constrained generation of PDE solutions with the boundary condition (BC) or initial condition (IC) prescribed a posteriori. $\omega,k$ are PDE parameters that determine the IC and BC.
  • Figure 2: Generation mean and standard deviation errors for the Stokes problem with IC fixed. Note that grey indicates $\approx 0$ error, red for positive error, and blue for negative error. Noticeable IC errors (left column) can be observed for the gradient-based methods.
  • Figure 3: Generation mean and standard deviation errors of the trajectories for the NS equation with IC fixed. 25 downsampled time frames are plotted for each method.
  • Figure 4: MMSE and SMSE of ECI sampling with mixing iterations $M$ in different colors and re-sampling intervals $R$ in different markers in the Stokes problem with IC (left) or BC (right) fixed. "None" for no re-sampling (the initial noise is used).
  • Figure 5: Intermediate results (trajectory) of the extrapolation, correction, and interpolation stages for the Stokes problem with IC fixed. The trajectories demonstrate how the initial random noise gradually transforms into the controlled generation with decreasing artifacts around the boundary.
  • ...and 20 more figures

Theorems & Definitions (4)

  • Example 1
  • Example 2
  • Proposition 1
  • proof