NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

On the Guidance of Flow Matching

Ruiqi Feng, Tailin Wu, Chenglei Yu, Wenhao Deng, Peiyan Hu · OpenReview

Abstract

Flow matching has shown state-of-the-art performance in various generative tasks, ranging from image generation to decision-making, where guided generation 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.

1. Introduction

Generative models like Stable Diffusion have revolutionized AI, largely due to the power of guidance: the ability to steer a model to generate specific outputs (e.g., "a cat in a hat") using an external signal or energy function. While guidance is well-understood for Diffusion Models (DMs), it has remained a relatively unexplored frontier for their more flexible successor, Flow Matching (FM).

Flow Matching is powerful because it is not restricted to starting from pure Gaussian noise; it can map between any two arbitrary distributions. However, many existing FM guidance methods simply borrow formulas from diffusion, forcing FM to act like a DM and discarding its unique advantages. This paper addresses the challenge of finding a mathematically rigorous way to guide any flow matching model, regardless of its starting point or the probability path it follows.

2. A Unified Framework for Guidance

The core of the proposed framework is the Guidance Vector Field ($g_t$). This represents the "nudge" added to a model's standard trajectory to push it toward lower-energy, more desirable regions. From this framework, the authors derive four distinct types of guidance:

2.1 Monte Carlo Guidance ($g^{MC}$)

This is a training-free, asymptotically exact method that uses importance sampling to estimate the guidance direction. Because it is "unbiased," it makes no simplifying assumptions about the data shape. While theoretically perfect, it can suffer from high variance in high-dimensional spaces like image generation.

2.2 Localized/Gradient Guidance ($g^{cov}$)

By utilizing a Taylor expansion, the authors derive a version of guidance that mirrors the gradients used in diffusion models but is generalized for the FM context. They introduce a "Jacobian Trick" to demonstrate how this relates to the model's internal structure.

2.3 Gaussian Approximation ($g^{sim}$)

This derivative-free approach assumes the local probability distribution is roughly Gaussian. This leads to specialized versions for inverse problems (such as $g^{sim-inv}$), which are highly efficient for tasks like image restoration.

2.4 Training-based Guidance ($g_\phi$)

For scenarios where computational resources allow for training, the authors propose new loss functions, such as Guidance Matching, to train a dedicated neural network to act as a guide.

3. Experimental Validation

The researchers evaluated the framework across three distinct domains to verify its versatility:

  • Synthetic 2D Datasets: Used to verify the mathematics on non-Gaussian source distributions, such as mapping a circle distribution to an S-curve.
  • Offline Reinforcement Learning (D4RL): A benchmark for decision-making where the model must plan a sequence of actions to maximize a reward signal.
  • Image Inverse Problems (CelebA-HQ): High-resolution face datasets were used for tasks including box inpainting, 4x super-resolution, and Gaussian deblurring.

4. Key Insights and Results

4.1 The "P ≈ 1" Assumption

The authors identify a "reverse coupling ratio" ($P$) representing the link between source and target distributions. They demonstrate that assuming $P=1$ (independent coupling) is a robust and practical approximation for most FM applications.

4.2 Performance in RL and Imaging

In Offline RL, the Monte Carlo guidance ($g^{MC}$) outperformed previous state-of-the-art gradient-based methods in 7 out of 9 tasks, proving that mathematical exactness is vital when the guidance signal is complex. In image restoration, the $g^{sim-inv}$ method achieved lower FID (better image quality) than traditional methods in inpainting tasks while maintaining higher computational efficiency.

4.3 The Variance-Stability Trade-off

A fundamental trade-off was highlighted: exact methods like $g^{MC}$ are excellent for low-dimensional tasks (like robotics planning) but become noisy for images. Conversely, approximate methods like $g^{cov}$ are stable for images but may cause distribution collapse in simpler tasks.

5. Conclusion and Future Work

This work provides the first unified theoretical framework for guidance in Flow Matching, proving that many famous diffusion guidance methods (like DPS or ΠGDM) are actually restricted special cases of this broader FM framework.

While $g^{MC}$ is theoretically superior, its variance in high dimensions remains a limitation. Future research will focus on variance reduction techniques to make exact guidance viable for high-resolution media and exploring scenarios where the $P ≈ 1$ assumption may not hold.

Summary updated

BibTeX
@inproceedings{feng2025guidance,
  author = {Ruiqi Feng and Tailin Wu and Chenglei Yu and Wenhao Deng and Peiyan Hu},
  title = {{On the Guidance of Flow Matching}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=pKaNgFzJBy},
}
Figure