While flow-based generative models have demonstrated strong performance across a wide range of domains, deploying them in safety-critical physical systems remains challenging due to strict constraint requirements. Existing approaches typically enforce safety through post-hoc corrections, which incur substantial computational overhead and may distort the learned distribution. We propose PolyFlow, a polytope-constrained flow matching framework that embeds constraints directly into the model and flow dynamics. PolyFlow introduces a discrete-time flow formulation and a projection-free architecture, which eliminate the discretization error and guarantee strict satisfaction of arbitrary polyhedral constraints, without the need for expensive iterative solvers. Experimental results show that PolyFlow achieves zero constraint violation while maintaining high distributional fidelity across a range of planning and control tasks. Compared to state-of-the-art constrained generation baselines, PolyFlow significantly reduces inference latency and demonstrates a favorable trade-off between safety, efficiency, and generative quality. Code is available on https://github.com/MJianM/PolyFlow.
翻译:尽管基于流的生成模型已在多个领域展示出强大性能,但由于严格的约束要求,将其部署于安全关键型物理系统仍面临挑战。现有方法通常通过事后校正来强制执行安全约束,这不仅会带来显著的计算开销,还可能扭曲已学习的分布。我们提出PolyFlow——一种多面体约束流匹配框架,它将约束直接嵌入模型与流动力学中。PolyFlow引入离散时间流公式与无投影架构,彻底消除离散化误差,并保证任意多面体约束的严格满足,同时无需昂贵的迭代求解器。实验结果表明,在多种规划与控制任务中,PolyFlow在保持高分布保真度的同时实现了零约束违反。与现有最先进的约束生成基线方法相比,PolyFlow显著降低推理延迟,并在安全性、效率与生成质量之间展现出优越的权衡表现。代码已开源至 https://github.com/MJianM/PolyFlow。