On the Guidance of Flow Matching
Ruiqi Feng, Chenglei Yu, Wenhao Deng, Peiyan Hu, Tailin Wu
TL;DR
This work addresses guiding flow-matching generative models beyond the Gaussian, diffusion-like setup by introducing a unified guidance framework that supports arbitrary source distributions and couplings. It derives a spectrum of guidance strategies, including a training-free Monte Carlo estimator $(g_t^{\text{MC}})$, a local Taylor-based guide $(g_t^{\text{local}})$, a Gaussian-posterior approximation-based guide $(g^{\text{sim}})$, and a trainable guide $(g_\phi)$ with Guidance Matching losses. The framework subsumes classical diffusion guidance as a special case under the uncoupled affine Gaussian-path assumption, and experiments on synthetic data, offline planning, and image inverse problems show that MC and learned guidance are robust across non-Gaussian and dependent-coupling settings, often outperforming gradient-based approximations. These results broaden the applicability of flow matching to a wider range of tasks by providing principled, versatile, and scalable guidance mechanisms, accompanied by public code for reproducibility.
Abstract
Flow matching has shown state-of-the-art performance in various generative tasks, ranging from image generation to decision-making, where generation under energy guidance (abbreviated as guidance in the following) is pivotal. However, the guidance of flow matching is more general than and thus substantially different from that of its predecessor, diffusion models. Therefore, the challenge in guidance for general flow matching remains largely underexplored. In this paper, we propose the first framework of general guidance for flow matching. From this framework, we derive a family of guidance techniques that can be applied to general flow matching. These include a new training-free asymptotically exact guidance, novel training losses for training-based guidance, and two classes of approximate guidance that cover classical gradient guidance methods as special cases. We theoretically investigate these different methods to give a practical guideline for choosing suitable methods in different scenarios. Experiments on synthetic datasets, image inverse problems, and offline reinforcement learning demonstrate the effectiveness of our proposed guidance methods and verify the correctness of our flow matching guidance framework. Code to reproduce the experiments can be found at https://github.com/AI4Science-WestlakeU/flow_guidance.
