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

On the Guidance of Flow Matching

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

Flow matching (FM) has rapidly become a favorite in the generative modeling community. By allowing for arbitrary source distributions and straighter probability paths, it offers a more flexible alternative to traditional diffusion models. However, "guiding" these models—steering them to satisfy specific constraints or optimize certain objectives—has remained somewhat of a Wild West.

In their paper "On the Guidance of Flow Matching," Ruiqi Feng and colleagues from Westlake University and the Chinese Academy of Sciences provide the first unified theoretical framework for general flow matching guidance. Their work enables effective guidance even when starting from non-Gaussian source distributions, a scenario where traditional diffusion-based guidance typically fails.

The Challenge of General Guidance

In generative modeling, guidance is the process of conditioning a pre-trained model on new information (like a class label, a high-reward trajectory, or a corrupted image) without retraining the entire model from scratch. While guidance is mathematically well-understood for diffusion models—which inherently assume a Gaussian noise source—it is much less explored for Flow Matching.

Flow Matching's primary strength is its ability to learn mappings between any two distributions. Unfortunately, most existing FM guidance methods simply "copy-paste" diffusion tricks, implicitly assuming a Gaussian source. This limits FM's true potential. The core challenge addressed in this paper is: How do we mathematically derive and implement guidance for general flow matching with arbitrary source distributions and complex probability paths?

A Unified Methodological Framework

The authors derive a general expression for the guidance vector field $g_t(x_t)$ that, when added to the original model, steers the generation toward a target energy function $J(x)$. From this foundational equation, they derive several families of methods:

The unified framework of flow matching guidance.
  1. Monte Carlo Guidance ($g^{MC}$): A training-free, unbiased estimator that uses importance sampling to estimate the guidance signal. It is "asymptotically exact," meaning it converges to perfect guidance as the number of samples increases.
  2. Localized & Approximate Guidance ($g^{cov}, g^{sim}$): By utilizing Taylor expansions and Gaussian approximations, the authors derive tractable versions of guidance. They demonstrate that famous methods like DPS (Diffusion Posterior Sampling) and $\Pi$GDM are actually special cases within this broader framework.
  3. Training-based Guidance ($g_\phi$): The authors introduce "Guidance Matching" losses (VGM, RGM, MRGM). These allow a separate, smaller network to be trained to provide the guidance signal, which is significantly more efficient during inference than sampling-heavy training-free methods.

Key Theoretical Insights

  • The "P=1" Approximation: A major theoretical insight is that for many practical FM methods (like mini-batch Optimal Transport), the "reverse coupling ratio" can be approximated as 1. This simplifies the math significantly and allows their framework to cover most existing models.
  • The Jacobian Trick Justified: The authors provide formal theoretical justification for the "Jacobian trick"—using the derivative of the model's output with respect to its input. They prove it is a valid approximation for general flow matching, not just a heuristic borrowed from diffusion.
  • Unification: The paper acts as a "Grand Unified Theory" for guidance, showing how seemingly disparate methods from the literature are actually just different points on the same mathematical spectrum.

Experimental Results

The researchers evaluated their framework across three distinct domains: synthetic 2D datasets, offline reinforcement learning (D4RL Locomotion), and image inverse problems (CelebA-HQ).

Success on Non-Gaussian Sources

One of the most striking findings is the demonstration that standard diffusion guidance fails completely when the source distribution is non-Gaussian.

Guidance results on 2D synthetic datasets with non-Gaussian sources.

As seen in the synthetic tasks, the proposed $g^{MC}$ and $g_\phi$ methods were the only approaches able to perfectly match the ground truth distributions when starting from complex, non-Gaussian sources (like a circle or a mixture of Gaussians).

Offline RL and Image Tasks

  • Planning (Offline RL): The gradient-free $g^{MC}$ method was the top performer in steering models toward high-reward trajectories, outperforming the best gradient-based methods by 3.5 points on average and achieving the best score in 7 out of 9 tasks.
  • Image Tasks: For high-dimensional images, the approximate methods ($g^{cov-G}$ and $\Pi$GDM) performed best. While $g^{MC}$ is theoretically superior, its variance becomes too high in high dimensions (the "curse of dimensionality").
  • Efficiency: The $g^{sim-A}$ method showed impressive results for image inpainting and deblurring without requiring expensive backpropagation through the model, making it highly efficient for practical use.

Limitations and Future Directions

While comprehensive, the framework highlights a few open challenges. First is the curse of dimensionality for MC guidance: while $g^{MC}$ is unbiased, it requires too many samples to be practical for high-resolution images. Future work could explore variance-reduction techniques. Second, adding guidance can make flow matching paths "curvy," which reduces sampling efficiency. Developing guidance techniques that inherently maintain "straight" probability paths remains an exciting open challenge for the field.

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