Terminally constrained flow-based generative models from an optimal control perspective
Weiguo Gao, Ming Li, Qianxiao Li
TL;DR
This work reframes sampling with pre-trained flow-based models as a terminal-constrained optimal control problem, deriving a Hamilton–Jacobi–Bellman framework and identifying an energy interpretation in a co-moving frame. It develops practical, geometry-aware proximal approximations—GD, GN, and the proposed TOCFlow—via a constant-metric reduction that yields a closed-form scalar damping factor, enabling scalable, constraint-preserving guidance at the cost of standard gradient methods. The paper proves asymptotic behaviors (convergence to the reference flow for large penalties and Wasserstein projections for vanishing penalties) and validates TOCFlow across three high-dimensional scientific tasks (Darcy flow, trajectory planning, turbulence) where it consistently improves constraint satisfaction while maintaining generative quality. Collectively, TOCFlow offers a principled, efficient approach to enforcing complex terminal constraints in flow-based generative modeling, with broad applicability to physics-informed sampling and high-dimensional inference.
Abstract
We address the problem of sampling from terminally constrained distributions with pre-trained flow-based generative models through an optimal control formulation. Theoretically, we characterize the value function by a Hamilton-Jacobi-Bellman equation and derive the optimal feedback control as the minimizer of the associated Hamiltonian. We show that as the control penalty increases, the controlled process recovers the reference distribution, while as the penalty vanishes, the terminal law converges to a generalized Wasserstein projection onto the constraint manifold. Algorithmically, we introduce Terminal Optimal Control with Flow-based models (TOCFlow), a geometry-aware sampling-time guidance method for pre-trained flows. Solving the control problem in a terminal co-moving frame that tracks reference trajectories yields a closed-form scalar damping factor along the Riemannian gradient, capturing second-order curvature effects without matrix inversions. TOCFlow therefore matches the geometric consistency of Gauss-Newton updates at the computational cost of standard gradient guidance. We evaluate TOCFlow on three high-dimensional scientific tasks spanning equality, inequality, and global statistical constraints, namely Darcy flow, constrained trajectory planning, and turbulence snapshot generation with Kolmogorov spectral scaling. Across all settings, TOCFlow improves constraint satisfaction over Euclidean guidance and projection baselines while preserving the reference model's generative quality.
