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

On the Guidance of Flow Matching

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

TL;DR

While Flow Matching has emerged as a powerful alternative to diffusion models due to its flexibility with arbitrary source distributions and paths, steering these models via external "guidance" has remained poorly understood. This paper introduces the first comprehensive framework for general flow matching guidance, unlocking a new family of training-free exact methods, practical approximations, and robust training losses that work across any distribution or path type.

What Problem Does This Paper Address?

Generative models are incredibly powerful, but we often need to steer their outputs to satisfy specific constraints or maximize certain properties—a process known as guidance (or energy-guided sampling). In traditional diffusion models, guidance is well-studied and relies heavily on the mathematical properties of Gaussian noise and score matching.

Recently, Flow Matching (FM) has taken the generative AI world by storm because it generalizes diffusion, allowing practitioners to define straight mathematical paths between any source and target distribution, not just Gaussian ones. However, existing guidance techniques for Flow Matching have lazily copied diffusion methods. This forces the Flow Matching model to use a Gaussian source distribution and simple paths, completely neutralizing its core advantage.

This paper tackles the fundamental question: How do we properly guide a general Flow Matching model that uses arbitrary source distributions and complex, dependent paths?

Methods

The authors establish a unified mathematical framework (Theorem 3.1) for general flow matching guidance. From this foundation, they derive three main categories of guidance vector fields:

  1. Monte Carlo Guidance ($g^{\text{MC}}$): A training-free, asymptotically exact, and unbiased method. By leveraging importance sampling, it can estimate the exact guidance vector field for any source distribution without needing any network retraining.
  2. Approximate Guidance ($g^{\text{local}}$ and $g^{\text{sim}}$): Since exact estimation can be expensive, the authors use Taylor expansions and Gaussian approximations to derive tractable, fast alternatives. Crucially, they show that under specific conditions (uncoupled affine Gaussian paths), these approximations perfectly reduce to classical diffusion guidance methods like Diffusion Posterior Sampling (DPS) and $\Pi$GDM. They also introduce $g^{\text{sim-inv-A}}$, a highly efficient, derivative-free method tailored for image inverse problems.
  3. Training-Based Guidance ($g_\phi$): For scenarios where real-time sampling speed is critical, they introduce "Guidance Matching" losses (VGM, RGM, MRGM) to train a separate neural network to predict the guidance vector field directly.
Figure 1: Overview of guidance methods in the paper. We start with a unified guidance expression and derive different guidance methods, including training-free and training-based methods, and cover many classical diffusion guidances.

Datasets

The authors evaluated their framework across three distinct domains:

  • 2D Synthetic Datasets: Complex geometries (e.g., mapping a Circle source distribution to a Moon target distribution) designed to test non-Gaussian behavior.
  • Offline Reinforcement Learning (Planning): The D4RL Locomotion benchmark (HalfCheetah, Hopper, and Walker2d datasets), where the model acts as a trajectory planner guided by a reward-predicting critic network.
  • Image Inverse Problems: The CelebA-HQ ($256\times256$ face image) dataset, evaluated on three tasks: box inpainting, $4\times$ super-resolution, and Gaussian deburring.

Key Insights and Ideas

  • Diffusion Guidance is a Special Case: The paper elegantly proves that classical diffusion guidance methods are merely restricted subsets of flow matching guidance. They only hold true when the path is uncoupled, affine, and starts from a Gaussian.
  • The Failure of Diffusion Hacks: When tested on non-Gaussian source distributions, standard diffusion guidance hacks completely fall apart, distorting the generated data manifold. In contrast, the paper's exact methods ($g^{\text{MC}}$ and $g_\phi$) perfectly capture the true target distributions.
  • The Dimensionality Trade-off: Exact Monte Carlo guidance ($g^{\text{MC}}$) is incredibly effective for low-to-medium dimensional tasks (like reinforcement learning trajectories) but suffers from high variance in high-dimensional spaces like image pixels. For images, localized approximations that bypass heavy backpropagation perform significantly better.
Figure 2: Results of the synthetic dataset with different source (blue) and target (red) distributions. We visualize the start/end points and the flow trajectories. gMC and gϕ yield the best guidance across different settings while diffusion guidance fails.

Key Results

  • Offline RL Planning: On the D4RL benchmark, the training-free $g^{\text{MC}}$ method achieved state-of-the-art performance, outperforming the best gradient-based approximate methods by an average score increase of 3.5 points, and significantly beating standard diffusion baselines.
  • Image Inverse Problems: For CelebA-HQ, the proposed derivative-free approximation ($g^{\text{sim-inv-A}}$) demonstrated remarkable performance in inpainting and deblurring. It achieved an FID score that beat $\Pi$GDM by 1.5 points on average, while drastically reducing computational overhead since it requires no backpropagation through the model.
Table 1: Results of the D4RL Locomotion experiments. Entries with ≥95% score of the best results per task (excluding baselines) are highlighted in bold. The standard deviation is deferred to Appendix B.2 due to limited space.

Limitations and Future Work

The primary limitation acknowledged by the authors is the assumption that the reverse coupling ratio ($P$) is approximately 1. While this holds true for independent couplings and mini-batch Optimal Transport, it may degrade when data couplings are highly dependent and the guiding energy function changes violently.

Additionally, the exact Monte Carlo method ($g^{\text{MC}}$) is computationally inefficient for high-dimensional image data due to sample variance. The authors point to variance-reduction techniques (like Variance-Reduced Importance Sampling, $g^{\text{MC-IS}}$) as a vital direction for future work to make exact guidance viable for high-resolution image generation.

Summary updated

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