mlsanityData to 7 Oct 2026

HardFlow: Hard-Constrained Sampling for Flow-Matching Models via Trajectory Optimization

arXiv 2511.08425 ↗First posted 11 Nov 2025cs.LG cs.SY eess.SYcited by 10

On the map: Diffusion models → Diffusion and flow policies for robotics

Abstract (arXiv)

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 textitHardFlow, substantially outperforms existing methods in both constraint satisfaction and sample quality.

Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Placed in Diffusion and flow policies for robotics, one of 14 directions in Diffusion models. Builds on 49 of its 66 references that are in the map. First posted on arXiv 11 Nov 2025.

Builds on

49 of 66 references.

Closest ancestors · 10

Same direction, newest first

  1. 2025SafeFlowMatcher: Safe and Fast Planning using Flow Matching with Control Barrier Functions29 Sep
  2. 2025DDAT: Diffusion Policies Enforcing Dynamically Admissible Robot Trajectories20 Feb
  3. 2025From Uncertain to Safe: Conformal Adaptation of Diffusion Models for Safe PDE Control4 Feb
  4. 2025Score as Action: Fine-Tuning Diffusion Generative Models by Continuous-time Reinforcement Learning3 Feb
  5. 2024Motion Planning Diffusion: Learning and Adapting Robot Motion Planning with Diffusion Models27 Dec
  6. 2024Fast and Robust Visuomotor Riemannian Flow Matching Policy14 Dec
  7. 2024Diffusion Predictive Control with Constraints12 Dec
  8. 2024Adjoint Matching: Fine-tuning Flow and Diffusion Generative Models with Memoryless Stochastic Optimal Control13 Sep
  9. 2023SafeDiffuser: Safe Planning with Diffusion Probabilistic Models31 May
  10. 2023Diffusion Policy: Visuomotor Policy Learning via Action Diffusion7 Mar

Other references · 39

  1. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
  2. 2020Denoising Diffusion Probabilistic Modelscited by 20,851
  3. 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,694
  4. 2018The Unreasonable Effectiveness of Deep Features as a Perceptual Metriccited by 11,029
  5. 2020Denoising Diffusion Implicit Modelscited by 9,655
  6. 2021Diffusion Models Beat GANs on Image Synthesiscited by 8,185
  7. 2015Deep Unsupervised Learning using Nonequilibrium Thermodynamicscited by 7,005
  8. 2022Classifier-Free Diffusion Guidancecited by 5,717
  9. 2022Flow Matching for Generative Modelingcited by 5,426
  10. 2024Scaling Rectified Flow Transformers for High-Resolution Image Synthesiscited by 4,094
  11. 2022Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flowcited by 3,550
  12. 2022Elucidating the Design Space of Diffusion-Based Generative Modelscited by 2,994
27 more
  1. 2017Progressive Growing of GANs for Improved Quality, Stability, and Variationcited by 2,967
  2. 2022Video Diffusion Modelscited by 2,280
  3. 2020D4RL: Datasets for Deep Data-Driven Reinforcement Learningcited by 1,406
  4. 2022Diffusion Posterior Sampling for General Noisy Inverse Problemscited by 1,375
  5. 2022Planning with Diffusion for Flexible Behavior Synthesiscited by 1,023
  6. 2024Movie Gen: A Cast of Media Foundation Modelscited by 614
  7. 2022Zero-Shot Image Restoration Using Denoising Diffusion Null-Space Modelcited by 574
  8. 2023Universal Guidance for Diffusion Modelscited by 426
  9. 2022PhysDiff: Physics-Guided Human Motion Diffusion Modelcited by 365
  10. 2024Pyramidal Flow Matching for Efficient Video Generative Modelingcited by 354
  11. 2021Path Integral Sampler: a stochastic control approach for samplingcited by 175
  12. 2022An optimal control perspective on diffusion-based generative modelingcited by 145
  13. 2023Denoising Diffusion Samplerscited by 144
  14. 2019Theoretical guarantees for sampling and inference in generative models with latent diffusionscited by 97
  15. 2024Constrained Synthesis with Projected Diffusion Modelscited by 83
  16. 2025Adjoint Sampling: Highly Scalable Diffusion Samplers via Adjoint Matchingcited by 78
  17. 2024Gradient Guidance for Diffusion Models: An Optimization Perspectivecited by 59
  18. 2024Symbolic Music Generation with Non-Differentiable Rule Guided Diffusioncited by 52
  19. 2024Towards Diverse Behaviors: A Benchmark for Imitation Learning with Human Demonstrationscited by 51
  20. 2025On the Guidance of Flow Matchingcited by 44
  21. 2025Diffusion Tree Sampling: Scalable inference-time alignment of diffusion modelscited by 31
  22. 2024CoBL-Diffusion: Diffusion-Based Conditional Robot Planning in Dynamic Environments Using Control Barrier and Lyapunov Functionscited by 30
  23. 2024Training Free Guided Flow Matching with Optimal Controlcited by 23
  24. 2025Training-Free Guidance Beyond Differentiability: Scalable Path Steering with Tree Search in Diffusion and Flow Modelscited by 23
  25. 2025Variational Control for Guidance in Diffusion Modelscited by 22
  26. 2025Training-Free Constrained Generation With Stable Diffusion Modelscited by 20
  27. 2025Projected Coupled Diffusion for Test-Time Constrained Joint Generationcited by 6

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 10.

10 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026MintFlow: Minimal Trajectory Intervention for Constrained Flow Matching
  2. 2026Constraint-Aware Flow Matching: Decision Aligned End-to-End Training for Constrained Sampling
  3. 2026ConFlow: Constraints-Guided Learning with Flow Matching for Motion Generation
  4. 2025Theoretical Guarantees for High Order Trajectory Refinement in Generative Flows
  5. 2025Chance-constrained Flow Matching for High-Fidelity Constraint-aware Generation
  6. 2025PegasusFlow: Parallel Rolling-Denoising Score Sampling for Robot Diffusion Planner Flow Matching
  7. 2024Gradient-Free Generation for Hard-Constrained Systems
  8. 2026Enforcing Constraints in Generative Sampling via Adaptive Correction Scheduling