HardFlow: Hard-Constrained Sampling for Flow-Matching Models via Trajectory Optimization
- URL: http://arxiv.org/abs/2511.08425v1
- Date: Wed, 12 Nov 2025 01:58:20 GMT
- Title: HardFlow: Hard-Constrained Sampling for Flow-Matching Models via Trajectory Optimization
- Authors: Zeyang Li, Kaveh Alim, Navid Azizan,
- Abstract summary: We introduce a novel framework that reformulates hard-constrained sampling as a trajectory optimization problem.<n>Our key insight is to leverage numerical optimal control to steer the sampling trajectory so that constraints are satisfied precisely at the terminal time.<n>Our algorithm, which we name $textitHardFlow$, substantially outperforms existing methods in both constraint satisfaction and sample quality.
- Score: 4.249024052507976
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Diffusion and flow-matching have emerged as powerful methodologies for generative modeling, with remarkable success in capturing complex data distributions and enabling flexible guidance at inference time. Many downstream applications, however, demand enforcing hard constraints on generated samples (for example, robot trajectories must avoid obstacles), a requirement that goes beyond simple guidance. Prevailing projection-based approaches constrain the entire sampling path to the constraint manifold, which is overly restrictive and degrades sample quality. In this paper, we introduce a novel framework that reformulates hard-constrained sampling as a trajectory optimization problem. Our key insight is to leverage numerical optimal control to steer the sampling trajectory so that constraints are satisfied precisely at the terminal time. By exploiting the underlying structure of flow-matching models and adopting techniques from model predictive control, we transform this otherwise complex constrained optimization problem into a tractable surrogate that can be solved efficiently and effectively. Furthermore, this trajectory optimization perspective offers significant flexibility beyond mere constraint satisfaction, allowing for the inclusion of integral costs to minimize distribution shift and terminal objectives to further enhance sample quality, all within a unified framework. We provide a control-theoretic analysis of our method, establishing bounds on the approximation error between our tractable surrogate and the ideal formulation. Extensive experiments across diverse domains, including robotics (planning), partial differential equations (boundary control), and vision (text-guided image editing), demonstrate that our algorithm, which we name $\textit{HardFlow}$, substantially outperforms existing methods in both constraint satisfaction and sample quality.
Related papers
- Aligning Latent Spaces with Flow Priors [72.24305287508474]
This paper presents a novel framework for aligning learnable latent spaces to arbitrary target distributions by leveraging flow-based generative models as priors.<n> Notably, the proposed method eliminates computationally expensive likelihood evaluations and avoids ODE solving during optimization.
arXiv Detail & Related papers (2025-06-05T16:59:53Z) - Single-loop Algorithms for Stochastic Non-convex Optimization with Weakly-Convex Constraints [49.76332265680669]
This paper examines a crucial subset of problems where both the objective and constraint functions are weakly convex.<n>Existing methods often face limitations, including slow convergence rates or reliance on double-loop designs.<n>We introduce a novel single-loop penalty-based algorithm to overcome these challenges.
arXiv Detail & Related papers (2025-04-21T17:15:48Z) - Taming Flow Matching with Unbalanced Optimal Transport into Fast Pansharpening [10.23957420290553]
We propose the Optimal Transport Flow Matching framework to achieve one-step, high-quality pansharpening.<n>The OTFM framework enables simulation-free training and single-step inference while maintaining strict adherence to pansharpening constraints.
arXiv Detail & Related papers (2025-03-19T08:10:49Z) - Gradient-Free Generation for Hard-Constrained Systems [41.558608119074755]
Existing constrained generative models rely heavily on gradient information, which is often sparse or computationally expensive in some fields.<n>We introduce a novel framework for adapting pre-trained, unconstrained flow-matching models to satisfy constraints exactly in a zero-shot manner.
arXiv Detail & Related papers (2024-12-02T18:36:26Z) - Optimization-Driven Adaptive Experimentation [7.948144726705323]
Real-world experiments involve batched & delayed feedback, non-stationarity, multiple objectives & constraints, and (often some) personalization.
Tailoring adaptive methods to address these challenges on a per-problem basis is infeasible, and static designs remain the de facto standard.
We present a mathematical programming formulation that can flexibly incorporate a wide range of objectives, constraints, and statistical procedures.
arXiv Detail & Related papers (2024-08-08T16:29:09Z) - Model-Free Active Exploration in Reinforcement Learning [53.786439742572995]
We study the problem of exploration in Reinforcement Learning and present a novel model-free solution.
Our strategy is able to identify efficient policies faster than state-of-the-art exploration approaches.
arXiv Detail & Related papers (2024-06-30T19:00:49Z) - Diffusion Models as Constrained Samplers for Optimization with Unknown Constraints [55.39203337683045]
We propose to perform optimization within the data manifold using diffusion models.<n>Depending on the differentiability of the objective function, we propose two different sampling methods.<n>Our method achieves better or comparable performance with previous state-of-the-art baselines.
arXiv Detail & Related papers (2024-02-28T03:09:12Z) - DiffuSolve: Diffusion-based Solver for Non-convex Trajectory Optimization [9.28162057044835]
Optimal trajectory local is computationally expensive for nonlinear and high-dimensional dynamical systems.
In this paper we introduce Diffu-based general model for non-dimensional optima problems.
We also present Diff+, a novel constrained diffusion model with an additional loss in that further reduces the problem violations.
arXiv Detail & Related papers (2024-02-22T03:52:17Z) - Constrained Stein Variational Trajectory Optimization [5.317624228510749]
We present CSVTO, an algorithm for performing trajectory optimization with constraints on a set of trajectories in parallel.
By explicitly generating diverse sets of trajectories, CSVTO is better able to avoid poor local minima.
We demonstrate that CSVTO outperforms baselines in challenging highly-constrained tasks.
arXiv Detail & Related papers (2023-08-23T12:58:40Z) - Approximating Constraint Manifolds Using Generative Models for
Sampling-Based Constrained Motion Planning [8.924344714683814]
This paper presents a learning-based sampling strategy for constrained motion planning problems.
We use Conditional Variversaational Autoencoder (CVAE) and Conditional Generative Adrial Net (CGAN) to generate constraint-satisfying sample configurations.
We evaluate the efficiency of these two generative models in terms of their sampling accuracy and coverage of sampling distribution.
arXiv Detail & Related papers (2022-04-14T07:08:30Z) - Modeling the Second Player in Distributionally Robust Optimization [90.25995710696425]
We argue for the use of neural generative models to characterize the worst-case distribution.
This approach poses a number of implementation and optimization challenges.
We find that the proposed approach yields models that are more robust than comparable baselines.
arXiv Detail & Related papers (2021-03-18T14:26:26Z) - The Simulator: Understanding Adaptive Sampling in the
Moderate-Confidence Regime [52.38455827779212]
We propose a novel technique for analyzing adaptive sampling called the em Simulator.
We prove the first instance-based lower bounds the top-k problem which incorporate the appropriate log-factors.
Our new analysis inspires a simple and near-optimal for the best-arm and top-k identification, the first em practical of its kind for the latter problem.
arXiv Detail & Related papers (2017-02-16T23:42:02Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.