Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Constraint-Aware Flow Matching via Randomized Exploration

About

We consider the problem of designing constraint-aware flow matching (FM) models that address the issue of constraint violations commonly observed in vanilla generative models. We consider two scenarios, viz.: (a) when a differentiable distance function to the constraint set is given, and (b) when the constraint set is only available via queries to a membership oracle. For case (a), we propose a simple adaptation of the FM objective with an additional term that penalizes the distance between the constraint set and the generated samples. For case (b), we propose to employ randomization and learn a mean flow that is numerically shown to have a high likelihood of satisfying the constraints. This approach deviates significantly from existing works that require simple convex constraints, knowledge of a barrier function, or a reflection mechanism to constrain the probability flow. Furthermore, in the proposed setting we show that a two-stage approach, where both stages approximate the same original flow but with only the second stage probing the constraints via randomization, is more computationally efficient than the corresponding one-stage approach. Through several synthetic cases of constrained generation, we numerically show that the proposed approaches achieve significant gains in terms of constraint satisfaction while matching the target distributions. As a showcase for a practical oracle-based constraint, we show how our approach can be used for training an adversarial example generator, using queries to a hard-label black-box classifier. We conclude with several future research directions. Our code is available at https://github.com/ZhengyanHuan/FM-RE.

Zhengyan Huan, Jacob Boerma, Li-Ping Liu, Shuchin Aeron• 2025

Related benchmarks

TaskDatasetResultRank
Constrained Generationl2-ball constrained set (d=8) 1.0 (synthetic)
Constraint Violation Rate0.014
16
Synthetic generation under constraintsBox
SWD Score0.1228
14
Synthetic generation under constraintsSubspace
SWD0.0355
10
Synthetic generation under constraints2 boxes
SWD0.2104
10
Constrained Generationl2-ball constrained set d=20 1.0 (synthetic)
Constraint Violation Rate0.502
9
Constrained Generative Modeling20d l2 ball
SWD0.0086
7
Image GenerationMNIST Brightness constraint
FID5.86
3
Image ClassificationMNIST
L2 Norm5.47
3
Image ClassificationCIFAR-10 20% (test)
L2 Norm11.15
3
Image GenerationMNIST Thickness constraint
FID10.8
2
Showing 10 of 10 rows

Other info

Follow for update