On the Guidance of Flow Matching
Authors: Ruiqi Feng
Chenglei Yu
Wenhao Deng
Peiyan Hu
Tailin Wu
Venue: ICML 2025 spotlightposter (2025)
Keywords: flow matching
guided generation
generative modeling
Primary area: deep_learning->generative_models_and_autoencoders
TL;DR: We introduce the first framework for general flow matching guidance, from which new guidance methods are derived and many classical guidance methods are covered as special cases.

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.

On the Guidance of Flow Matching
Ruiqi Feng' Chenglei Yu"!
Wenhao Deng" Peiyan Hu Tailin Wu
Abstract
transform samples from source distribution into sam- ples following target distribution, thus realizing generative modeling (Lipman et al., 2023). The probability distribution the samples follow during the flow is called the probability path. By designing the probability path in a large design space, flow matching has shown improved generative model- ing fidelity as well as higher sampling efficiency in variety of generative modeling tasks including image generation (Lipman al., 2023), decision-making (Zheng et al., 2023), audio generation, and molecular structure design (Gat et al., 2024; Chen & Lipman, 2024; Ben-Hamu et al.. 2024). Flow matching substantially extends diffusion models (Ho et al., 2020; Song et al., 2021). Most diffusion models leverage the score matching process (Song Ermon, 2019; Song et al., 2020; 2021), inherently limiting them using the Gaussian distribution the source distribution to construct special probability path. Meanwhile, flow matching can learn the mapping between any source distribution and target distri- butions (Lipman et al., 2023; 2024; Chen & Lipman, 2024; Gat et al., 2024).
Flow matching has shown state-of-the-art performance in various generative tasks, ranging from image generation decision-makee makinn, 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. this paper, we propose the first framework of general guidance for flow matching. From this framework, we derive family of guidance techniques that be applied to general flow matching. These include a new training-free asymptotically exact guidance, novel training losses for training-base based guidance, and two classes of approximate guidance that cover classical gradient guidance methods special cases. We theoretically investigate these different methods give 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 flow matching guidance framework. Code to reproduce the ex- periments can be found at https: :ttess///iiee /gtthbb. com/AI guidence.
Guiding flow matching models refers to steering the gen- erated samples toward desired properties, e.g., sampling from distribution weighted with some objective function (Lu et al., 2023) or conditioned on class labels (Song et al., 2021)'. It is vital in many generative modeling applications (Song et al., 2023b; Zheng et al., 2023), but contrary to well- studied guidance in diffusion models (Song et al., 2023b; Chung et al., 2023; Dhariwal & Nichol, 2021; Song et al., 2023a; Zheng al., 2024; Lu et al., 2023; Dou & Song, 2024; Trippe et al., 2023), the guidance of flow matching remains less investigated. Most existing guidance methods only apply to subset of flow matching that assumes the source distribution to be Gaussian and the probability path to have a certain simple form (Lipman et al., 2024; Zheng et al., 2023; Pokle al., 2024; Zhang et al., 2025; Kollovich et al., 2025). In these cases, guidance of flow matching to be essentially the same dif- fusion model guidance, but flow matching's power of gener- ating more flexible probability paths than diffusion models (Tong et al., 2024; Chen & Lipman, 2024; Gat et al., 2024) is restricted. There have been other controlled generation methods for flow matching, with notable stream following the paradigm of optimizing some objective functions via
1. Introduction
Flow matching has emerged as a prominent class gen- crative models. It features the ability to use vector field
allowed to simplify the
'Equal contribution 'Department of Artificial Intelligence, Westlake University, Hangzhou, China PAcademy of Math- ematies and Systems Science, Chinese Academy of Sci- ences, Beijing, China. Correspondence Tailin Wu <wu- tailin@ westlake.edu.cn.......
Proceedings of the 4rnd International Conference Machine Learning. Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
'Mathematically, they are essentially equivalent (Section 3.1).

---

On the Guidance of Flow Matching
differentiating through the sampling process (Ben-Hamu al., 2024; Liu et al., 2023b; Wang al., 2025). However, their goal differs from our guidance of weighting the gener- ated distribution. Therefore, the guidance for fow-matching models remains unrevealed in the rest of the ample design space.
the target distribution pr (z1). By first sampling zo from (2 and then solving the ordinary differential equation (ODE) $0 = vz(xz), one can generate clean samples 21 = 2r that follow the target distribution P1 (z1).
An efficient way to learn the vector field oz (-) by a model Ug (.(,)) () is to use flow matching (Lipman et al., 2023; 2024; Tong et al.. 2024). It works by first finding a conditional vector field u1 (xela) that generates a conditional probabil- ity path p. (2) where 2 denotes sample pairs (Zo. #1) 2
To fill this gap, in this work, we start from a similar assump- tion as diffusion guidance and propose a general framework of flow matching guidance. From the perspective of this framework, we propose Monte Carlo-based training-free asymptotically exact guidance for flow matching. We also propose different training losses for exact maining-basel guidance, one of which covers existing losses as special cases (I.u et al., 2023; Zhang et al., 2025). For approximate guidance methods, we can theoretically derive from our framework many famous guidance methods that have ap- peared in the literature, including DPS (Chung et al., 2023), TIGDM (Song et al., 2023a), LGD (Song et al., 2023b), as well as their flow-matching extensions that are theoretically justified for general flow matching models. We demonstrate the effectiveness of our proposed method in both synthetic datasets and ppcision-making (offline RL) benchmarks. Fur- thermore, more extensive experiments are conducted on image inverse problems to provide empirical comparison of different types of guidance methods for guideline of choosing different methods.
The pairs (couplings) follow the probability distribution of p(z) = π (20. z1)². We use (zo, and 2 interchangeably throughout the paper.
It has been proved that the marginal vector field
ve(xx)) = / Vels (1rx) (x)=(()))))p(((()))
where p(z[az)) = 2=(211s)p(e) will generate the marginal probability path pe pe( = pe (2)+==)((=)) (Lipman et al., 2023). Thus, one only needs fit the marginal vector field (2,) I (2)= (2)(()))))))))) )zz using model vo vo(2,, t).
p(az))
It is intuitive to construct the loss
Ex-21 [Ilvo t) - (1x)) 112]
intractable
which is, unfortunately, intractable. To cope with this prob-
lem, an equivalent conditional flow matching loss has been proposed (Lipman et al., 2023; Tong et al., 2024):
We summarize our contributions as follows: (1) We propose a theoretically justified unified framework to construct guid- ance for general flow matching, i.e., with arbitrary source distribution, coupling, and conditional paths. (2) The frame- work inspires us to propose family of new guidance meth- asymptotically exact guidance and training- based exact guidance for flow matching. (3) The framework can exactly cover multiple classical guidance methods in flow matching and diffusion models. Contrary to previous derivations relying on the flow to have Gaussian source distribution, our derivation pro- vides theoretical justification of these methods for general (4) Empirical comparisons between guid- ance methods are conducted in different tasks, providing insights into choosing appropriate guidance methods for different generative modeling tasks.
[|tca (zt,, t) - m (3e (or1=)]1]
which is tractable and can be used to train up-
ods, including Monte Carlo sampling-base
3. Guidance Vector Fields
This section organized as follows: Section 3.1 proposes the general flow matching guidance framework. In Section 3.2, we derive a new guidance method nMC based on Monte Carlo estimation, which is asymptotically exact. In Section 3.3, we derive a guidance g! proportional to the gradient of the energy function J by approximating Is with Taylor expansion. Then, we introduce the affine path assumption (Assumption 3.2) obtain a tractable grev se gloval and show that under the stronger uncoupled affine Gaussian path assumption (Assumption 3.3), glocal covers classical diffusion guidance methods. Section 3.4 introduces an alter- native approximation that p(2[0;, is a Gaussian. Under this approximation and the affine path assumption (Assumption 3. 3.2), we derive a derivative-free guidance giin-MC, and a specialized guidance of ş for inverse problems. Finally,
flow matching.
2. Background
Let Rd denote the data space where the data samples v, E Rd. Here the subscript t E [o. 1] denotes inference time such that pı (21) is a target distribution we want to generate, and Po(z)) is a base distribution that is easy to sample from. Flow-based generative models (Lipman et al., 2023: 2024) define vector field (x(2) 10, Rd + Rdd that generates a probability path (x:)) : [0,1] ddd Rso connecting the tractable base distribution (o(o)) and
The notation 2 can also represent F1 alone (Lipman et al., 2024). Our analysis is in the general setting where 2 = (1), but for ease of interpretation, one may consider as simply æ1 "We use a to denote the probability density of data couplings.
2

---

On the Guidance of Flow Matching
Section 3.5 provides different training losses for training- based exact guidance Iø- Figure 1 visualizes the above outline and the relations between these guidance methods.
In this paper, we consider the case where P is can be approximated 1. P is exactly when the coupling is independent [<00, = p(z0)p(x1), which results in T (zoo (21) = [Z) (21) = p(zo). P = 1 is also reasonable in many practical flow matching methods with dependent couplings, such as mini-batch optimal transport (OT) condi- tional flow matching (Tong et al., 2024), which we elaborate in Appendix A.3. However, there may be cases where the VF of dependent couplings is significantly different from that of independent couplings. In these cases, the impact of P can be non non-negligible, which we leave for future work. Later, we will show this approximation allows us to cover many existing guidance techniques for flow matching or di diffusion models.
3.1. General Guidance Vector Fields
Guided generative modeling aims to generate samples ac- cording to specific requirements, and energy-guu mnergy-guided sam- pling is one of the primary approaches. Appendix A.1 shows that energy guidance is fundamentally equivalent to conditional sampling or posterior sampling. Accord- ingly, we use the notation of energy guidance throughout, with the theoretical results directly extending to these tasks. Given an energy function J : Rdd R and a pre-trained generative model for p(z), emergy-guided samples follow I ~ p/ (z) = ((z))- ((x), where Z = p(z)e- ((()) dr is the normalizing constant. Samples with lower energy values J are more likely to be generated. Thus, the problem of guidance for flow-matching models becomes:
Uncoupled affine Gaussian path flow matching, where π ( 21) p(z)) uaj (21(211) ay + 5501, and p(a)) = (N M4 E), is known to be equivalent to dif- fusion models, with little difference in the noise sched- ule (Zheng et al., 2023; Ma et al., 2024). In this case, our general guidance for flow matching Eq. (I) can be reduced to a commonly used guidance term in diffusion models: (1r)) x V., log (1r))) (proof in Appendix A.4), Thus, most existing works that only consider uncoupled affine Gaussian path flow matching essentially apply the same guidance techniques for diffusion models (Dhariwal & Nichol, 2021; Song et al., 2023b; Chung et al., 2023).
How can we alter the original vector field (VF) ot that gen- erates p(z) such that the new VF v/4 can generate samples from the new distribution pf (a) =p(x))- ?
A natural choice that is commonly used in diffusion models (Dhariwal & Nichol, 2021) is to add a guidance VF ge (xx)) : [0, 1] x R2 + Rd to the original VF (21)) such that the new VF (xx+) = ge (2+4) + oe (1:) is a VF formed with the same flow matching hyperparameters but generates the new probability path arriving at the new distribution p' (x). Therefore,
Next, we will explore more challenging scenarios of flow matching guidance, which are substantially different from diffusion guidance: either the coupling dependent, or the source distribution is non-Caussian.
(m)))) f odiz(arek)) (2/=e)) / (21=(<012)))( (01=(0o12))p(aaxc)ds
3.2. Monte Carlo Estimation, gt MC
where p(z|1,) = peloglatp(a) and p=(2/x)) = (=(') plac)
To start with, we discuss the Monte Carlo (MC) method to estimate the guidance ge (1ra) in Eq. (1), which is asymptot- ically exact while being training-frre. The MC estimation of the integrals in Eq. (1) and (2) requires sampling from intractable p(= (e)) but they can be converted into:
Recall that new VF (2x) has the conditional probability path and conditional VF as that of the original VF, i.e., (Zelz) = (2) and pl (Z)g2) = (((2,12), 12). Then, we have the following theorem (proof in Appendix A.2).
Theorem 3.1. Adding the guidance VF ge ge(zz) to the origi- nal VF ve (zx) will form VF (()) that generates p((xx)=
It (II)
( (e-Maa)) - (00)))))))))
( Pe(xxlz)] Pc(xz)
A E En)
S' (p((ae)))p (2)pp=))))()) (z)dz, as long as ge
(3)
Z,
e -(x))) (o) (((2)())
gc(xz)= = / (p e-J(ar)
-1) Bala (al (1)
(xx) = Ey, mompp())
pc(
Z)(2e)
where Zo(xz) = / Pe Pe-J(an (((1)) p()
where only pt (2:)) remains intractable. We can use the same MC samples to self self-normalize the distribution (=())))) us- ing Pr(x;) = [e (x=
(2)
In the expressions above, (x)p2)) is usually designed to be simple, known distribution (Tong et al., 2024) and p(z) can be sampled ei- ther using the learned generative model or from the training distribution if accessible. The above method can be under- stood as executing importance sampling to convert the ex- pectation under the intractable distribution Egpp(e)e)) to
P P= (20g2211) is the reverse coupling ratio, where r'' (xoo [(mo|a1)
is the reverse data coupling for the new VF, i.e., the distri- bution of zo given 21 sampled from the target distribution.
"The prime symbol' denotes probability distributions and vec-
for fields corresponding to the new distribution (z)
3

---

On the Guidance of Flow Matching
Agpresimation
Intrectable Training gk
Cittusion gi
$3.1 General Guidance Air))
(e(+t)) Exyorul I( 2, 1)u(2z [x,]]
Assumption
Training- frce Sk
Training Loss !
Equivsient
MRGM
Small variance p(at) (mn)
pla sx.) Coussian
attina path (Assumption 3.2)
$3.5 9s
$3.2 gM
$3.3 gloca
PROM
$3.4 g
afline palh (Aasumption 9.2)
a spacific inverse problem
$3.4 g gimtttrr
VVCM
approximate covariance of (+2)
$3.3 g
63.4 grin-MC
CGM
uncoupted aftine Goussisa peth (Assumplion 3.3)
53.3 grmnd
$3.3 gan-
DPS LGD-MC (nm1)
LGD-MC
OT-ODE ITGDM
CEG
Figure 1: Overview of guidance methods in the paper. We start with unified guidance expression and derive different guidance methods, including training-free and training-basee methods, and cover many classical diffusion guidances.
that under tractable distribution Ex-p(==) [(arle) (-)] The p(ze)
of the MC estimation:
pseudocode for computing dt (xx) can be found in Algo- rithm 1, and a simplified version of gMC under the assump- tion of independent coupling is provided in Appendix A.8.
MC-IS (x:)
9t
p(z) ((x))
Pc(xel2)
E (omp()))
1) (r(
5(2)
Z
should be noted that this method is unbiased and appli- cable to any source distribution. This enables the guidance for flow matching with different source distributions such as uniform (Chen & Lipman, 2024), Gaussian process (Andrae et al., 2025), mixture of Gaussian (Hiranaka et al., 2025; Papamakarios et al., 2017), and others (Mathieu & Nickel, 2020; Stimper et al., 2022). This method can also be applied to flow matching with dependent couplings of 1 20. e.g., optimal transport couplings (Tong al., 2024) and rectified flow (Liu al., 2023a).
[p(2) ((1)) (1(a)))) (x(x))
Ze(xz)= = Exi
[p(2)
where p(z) is an alternative distribution that can be sampled from. To enhance the scalability of g MC-IS, we need to select
(-(() has lower variance, i.e., when e ((m)))
P such that ((*)
is large, p(z) is also large, and vice versa. This can be achieved by sampling using another guided VF, such as those be proposed subsequently, which generates samples close to (but not exactly) (p(z))e-J(ar The probability
To our knowledge, gMC is the first to provide an asymptoti- cally exact training-free estimation of the guidance VF for flow matching whose source distribution is non- -anGaassian. However, due to the high variance of MC given a limited number of samples, MC is more suitable for tasks where the energy function J varies gently and the data is relatively now-dimensional.
density ratio p(*) p(z) can be estimated using, for example, the
Hutchinson trace estimator to preserve scalability (Song et al., 2021). It should be noted that this estimation is still unbiased.5
Since the efficiency of MC is restricted by the high variance in the MC estimation, it has an unsatisfactory performance in high-dimensional generation tasks like image inverse problems. To improve the scalability of MC, there are many techniques that can be readily applied. For example, we can adopt importance sampling in Eq. (3) to reduce the variance
3.3. Localized p(æ1/z)
Many practical guidance methods rely on approximations (Song et al., 2023b; Pokle et al., 2024), so contrary to the unbiased MC estimation of 9t. we investigate approximate (and thus biased) guidance methods in this subsection. We start from an intuitive assumption that the probability mass of p( (xx)) is centered around its mean. Following this,
'We leave empirical investigation into g MC-15 future work.

---

On the Guidance of Flow Matching
it is natural approximate the integrals in Eq. (1) with the Taylor expansion that captures local behaviors around the mean. Thus, Eq. (I) can be simplified and becomes tractable.
Note that this assumption does not prevent the samples from having dependent coupling: x (20)/21) # p(xo)) Under As- sumption 3.2, we can use the I pparameterization (Lipman et al., 2024) to express i1 with the VF 2 that is learned by the model uo (Appendix A.10):
First, we approximate the normalizing constant (e(r)) in Eq. (2) as (Appendix A.9):
3.
Be
1 R3 0r - 3,
It +
Ut.
(5)
ir - 3,00,
(aelzr)e-((o)dd Zx(x,) = / p(z)zz)e J(z)) dz s e ((1))
(4)
With the commonly chosen schedule ar t, 3. = t (Lipman et al., 2023; Tong et al., 2024), 21 Iz + (1 D)v, coincides with the 1-step generated x) under the Fuler scheme. Also under this aftine path assumption, gl can be expressed with the covariance matrix of p(æ1 (m)), Eijr. and the gradient Va, ((1) (proof in Appendix A.11):
where 81 == (exooarm((s)le)) [ri]. Likewise, Eq. (1) can be approximated as ge (2x) x gl and:
g (Ire) A (a [xr 2 (1) V2, V
where 21 is defined as above. The approximation error + C2) (Appendix A.9), where >n. is the maximum eigenvalue of the Hessian of e e)()), 01 is the L2 norm of the covari- ance matrix of the distribution ) d is the dimension- ality of the data, and C1, C22 are constants dependent on the variance of the original conditional VF and the guided VF.
|| can be bounded: ||őg||3 I ((()))
9t cov A
dr3, Brar Enjt V V. (81).
(6)
3g
schodule
Intuitively, the guidance is the gradient of estimated J pre- conditioned with the covariance matrix of p(z|ar). The pre- conditioning squeezes the guidance vector into the p(z[zt) manifold. Next, we discuss different ways to obtain this covariance term, resulting in gom g and gotv
The error bound gives insights on the approximation quality of gleal (detailed discussion in Appendix A.9.):
The simplest way is to approximate the covariance matrix with a manually set schedule X,I, resulting in gf This al- lows us to tune the guidance's 's schedule, a common practice in diffusion model guidance (Song et al., 2023b;a).
The error is small when J is smooth, in which case the Hessian of e e=)(=) will approach zero. This cor- responds to the mild guidance, where approximation- based goal works well.
Ft CoV-A - V ((1))
The error is small when oi is small, i.e. the covariance matrix Σ1 has a small Frobenius norm. This is the case when the flow time / - 1 (and og = 0), where dt. predicts 11 well.
where the original schedule in ge"d is already included in the hyperparameter Apm--A, Since p(z, (a.)) is localized when L, a general guideline is set Awui-A decaying. 9 g only assumes affine path (Assumption 3.2), and is thus theoretically justified for mini-batch optimal transport con- ditional flow matching (Tong et al., 2024) for which few existing guidance methods have been proposed. Besides, gevvAA is efficient as its computation involves no extra num- ber of function evaluations (NFB) than unguided sampling.
The gradient in glocal is a natural outcome of the Taylor expansion near the mean of p(21 (azz). glocal is not only ap- plicable to more general flow matching but also originates differently from diffusion guidance (Dhariwal & Nichol, 2021) where the gradient naturally emerges from the score function Vz, log p(z:). Moreover, the error bound we pro- vide here is more practical compared to those previously proposed for diffusion guidance, e.g., the Jensen gap in dif- fusion posterior sampling (DPS) (Chung et al., 2023), which only bounds the error in E[e-J(mn) (mn)], but is V., log Ze that is the guidance VF, whose error is not bounded.
Alternatively, we can use Proposition 3.5 train a model to fit the actual covariance matrix of p(zi(æz) and acquire goo-L Note that this covariance matrix is determined by the original distribution and is agnostic to the energy function J. The original flow matching essentially learns E, (= but to achieve better approximate guided generation, more detailed information of the distribution p( [xx),, its covariance, also needs be learned.
In order to obtain 1 we need the following assumption: Assumption 3.2. The affine path assumption. We as- sume the conditional probability path to be affine, i.e., I; 1 + Brzo + o,E, where s is a random noise and or o, are both sufficiently small.
The important special case where flow matching is a diffu- sion model with a new schedule is formalized with:
Assumption 3.3. The uncoupled afline Gaussian path as- sumption. In addition to Assumption 3.2, the source dis- tribution p(zg) is a standard Gaussian and the coupling is independent (Foo 21) = p(z))p(a1).
*This choice is widely used one (Lipman et al., 2023; Tong al., 2024). With small random noise o,e, 3e under conditional VF flows is almost exactly from zo to ø1.
5

---

On the Guidance of Flow Matching
We will demonstrate that under Assumption 3.3, oft sim- plifies into g: (Eq. (7)); which covers classical guid- ance methods in diffusion models. Specifically,, using the
can sample from ((2(11) which is a Gaussian distribution:
N Σ
e (+f)
second-orde order Tweedie's 's formula, we can express the co- variance matrix S1it in Eq. (6) in terms of the Hessian of the bog-pobbability, Vx, Vz, log (Rozet et al., 2024; Boys et al., 2023; Ye et al., 2024). Then, under Assumption 3.3. Vz, log p(x;) depends affinely on the VF by in Eq. (5) which depends affinely on .1. Therefore, the covariance ma- trix E1 1 can be expressed with the derivative of the Jacobian matrix 0b; 85, We refer to this relationship as the Jacobian trick (proof in Appendix A2):):
It ge
-1 1) (ole(
(8)
Ze
where 24 == N Σi constant. This shares the spirit of LGD-MC (Song et al., 2023b), which uses MC to estimate Ze and then computes diffusion guidance vz, log Z₁.
N e-J(ai) is estimated normalizing
In some guided generation tasks like inverse problems where J is known analytically, we can derive analytical expres- sions of g.tm For example, when the measurement in- volves a known degradation operator H applied to x and then adding Gaussian noise with scale σy to Hr, we have ((r ) O 20 lly Hxr1(2- Thus we can derive ggth under the affine path assumption (Assumption 3.2), and propose a practical approximation gt. giim-inv-A (Appendix A.13):
Proposition 3.4. The Jacobian trick. Under Assumption 3.3, the inverse covariance matrix of p(21 (ate) Eip, de- pends affinely on the Jacobian of the VF Uu,, and is propor- tional to the Jacobian dā
az."
Oz."
B
dv.
Be 001
Enp- a, - 3,ar)
(- 3, + 3r a.. 0i d..
slin-lnv-A -Ao
+ +HHH)
H² H² (y- - H&1), (9)
gf
Inserting back to Eq. (6), we have:
where X and r. are both hyperparameters. g extends IIGDM (Song et al., 2023a) to affine flow matching but requires further approximation dir when 1 + 1.
g.or.G - 2xon 2.,
azi I, which is accurate
where Anto =
= (a, - 3/as)/a a is the schedule.
In uncoupled affine Gaussian path (Assumption 3.3), gftn in our framework can exactly cover IIGDM and OT-ODE (Song et al., 2023a; Pokle et al., 2024) (Appendix 13). Note that our gpth is theoretically justified for dependent couplings, such as optimal transport conditional flow match- ing (OT-CFM) (Tong et al., 2024).
g.m-G covers classical diffusion model guidance includ- ing loss-guided diffusion? (I.GD) (Song et al., 2023b) and diffusion posterior sampling (DPS) (Chung et al., 2023). In diffusion models, the guidance can be expressed as Ve, log E==p(()=,,) [e ][ and DPS approximates this by neglecting the gap in the Jensen inequality (Chung et al., 2023) to move the expectation into e²O) and LGD approxi- mates the expectation with a point estimation. Both methods arrive at- - Va, J(:)). which is covered by our Eq. (7).
3.5. Training-base Guidance go
Previously, we have discussed training-free guidance meth- ods. In this subsection, we discuss how to train neural network go fit guidance Gt- To construct a tractable train- ing loss, we extend the conditional loss in flow matching to arbitrary conditional variables in the following proposition (proof in Appendix A.5).
3.4. Gaussian Approximation of p(=(1a))
Instead of approximating guidance by expanding it near its mean, we can alternatively approximate p(2(0)) with a Gaussian distribution (<=(=;) = (2; (x:),, (xee), and get 9r 2 gfth To minimize the KL divergence between the approximate distribution and the original distribution, we need to choose pe(xz) and Ee (xxz to that of the actual distri- bution p(2(2+) (Rozet et al., 2024; Boys et al., 2023). Under Assumption 3.2, di can be estimated using Eq. (5), ån can be similarly estimated (Appendix A.1 and (2;) can be either set as a hyperparameter as g gov-A or computed as in gf gow-G in uncoupled affine Gaussian path flow matching.
Proposition 3.5. Any marginal variable [ I) = E=-p,(=)x,,)
[e]== (eep))) (1,,,, t)], (20, 21) has an intractable marginal loss:
C. = Empope [[ t) Ez-mitelee (1e, 2, []]][]]
whose gradient w.e.. O is identical to that of the tractable conditional loss:
Caj= Epplen)) [[]6((e..) [1) 2,1
Now that if J has an unknown expression, can use Monte Carlo (MC) sampling to estimate g:th zo gb. głim-MC, since we
Guidance Matching. Based on proposition 3.5, We can train Go by first learning a surrogate model Zoz (zr, t) z Zt. and then train go Ri 9: with the following guidance
We refer to the simplest version of LGD-MM(n = 1) as LGD here. L.DD-MC with n > will be covered in Section 3.4.
6

---

On the Guidance of Flow Matching
w/o p(z)
Ground Truth p(xi)eRRaupe
CEG
gim--Mc
geor-A
grox-G
gMc
g
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 Bo yield the best guidance across different settings while diffusion guidance fails.
matching (GM) losses.
whereas for general flow matching, one needs the training loss proposed above train network get the accurate guidance.
+ (M8M,
(10)
jUM
-1) 1 (2 22)
In summary, we have proposed guidance matching methods for training- based guidance in this subsection. We derive different losses for learning Z, and gt, which all provide unbiased estimations of the gradient and can be utilized without specific assumptions on flow matching.
602
Lozz (2t,t) - ((x))
(11)
where sy denotes stopping the gradient in automatic differ- entiation. We prove in Appendix A.7 that the minimizer of Loz is indeed EΦz Le and 9Φ
4. Experiments
In fact, there are other methods to learn Zøz- In the litera- ture on diffusion models, Lu et al. (2023) proposed use contrastive learning obtain (x,,) that can be extended to include the general flow matching path (Appendix A.6). Al- ternatively, Monte Carlo estimation can be applied to obtain Zøz (Appendix A.6). As for learning Je. alternative to the loss PuM in Eq. (11), there are other losses gVGM fRGM and ęMRGM which, when substituted into Eq. (10), will produce the same minimizer. We provide detailed analysis and proof for all these losses in Appendix A.7. Notably, MRRM that we derive is identical to a newly proposed training-based flow matching guidance loss in Zhang et al. (2025). For uncoupled affine Gaussian path flow matching (Assumption 3.3), since the guidance is Sr x Wz, log Zz(x;) (Appendix A.4), learning Zoz in Eq. (11) is adequate, and Lu et al. (2023) also learns Zaz.
In the experiment, we benchmark different guidance meth- ods for flow matching models in different tasks including synthetic datasets, generative decision-making and image inverse problems. These tasks all fall into the category of energy guidance (Janner et al., 2022; Lu al., 2023) or posterior sampling (Chung al., 2023). With these periments, aim answer the following questions: (1) Can the proposed learning-based exact guidance method de learn the correct guidance VF for general (including non- uncoupled affine Gaussian path) flow matching? (2) For the asymptotically exact MC guidance method, can it produce the correct guidance in non-Gaussian flow matching, and is it exact assuming sufficiently large sample budget? (3) On the practical aspect, how do different types of guidance methods (approximate/exact, perform on more realistic tasks, and how do we choose the appropriate flow matching guidance in different tasks?
frepeinnirreerrriinnggggggg -based)
These different training- vaining-based guidance opens the design space of classifier- flow matching. For diffusion models, one only needs to train a classifier on noisy input to produce the correct guidance,
(Dhariwal & Nichol, 2021) for

---

On the Guidance of Flow Matching
Table I: Results of the D4RL Locomotion experiments. Entries with 2 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.
Baselines
OT-CFM
CFM
BC
Diffuser
g
gliu-M
MC
96
w/o g
gay-A
gan
gluu-MC
gNC
HalfChoetah
55.2
88.9
61.9
64.8
73.2
78.1
86.4
70.2
46.4
63.4
68.5
83,5
87.7
81.5
Medium- Eexpium-Expert
Hopper
52.5
103.3
95.2
101.8
112.3
112.3
112.7
98.1
83.4
93.9
113.3
88.5
113.3
91.5
Walker2d
107.5
106.9
79.1
97.3
107.2
101.0
107.2
91.3
65.7
100.4
106.9
107.0
107.1
102.3
HalfChoetah
42.6
42.8
34.7
42.2
42.9
43.1
43.1
43.4
41.8
43.6
43.3
43.8
43,8
43.8
Medium
Hopper
52.9
74.3
63.3
75.1
89.8
76.2
79.8
79.7
73.2
79.
82.7
82.1
88.0
85.2
Walker2d
75.3
79.6
72.4
82.7
81.3
83,4
83.0
80.6
72.2
80.7
82,5
81.9
81.9
72.9
HallCheetah
36.6
37.7
25.6
31.7
36.1
36.8
40.0
35.5
22.2
33.4
39.3
37.9
40.6
39.1
Medium-Replay
Hopper
18.1
93.6
40.1
57.7
74.1
60.9
88.6
55.3
55.1
63.0
69.3
61.0
80.9
63.5
Walker2d
26.0
70.6
31.2
62.5
82.5
64.4
88.1
52.4
28.3
64,9
76,6
58.9
70.9
70.3
Average
51.9
77.5
55.9
68.4
77.7
72.9
81.0
67.4
54.3
69.2
75.8
71.6
79.4
72.2
4.1. Synthetic Dataset
of the learned generative model for the original distribution, which can be seen approximate lower-bound of the guided generation error.
We first compare different guidance methods on 2- dimensional synthetic datasets where the source distribu- tions different from Gaussian. The base flow matching model is trained to learn the flow with source distributions other than Gaussian. During inference, different guidance methods are applied to perform guided sampling with dif- ferent objective functions J for each dataset. All of the source distributions are non- nau-Saasiian, so traditional dif- fusion guidance should not be applied. In Figure 2, we compare the performance of gMC, 9a- exact diffusion guidance called contrastive energy guidance (CEG) pro- posed by Lu et al. (2023), and approximate guidance gmve-, goovGG , and gsim-MC, The original target distributions (w/o gt) and the J-weighted distributions (ground truth) are shown in the first and second columns. The details of the experiment are provided in Appendix B.
4.2. Planning
We also conduct experiments on offline RL tasks where generative models have been used as planners (Janner et al., 2022; Chen & Lipman, 2024). The planning process is real- ized through sampling from ()(z))e(((a) (Levine, 2018), which aligns with the goal of our guidance by setting J RR and It being the return. We report experiment results on the Locomotion tasks in the D4RL dataset (Fu et al., 2020), with experiment setting details and complete results provided in Appendix B.2.
The average normalized scores across five seeded runs of each guidance method are reported in Table I where score = 100 corresponds to the scores of the expert. The conclu- sions for CFM and OT-CFM are consistent: for gradient- based methods, g is generally better than g with an average increase in score of 8.0. gsim-MC has performance between genv-A and geov-G The improved performance of goov-G comes at a higher computation cost of differentiation through the VF model, though. The MC-based guidance, although being gradient-free outperforms the second- method goov-G by 3.5 on average and is the best method in out of 9 tasks. For Jø. we report the result of the best losses f, but their performance still relatively weak, falling behind the best by 10.4 on average. We attribute this to the unstable joint training of two networks and provide the complete results in Appendix B.2.
It can be seen from Figure 2 that MCC and go generated samples that almost exactly match the ground truth distri- bution and the performance is consistent across different datasets. Note that the generated samples maintain the cor- rect data manifold instead of concentrating on some points as gradient- approximate guidance methods do. As has been mentioned in Section 3, CEG is essentially Zz, log Ze which is exact under the uncoupled affine Gaussian path as- sumption 3.3. However, none of the flow matching paths we have here are uncoupled affine Gaussian paths, so exact diffusion guidance performs poorly compared to Io and g MC showing a largely distorted generated distribution.
Also, we investigated the asymptotic exactness of MC, To quantitatively see the increasing guidance precision as the sample size increases, show the Wasserstein-2 distance between the guided generation distribution and the ground truth target distribution, estimated using 1000 samples. As shown in Figure 4, the error decreases as the number of sam- ples for computing g MCC (N in Algorithm 1) increases from to 104, and eventually approaches or surpasses the error
To investigate the effectiveness of gMC, we collect an ensem- ble of plans that are generated under guidance, compute the critic-pua cettic-predictd objective function value (estimated return R), and then plot the density distribution of the estimated return R. An ideal guidance will result in the R distribution to be p( R where p( R) is the distribution generated with- out guidance (Appendix B.2). As can be seen from Figure 3,
8

---

On the Guidance of Flow Matching
Table 2: Image inverse problem results on CelebA-HQ. The best and runner-up results are highlighted in bold and underlined.
Inpainting-Cama Center, oy
0.05
Super-Resolunee x4, By
0.05
Gaussian Deblurring. o,
0.05
FID 4
LPIPS +
PSNR
SSIM
FID L
LPIPS |
PSNR
SSIM
FID 4
LPIPS 1
PSNR
SSIM 1
g
7.330
0.1904
25.70
0.8432
26.06
0.3016
26.64
0.7292
14.34
0.2968
24.46
0.6982
gim
10.67
0.1716
25.42
0.8681
31.78
0.3717
23.88
0.6072
11.83
0.2837
24.54
0.7109
OT-CPM
g gaou
18.43
0.2390
26.96
0.8125
15.42
0,2533
27.40
0.7783
17.04
0,2873
24.96
0.7196
TIGDM
12.56
0.1717
27.74
0.8723
9.828
0.2322
27.24
0.7891
12.95
0.2226
28.43
0.7952
g MC
22.75
0.5589
8.67
0,3484
22.92
0.5596
8.59
0,3468
22.82
0.5596
8.64
0.3469
g
7.678
0,1920
25.95
0.8414
31.76
0.3770
22.79
0.5899
16.09
0.3052
24.21
0.6825
9 Aim-A
11.54
0.1785
28.00
0.8686
33.02
0.3749
23.75
0.6015
13.37
0.2947
24.34
0.6926
CFM
goou-
19.65
0.2377
27.03
0.8140
13.89
0.2461
27.15
0.7864
16.89
0.2908
24.84
0.7112
TIGDM
15.27
0.1753
25.48
0.8700
10.52
0.2435
26.96
0.7755
12.60
0.2244
28.27
0.7893
g MC
26.37
0.5615
9.06
0,3495
26.75
0,5492
10.05
0,3689
26.84
0,5494
10.04
0,3684
the samples generated with gMC have density distribution that best matches the ground-truth target distribution.
agation through the model is needed. geo is the worst excluding gMC, being the second worst the worst in 11 out of 12 metrics and ranking CFM and OT-CFM separately. It should be noted that gMC performs poorly here, as J in the inverse problem is highly complex, thus requiring an infeasibly large sample budget to compute accurate g MC A more detailed explanation is deferred to Appendix B.3.
4.3. Image Inverse Problems
We conduct experiments the image inverse problems the CelebA-HQ (256x256) dataset to reflect the guidance performances on higher dimensional generative tasks. We consider three different types of noised inverse problems: box inpainting, super-resolution, and Gaussian deburring, and compute the metries FID, LPIPS, PSNR, and SSIM on 3000 samples from the test set. The details of the settings and result visualizations are included in Appendix B.3.
5. Limitations and Future Works
The major limitation of our work lies in the assumption that 'P ~ 1. When the coupling is strong, the guidance VF no longer has the correct direction. In future works, we plan to address this problem by estimating P, which enables guidance for flow matching models with exact coupling.
0.06
Probability Dendty of
Geheraed 55mbles
0.05
In addition, we plan improve the specific guidance meth- ods. For example, gMC suffers from the low sample effi- ciency on high-dimensional datasets. Thus, it is worthwhile to comprehensively investigate and improve the effective- ness of gt MC-IS, or to explore other techniques (such as the control variable method) to further lower the variance.
0.04
ko (CR)
0.03
0.02
go1-A
0.01
0.00
200
220
240
260
280
300
320
Besides, guided VF (zx) can be chosen to have differ- ent properties, such the straightness of the VF. In this way, there may be add-on VFs that facilitate the sampling efficiency, which we also leave for future work.
Estimabed
R
Figure 3: R distribution of generated trajectories in Loco- motion. MC matches the target gray dashed line well.
6. Conclusion
The results demonstrate that IIGMM is generally better on all tasks, being the best in 8 out of 12 metrics. gav has a similar but slightly worse performance than IIGMM, be- ing the best or the runner-up in all metrics of the super- resolution task if ranking the results of CFM and OT-CFM separately and 3 out of 4 metries in the deblurring task. gii-- that does not involve the Jacobian shows remarkable performance in inpainting and deblurring, with lower FID score than IIGDM by 1.5 on average, and LPIPS, PSNR, and SSIM within 3% relative difference compared to the best or the rumner-up method in 5 out of 6 metrics, especially when considering the efficiency of iin-A that no backprop-
In this work, we have proposed the first framework for general flow matching guidance, from which new MC-based guidance gMC,, many approximate guidance, and learned guidance Go, are derived, all of them verified by experiments. Many classical guidance methods have been covered as special cases, and we provided a theoretical derivation for each guidance method. We believe this work will facilitate the application of flow matching by opening novel design spaces of its guidance methods.
9

---

On the Guidance of Flow Matching
Acknowledgements
Fan, Y., Watkins, O., Du, Y., Liu, H., Ryu, M., Boutilier, C., Abbeel, P., Ghavamzadeh, M., Lee, K., and Lee, K. DPOK: Reinforcement learning for fine-tuning text-to- image diffusion models. In The Thirty-sevetth Annual Conference on Neural Information Processing Systems, 2023.
We thank Qianyi Chen, Tengfei Xu, Long Wei, Chuanrui Wang, Jiashu Pan, and Tao Zhang for the discussions and for providing feedback on our manuscript. We gratefully acknowledge the support of Westlake University Research Center for Industries of the Future and Westlake University Center for figh-peerformnnce Computing. The content is solely the responsibility of the authors and does not neces- sarily represent the official views of the funding entities.
Fu, J., Kumar, A., Nachum, O., Tucker, G., and Levine, S. D4rl: Datasets for deep data-driven reinforcement learning. arXiv preprint arXiv:2004.072119 2020.
Gat, I., Remez, T., Shaul, N., Kreuk, F., Chen, R. T. Q.. Synnaeve, G., Adi, Y., and Lipman, Y. Discrete flow matching. In The hhirty-Eightl Annual Conference on Neural Information Processing Systems, 2024.
Impact Statement
This paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal consequences of our work, none of which we feel must be specifically highlighted here.
Hiranaka, A., Chen, S.-F., Lai, C.-H., Kim, D., Murata, N., Shibuya, T., Liao, W.-H., Sun, S.-H., and Mitsufuji, Y. HERO: Human-fcedback efficient reinforcement learning for online diffusion model finetuning. In The Thirteenth International Conference on Learning Representations, 2025, URL https: /ttp:///pppeeeeeeeeeeeeeee net/ forum? i id=yMHe
References
Ajay, A., Du, Y., Gupta, A., Tenenbaum, J., Jaakkola, T., and Agrawal, P. Is conditional generative modeling all you need for decision d making? In The Eleventh International Conference on Learning Representations, 2023.
Ho, J. and Salimans, T. Classifier-free diffusion guidance. In NeurIPS 2021 Workshop on Deep Generative Models and Downstream Applications, 2022.
Andrae, M., Landelius, T., Oskarsson, J., and Lindsten, F. Continuous ensemble weather forecasting with dif- fusion models. In The Thirteenth International Confer- ence on Learning Representations, 2025. URL https: //openreview.o wetrriieweeeeeeeeee. dit.rrmmmid-PPP22NEE0
Ho, J., Jain, A., and Abbeel, Denoising diffusion proba- bilistic models. In The Thirty-Fourth Annual Conference on Neural Information Processing Systems, 2020.
Ben-Hamu, H., Puny, O., Gat, I., Karrer, B., Singer, U., and Lipman, Y. D-flow: Differentiating through flows Proceedings of the 4
Janner, M., Du Y., Tenenbaum, J. B., and Levine, S. Plan- ning with diffusion for flexible behavior synthesis. In Proceedings of the 39th International Conference on Ma- chine Learning, 2022.
for controlled generation. International Conference on Machine Learning, 2024.
Boys, B., Girolami, M., Pidstrigach, J., Reich, S., Mosca, A., and Akyildiz, O. D. Tweedie moment projected diffu- sions for inverse problems. In The Twelfth International Conference on Learning Representations, 2023.
Kollovich, M., Lienen, M.. Lüdke, D., Schwinn, L., and Günnemann, S. Flow matching with gaussian process pri- ors for probabilistic time series forecasting. In The Thir- teenth International Conference on Learning Represen- tations, 2025. URL https: / httpas///pppeeeee openreviiww net/ forum? id=uxVBbS1004
Chen, R. T. Q. and Lipman, Y. Flow matching on general geometries. In The Tweifth International Conference on Learning Representations, 2024.
Levine, S. Reinforcement learning and control as proba- bilistic inference: Tutorial and review. arXiv preprint TeXiv:1805.0090 2018.
Chung. H., Kim, J., Mccann, M. T., Klasky, M. L., and
Ye, C. Diffusion posterior sampling for general noisy inverse problems. In The Eleventh International Confer- ence on Learning Representations, 2023.
Lipman, Y., Chen, R. T. Q.. Ben-Hamu, H., Nickel, M., and Le, M. Flow matching for generative modeling. In The Eleventh International Conference on Learning Repre- sentations, 2023.
Dhariwal, P. and Nichol, A. Diffusion models beat GANs image synthesis. In The Thirty-Fifth Annual Conference on Neural Information Processing Systems, 2021.
Dou, Z. and Song, Y. Diffusion posterior sampling for linear inverse problem solving: filtering perspective. In The Twelfth International Conference on Learning Representations, 2024.
Lipman, Y., Havasi, M., Holderrieth, P., Shaul, N., Le, M., Karrer, B., Chen, R. T. Q., Lopez-Paz, D., Ben-Hamu, H., and Gat, I. Flow matching guide and code. arXiv preprint arXiv:2412.0626. 2024.
10

---

On the Guidance of Flow Matching
Liu, X., Gong, C., and Liu, Q. Flow straight and fast: Learning to generate and transfer data with rectified flow. In The Eleventh International Conference Learning Representations. 2023a.
In Proceedings of the 40th International Conference on Machine Learning, 2023b.
Song, Y. and Ermon, S. Generative modeling by estimating
gradients of the data distribution. In The Thirty-third Annual Conference Neural Information Processing Systems, 2019.
Liu, X., Wu, L., Zhang, S., Gong, C., Ping, W., and Liu, Q. FlowGrad: Controlling the output of generative ODEs with gradients. In 2023 IEEE/CVF Conference on Com- puter Vision and Pattern Recognition (CVPR), 2023b.
Song, Y., Garg, S., Shi, J., and Ermon, Sliced score matching: scalable approach to density and score es- timation. In Proceedings of The 35th Uncertainty in Artificial Intelligence Conference, 2020.
Lu, C., Chen, H., Chen, J., Su, H., Li, C., and Zhu, Contrastive energy prediction for exact energy- diffusion sampling in offline reinforcement learning. In Proceedings of the 40th International Conference on Ma- chine Learning, 2023.
Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Er- mon, S., and Poole, B. Saore-based generative modeling through stochastic differential equations. In The Ninth International Conference on Learning Representations, 2021.
Lu, H., Han, D., Shen, Y., and Li, D. What makes a good diffusion planner for decision making? In The Thirteenth International Conference on Learning Representations, 2025. URL
Stimper, V., Schölkopf, B., and Hernández-Lobato, J. M. Resampling base distributions of normalizing flows. In Proceedings of the 25th International Conference on Ar- tificial Intelligence and Statistics, 2022.
n forum?
id=7BokXXM8Fy;
Ma, N., Goldstein, M., Albergo, M. S., Boffi, N. M., Vanden-Fijnden, E., and Xie, S. SiT: Exploring Flow and Diffusion-based Generative Models with Scalable Interpolant Transformers. In The 18th European Confer- ence on Computer Vision, 2024.
Tong, A., Fatras, K., Malkin, N., Huguet, G., Zhang, Y., Rector-Brooks, J., Wolf, G., and Bengio, Y. Improv- ing and generalizing flow-based generative models with minibatch optimal transport. Transactions on Machine Learning Research, March 2024.
Mathieu, E. and Nickel, M. Riemannian continuous normal- izing flows. In The Thirty-Fourlhe Annual Conference Neural Information Processing Systems, 2020.
Trippe, B. L., Yim, J., Tischer, D., Baker, D., Broderick, T., Barzilay, R., and Jaakkola, T. Diffusion probabilistic mod- eling protein backbones 3d for the motif-scaffolding problem. In The Eleventh International Conference on Learning Representations, 2023.
Owen, A. B. Monte Carlo theory, methods and examples. https: / art awtowwen..e su. domains/mmaniiooooooo mc/ 2013.
Papamakarios, G., Pavlakou, T., and Murray, I. Masked autoregressive flow for density estimation. In The Thirty- First Annual Conference on Neural Information Process- ing Systems, 2017.
Wang. L., Cheng, C., Liao, Y., Qu, Y., and Liu, G. Train- ing free guided flow fow-matching with optimal control. In The Thirleenth International Conference on Learning Representations, 2025. URL httpss://penreee net / forum? 1 61..d:66sssss. 5RA1MM,
Pokle, A., Muckley, M. J., Chen, R. T. Q., and Karrer, B. Training-fre linear image inverses via flows. The Twelfth International Conference on Learning Represen- tations, 2024.
Ye, H., Lin, H., Han, J., Xu, M., Liu, S., Liang, Y., Ma. J., Zou, J., and Ermon, S. TFG: Unified training-free guidance for diffusion models. In The Thirty-Eighth Annual Conference on Neural Information Processing Systems, 2024.
Rozet, F., Andry, G., Lanusse, F., and Louppe, G. Learning diffusion priors from observations by expectation max- imization. In The Thirty-Eight Anmual Conference on Neural Information Processing Systems, 2024.
Zhang, S., Zhang, W. and Gu. Q. Energy-weighted flow matching for offline reinforcement learning. In The Thir- leenth International Conference on Learning Represen- tations, 2025. URL https:/ htt.ttt//ppeeeeeiiiiiii oppnrevieeeeeeeeeeeee net// forum? id= -ildd=HHAOOO HOOVUGI
Song. J., Vahdat, A., Mardani, M., and Kautz, Pseudoinverse- guided diffusion models for inverse prob- lems. The Eleventh International Conference on Learn- ing Representations, 2023a.
Zheng, H., Chu, W., Wang, A., Kovachki, N., Baptista, R., and Yue, Y. Ensemble kalman diffusion guidance: A derivative-free method for inverse problems. arXiv preprint arXiv:2409.20175// 2024.
Song. J., Zhang, Q., Yin, H., Mardani, M., Liu, M.-Y., Kautz, J., Chen, Y., and Vahdat, A. Loss-guided diffu- sion models for plug-and-play controllable generation.

---

On the Guidance of Flow Matching
Zheng, Q., Le, M., Shaul, N., Lipman, Y., Grover, A., and Chen, R. T. Q- Guided flows for generative modeling and decision making, arXiv preprint arXiv:2311.1344.3 2023.
Zhou, G., Swaminathan, S., Raju, R. V., Guntupalli, J. S., Lehrach, W., Ortiz, J., Dedieu, A., Lázaro-Gredilla,, M., and Murphy, K. Diffusion model predictive control. arXiv preprint wwt.:::21110036666 2024.
12

---

On the Guidance of Flow Matching
A. Complete Theoretical Derivations and Proofs
Here, we provide the theoretical analysis that is deferred from the main text, including the following subsections: Appendix A.I includes proof of how energy-gun gergy-guided sampling from p(z)e ((z))e-(()// /Z equivalent conditional sampling from p(æly)) Appendix A.2 proves Theorem 3.1 by showing 9t + Ut equal of which generates the correctly guided probability path. Appendix A.4 Proof of that under uncoupled affine Gaussian paths, our general guidance gr is equivalent to the diffusion guidance Vn, log Zr Appendix A.5 is proof of Proposition 3.5. Appendix A.6 discusses other ways to obtain Z., including using contrastive learning and Monte Carlo estimation. In appendix A.7, we propose three other training losses &VGM eRGM, and MM RMR for 96 and prove that the losses will produce the correct gradient. Appendix A.8 includes a more detailed explanation of g and a variant it under uncoupled paths. Appendix A.9 derives g glocal and proves its error bound. Appendix A.10 shows how to estimate 31 using #t and vo (dt, 1) under the affine path assumption. Appendix A. proves that glocal becomes gft under affine paths. Appendix A. includes the proof of the Jacobian trick (Proposition A.12). Appendix A.13 includes proof of gr m- for the image inverse problem, how to derive guum-inv-A, and how to recover IIGDM under the uncoupled affine Gaussian path assumption.
A.1. Energy Guided Sampling as Posterior Sampling
There exists [zx) such that sampling from p(x) J(x) is equivalent to sampling from p(xly))
Simply take J = log p(ylx)) Plug it in to get
1 p(x)) J(x) p(2))1 p(x)) log p(ala) Pint
p(ala) p(xly))-
(12)
p(o)ddoonlll p((x)) log
pla) dx
This theorem can be interpreted as, when you have a classifier (2) and an energy guidance algorithm, you can directly use this algorithm perform conditional generation from p(y[>) by setting the energy ((x) -(y]zr).
Similar approaches have been used in probability inference, reinforcement learning (Levine, 2018), and Diffuser (Janner et al., 2022) uses this to convert return-conditioned sampling into energy -ggdddd sampling.
A.2. General Guidance
We prove Theorem 3.1 here.
Theorem A.1. Adding the guidance VF (z()) to the original VF vo(xe) will form VF vf(x1) that generates p1()))
(x(l)))) (z)d,, as long as gr 9e(xa) follows:
go(x1) = (p c J(a1)
Zx(x)) -1) Uzj= (01=(ork))p(2100ee
(13)
/ Pe -eei())) (e-d(e1)p(((0p)))) p(zlzz)ddz
where Zo(zi)=
(14)
P x' (2ala))) the reverse coupling ratio, where nt (((oo(21) is the reverse data coupling for the new VF, Le., the distribution =(
of no given 2 sampled from the target distribution.
Proof. We can subtract vx(zz) from (xx) to construct ge(x)):
(x()))= = o((xx) -f (olo(trl=))) Pe Pc(ee/2)p(2) dz.
(15)
Pe (r(
(x())) generates px(x)) = (x(r: (z)dz if
(e(o(()))) (=(0))))p((3) dz, p/ (x(x))
u((x,) = (x.1))
(16)
where pz(2) = <'<oo/11) p((1)) )m)) which follows from conditional flow matching, iee,, a VF marginalizing a
conditional VF will generate the corresponding marginal probability path (Lipman et al., 2023; Tong et al., 2024). Then, we
13

---

On the Guidance of Flow Matching
have a possible form of (xre))
/ 0//: (1cl))))) (c(2)l2)p((2)
pe(xxlz)p(z) pr (wr)
gr gx()))=
)zz
p(((at)
/ (x)l))) Pr (10 (2) ( bp(l1 ) (((x)
pr )dz
((()))
(x([=))) Pe 2 (=)=))()))))))))))) e-_((x)) [(x1) p((avl2)p(2)
)dz
p1())))
((()))
mn (1/()))))))))) (1(2112)p(2)
[(11) P((
(P(z) 7 px(2))
1)dz,
(17)
(T()
where pr(xz) plz,, 2),2, p/ (21) p' 2)d2, and P(z)
x((o]= Since x(z0|z1))
plxa) / z)dz= p(xx) / p(zlos)d=
(18)
and
px(x)) = / pl (((xe, = f (( (=)d=
/ p(ar))))(()l1))) 1 p(x)) )e- d
/ p(s)p(all)pp()
(( z
/ P(z)p(xn))) 70 ((1)) dz
= p(x))) / P(=)p(s(ar) ze -(z))
(19)
Plugging Eq. (18) and Eq. (19) into Eq. (17), get
/ ud)=(1al pe(xr(z)p(()
1 ((())) Pc(at) P((())
(x()))
(P(=)
1)dz
pe (3te)
7 p)((3s)
Pe (e(xoo (p)))
(2)2) 1/8 ((m))
plaT p(=)2,)dz
Wlatt P(())((zzz) fe-il 1)dz
pr (2+)
12
|f (eis((aa=))
Pe Pe(arel ()(=)
(P(2) ((m))
p(zlux)d=-11 1)dx
Pe (3Fe)
P(())((2(a)) Mazdd
/ Pe (e((sel=)p(=)
P(z)e-J(zi)
E Rempp(a (o.) (P(z)e-J(z)) 1)dz.
(20)
Pe (x+)
Finally, denote Z, E=-p())))) [e [ari]] complete the proof.
Remark. The theorem states that vi = 9t + o not only generates the desired terminal distribution ( at time / = 1, but also generates a probability path (xx)) that is similar to the original one. Specifically, their "noising process" p(x))=1). and the conditional vector fields (x)(xx)) and the reverse coupling p(z0(z1) are the same. These are all hyperparameters of flow matching, as can choose arbitrary conditional vector field satisfying boundary conditions and the conditional vector field uniquely determines the conditional probability path; the reverse coupling, given target (dataset) distribution p(a1) p=(x))e-J(ss composes the data coupling p( .11 = p(=) for flow matching training.
should be noted that the 9r and oy we construct here is only one of infinitely many (Lipman et al., 2023) possible vector fields to generate {/)( -xx1) at = 1. remains an interesting question whether there exists better of that, for example, simplifies 9e or improves the vector field by straightening the flow.
14

---

On the Guidance of Flow Matching
Flow time
0.05
0.25
0.5
0.75
0.95
Relative L2 0.0382 + 0.0076
0.0297 + 0.0043
0.0271 0.0032
0.0312 + 0.0033
0.0717 + 0.0096
Table 3: The relative L2 of the difference between the VF of OT-CFM and CFM at different time steps on the sampling trajectory.
A.3. The P Approximation
From the empirical perspective, we found that P 1 is valid choice for dependent couplings in realistic datasets. As we show in Table 3, the VF of the OT-CFM (batch size 128) in and uncoupled CFM trained on CelebA 256x256 have small relative error all flow time steps, their ideal guidance VFs are approximately the same, validating our approximation of p=1. 1.
Next, we give more intuitive understanding of the approximation. Our framework allows us to choose any r' (2)) (and hence P) as long as the source distribution is consistent: p(mo) = ff D' (zro/<r) p(an )e -e dæ,, In other words, the error induced by setting P = 1 can be characterized by the deviation in either the source distribution or the vector field. In the former case, the guidance VF is essentially considered exact, which implies n (zo = < Therefore, the error is induced by the fact that we should have sampled from x' (zal21) ()(2)) J(z)) ((=r))e))=)) 1z rather than the original p(2g). In
the latter case, we actually assumed the source distribution be unchanged, i.e., need x/ (3 p(xr) make the source distributions compatible automatically. In this case, the error is caused by approximating P = ((=o|=))
p(#a) with 1.
We now discuss the practical effect of the approximation, i.e., when it is good approximation and when it is not.
In the case of strongly dependent couplings, P Rs 1 still holds as long as varies slowly. This is demonstrated by the small deviation in the error of the source distribution (assuming x' <((zo/z)) = x1) as we discussed above. If J always -(xx)
near its average value, the source distribution J n T /2 p ) ((z1) dx, is almost J (< (z) )p((; )dz p(2a)
that is the original source.
Nevertheless, when both the coupling is strong and J/ varies intensively, a more complicated treatment is required for exact (ux) Although
guidance. For example, we can try to sample from the new source distribution (<=ol=)) one may argue that this may be equally difficult as sampling from the target distribution 1/2 p )=((e))) exactly, it may be learned more easily as the target distribution is potentially smoothed after being convolved with the "kemnel" ( We leave this more detailed treatment of P to future work.
A.4. Uncoupled Affine Gaussian Guidance
Here we prove that V.,, n, log ( is proportional to the guidance St in Eq. (1). Note that the term Vz, log Ze (zx) is widely used as guidance in the diffusion model literature (Dhariwal & Nichol, 2021; Ho & Salimans, 2022; Song et al., 2021; 2023b;a; Janner et al., 2022; Ajay et al., 2023). Therefore, we prove that our general flow matching guidance exactly covers the original diffusion guidance under the affine Gaussian path assumption, i.e., when flow matching falls back the diffusion model. Our proof here also elucidates how the gradient Vz, emerges from the original expression of the general guidance for flow matching in Eq. (1) where there is apparent gradient.
We restate Fq. (1) here:
(e(zz)= = / H(n)
pr(zol2)p(2 dz De (r(
(z1) - 1)0, (xrlz)
(21)
Zx( = / e ((( dz
(22)
po(21)
Assuming the flow matching to be of uncoupled afline path, we have
Ft = 0 + 04.1,
(23)
15

---

On the Guidance of Flow Matching
where or and on are schedulers satisfying boundary conditions og 01
1,01 =0g 0. Thus,
(z)=())))) 0,500 + d
1
+
(áhor o,
(24)
where ft = % denotes derivative to time and we define
by == J. (0 - 5.oe).
First, we demonstrate a useful technique for the proof later. Inserting Eq. (24) into ge (IT) in Eq. (21) and we have
/
((m))
1) + bεo)) pc(2z(z)p(2)
(xx)))
dz.
(25)
Ze
(r(
Since Z 1Expp(=/an lx.) le J[m))
(-)((1))
pe(2s12)p(2) dz = O. (1(2)
1)ax
(26)
Ze
That is to say, 24 inside the integral of Eq. (26) will integrate to zero, and we can freely remove or add it to construct desired terms.
Recall the assumption of uncoupled Gaussian path, i.e. p(zo, x1) = p(z)))((1)) p(ro) (z0o; 0, We can utilize the important fact that the conditional probability path for affine Gaussian path flows satisfies z; ~ ~N(x;; a,21, off)), which allows us to connect the conditional score to
3t 04g
logp(sssan))
(27)
of
Using Eq. (26) and Eq. (27), Eq. (25) can be further converted to e-)())))
/
c
b 2.
Pe Pe(xxla1)p(ar de
ge (x+)
1)(
(28)
Zz
Pr(
Eq. (26)
biož
/
Pe (aralai)ppe dan p((ss)
V,, log logr(a;/<r))
04
Z+
bios
/
c
(m2)))
pe(e, ((((1))))((11)) pe((t)
1)
V 2e logp(z;) + Va, log p 0(111/2)
dx
0tt
Zz
Bayes' mile
bio?
[
e-J(as))
po(2slz))p((z)) dx Po(xe)
1)
V legp(zz)
+V log (ogp(a))z1))
(29)
ait
Ze
Integrates zero in Eq. (26)
boo
Pe
1) log logp(1,/10)
dxa
(30)
Qzt
Zo
pi(2.)
Notice in Eq. (30) that
/ V log p(z)(()))))) (c(2o(=1)((a) dx
pr(ee)
= / p(a1lz)) log logp(a1 dx
Since fv lug S=
V Ve.p(eilze
V., / p(ailzs)dz
0.
(31)
16

---

On the Guidance of Flow Matching
Therefore
gx(21) = b,oy
/ e-J(o))
Pa Pc(xel11)p(a dx
Ot
Ze
pe(ore
b
e
J((()))
Pe( 2, log 10gg((21222 dx1
at
(x(e
Using again /V log
b,ož
(((1) V m.g p(1 (
(z(3
at
b,oy
V /
a1
(z(
Absorb [(mg) for it independent of 21, and exchange with integral
b,o7
ai
(x0)
2e's delinition in Eq. (1)
b,og Zz, log (zz).
(32)
at
Another possible way to derive this is to first prove the vector field affine Gaussian path flow matching to be affine to the marginal score, and we direct interested readers to (Zheng et al., 2023).
Remark A.2. The above derivation opens the possibility of using diffusion guidance into affine Gaussian path flow matching,
i.e., by multiplying a scheduler b,o7 =((dior-b;ar)) to the diffusion classifier guidance. The most common scheduler for flow matching is oz 1- 1--,,
tt, a2 = at
at al., 2023; Pokle al., 2024; Zheng et al., 2023; Tong et al., 2024; Liu et al., (Lipman et
2023a; Lipman et al., 2024). In this case, the guidance scheduler (1-t) It should be noted that this scheduler explodes near = O, thus being unstable. The flow matching schedule o, and at can be chosen other ways avoid this instability, Remark A.3. Note that this guidance cannot be applied to coupled paths. Central to the proof is that in uncoupled affine Gaussian paths, we can convert the conditional vector field to the conditional score. we could do this in coupled paths, would require (1) pe (a) 2) Gaussian N(x; pe, o,l), such that Va, (o Iz Mre and (2) Utj= 14, + (Z, 14) & Me. such that in Eq. (28) the conditional vector field can be converted to the conditional score. Therefore, the following equation must hold for any Te, z0, 21
it + òz( (Mx)) pt
(33)
inside the integral of Eq. (28) where μ4 Erwo + m1. This equivalent to that
(5: ozE;) + (m d + d,æ; x E1zO + m
(34)
must hold for any vr, To, 2i inside the integral of Eq. (28). According to Eq. (26), o, terms will integrate to zero, thus
(G a.L) = & (ij - d
(35)
which cannot hold because of the boundary conditions ço = 771 = 1 and a = = 0, 3t E (0,
dlog & dt
+ d ve
de can be observed that the reason why this guidance does not apply to coupled paths is that xp, x1, and x, are independent variables here, preventing us from canceling two of xn avoid matching the schedulers ratio.
A.5. Proof of Proposition 3.5
We prove proposition 3.5 here.
Proposition A.4. Any marginal variable f(x1, t) = (tw.. 2, k,t (20, 21) has intractable marginal loss
L Ey, (p((as) [1 t) - Es 2011
(36)
whose gradient is identical to the tractable conditional loss
C1l= = E Ex,,s,(()),)
[| 1) Seje x, 111]]
(37)
Unless & = which falls back to the uncoupled case.
17

---

On the Guidance of Flow Matching
Proof. Expand and take gradient w.r.t. Eq. (36) get
VoL. VoRizemppon [IIf((22)))) (a 2, 1)]
V [[]((zz;)))))))))))))))))) 6) -e-p 2, t)]
f Vop(2r)) [ ( 2112 dx;
/ Vor(ax) [110((22,))] 1)1 2( / pe (((e)oa)dd= dra Vope(s)m))p(a) (1lf 0)1 (x 1), f(2,, 2)t)) dxıdz
/
/
(1lfo t)1 (z 1), fx2,, dx,dz
E2 te Vo ()) f(x, 1) V Be [1 f(a, 2, t)
(38)
fil=
Thus, the gradient of the marginal loss Le is identical the gradient of the conditional loss L1)x-
A.6. Other Ways Obtain Zøz
Lu et al. (2023) proposed to use contrastive learning to train Zøz The proof already applies to any uncoupled path, and we show that Zøz does not depend on the coupling
Z: = p1 J(z)) / e ((2oo))(( 11, 2t)p((11l )d)2ddd
(39)
/ (z11) ((21)((z1 (((1i(z))da Enrop(a le)le
=
)(m)). M(m)).
(40)
That is, instead of actually sampling from p( - (ate), sampling from p(z, (xx) will result in the same Z. In the case of the coupled path, the marginalized distribution is identical to the uncoupled path case. Therefore, the contrastive learning method can be readily applied train ZΦz.
Besides training-basse Zazz also Monte Carlo estimation to obtain Z,. Notice that by using importance sampling, we have
p(aa [((1) p(x+)
Z. E 11:)) -exoi Ez =pp0pp))
(41)
As long p(a, (ro, 21) is known (which is often the case (Lipman al., 2023; Tong et al., 2024)), we estimate Z, by sampling N pairs of arg of from x1)0 and estimate
N
p(a arllai (xte) e -J(())
= Σ
(42)
N
p(2g,
similar technique used in Section 3.2.
A.7. Guidance Matching Losses
Here, we prove that the loss in guidance matching is correct and show there are three other equivalent training losses VVGM PRGM pMRGM The expressions of different losses are summarized below, and their proof follows.
VF-added Guidance Matching (VGM) Loss.
By utilizing the learned VF ug (are, 1) into Eq, (11), we have
2
VGM
go go t) + vo( t) Zoz (xee, Voje Uele (22(2)
(43)
18

---

On the Guidance of Flow Matching
Reweight Guidance Matching (RGM) Loss.
EVMM can be further shown equivalent to
((1)
RGM
7 N0 (x), t) (1 1) + vo(x), (1)
(44)
This training loss steers do to where e -2)( is larger by assigning large loss steer ga towards high e regions.
Marginalized Reweight Guidance Matching (MRGM) Loss. The above loss can be re-assigned a weight, which will result the same optimal I6, (Fe, t) as in Eq. (11). Specificallyy, by changing Zoz og t) its expectation under pr (æ+). we have the following equivalent loss
e-(()) MRGM
11 (IA, 1) + vo( 1) - V2ls (+a/2)]12
(45)
Z
where Z ~ptx) le-
& (MRGM is identical to a newly proposed fine-tuning loss Zhang et al. (2025). It can also be derived via importance sampling Eq. 10 and similar reweighting- baasee fine-tuning losses have been studied in the literature of diffusion models (Fan al., 2023).
(1) Guidance Matching Loss {GM
By using proposition 3.5, the following conditional loss
(oolare)) - Zoz .0 (x,,t)
(a=)
CGM E
1)0g a (2re22)
(46)
=PGM
has gradient that is equivalent to the marginal loss
e 1(11)
E (0.-200.1))
go( -Bapps/ad)
(1122)))))
(47)
Zozzag (21, =ge(as)
Therefore, using the loss Loz we can train dø to matching gt. Recall that Eq. (11) is identical to Lozz and we proved the validity of the guidance matching training.
(2) VF-added Guidance Matching Loss VGM, By replacing the learned VF vo(a,, t) into Eq. (46), we show that
Cy CVGM
Lostare t) + vol t) (ozing Del= (21|2)
J(1)
(48)
has a gradient equal to that of Co in Eq. (46).
Expand Eq. (46) to get
|patenn)) - 7 ng (21,
((ri))
27
CGM Ex (ene000.)).oppeeea.p.....
1) x (x1
e-
((21)
Bxoce(0.))22pp33)eeoaaae go (o( t) +||
Ue/ (2))(())22)1 (1e
Zoz og (xFe;
dependent
{(11)
((a1)
-ggg t), Zoze 1)
Vol (felz)) -2( Zoz (Iig 1)
Utjz (2el2), (x)=())))) (1)
(001) (2 (x t))]
(49)
dependent on
depeeddent on
19

---

On the Guidance of Flow Matching
After taking gradient w.r.t. 6, only the terms
e )((()
V ( |las(xe t)113 2(go(er,t) t), Zoz (x)=()))))) - ((0r) gole,, (50)
survive. Therefore, by assuming perfectly learned ca 1), i.e.
vo( () = Esup(alad [112(0))))
(51)
we have
=x=20(0.)):===pt)aaa-rd ( t])]
[m t))]
=Raup(E1ee)
(e-ou((. (m) [))
=Bgup(E(ee) (. (
=B =Bzup(=)kr)
(2 mpp()) ( (BE (2 94 [)]] (1o (2a,, 1), go (32, t))],
(52)
by adding back terms that the gradient is agnostic to, we can see that the loss L in Eq. (48) is equivalent Lo in
Eq. (46)
CM V VoBi..el..1.ssptttarraaaa [pator.)))
e-((z))
1)02 (1)e)))))
Zoz (,t,,
((m1)
- 1)12+
Zoz.on U//z (x2l221)) + [10 t)
e
Vanishes after V
e ((11))
e ((rr)
-2(go(Ee, 1),
Zoziog( (12t, Uel= (xxl2)) 2(
Zizz Utl= (xel())) 0e
2(wv 1), go (2 t)) (53)
Changed Uajo vo using Eq. (52)
[ao(xre,)+ vo(xi, Z sg (oie, Uoja (2al2))
(((1)
V aa
V Woco
(54)
(3) Reweighted Guidance Matching Loss RRGM, Eq. Replacing (GM in (46) with VGM
((21)
(0o(Ie)t) vo(xe.)) (=.l)))
(55)
and the loss LCM becomes LVGM which are shown equivalent in the following.
Starting from Eq. (49), we can extract lim) Zoz from the three terms depended on o, and thus showing the resulting loss
indeed (RGM Notice that because Zoz = E -Espp(sle)ll--eee
E Es-p(elau)
Zoz (x.) [xx,,)) t)] = f(x,,))
(56)
20

---

1 to On the Guidance of Flow Matching
Thus, have:
e J(r()
Lg Po (Te, 1)12 +1
Z (02,) (x)=(====) + (1ala11)
dependent on
e ((1(
((1()))
-1 t);
Vela V (2xl=)) -2 Zoz,og
Us Ve (2)e)))) (x)=()))=)) 2 (o t)
Zgg (0t, (t,t)
dopendent on &
dependent on it
(-J(m)
((11)
-E ((1)
g0 t)11 + +1
Zoz Zoz (2e,, Ut/ (20g 22)22+ + [
Zoz (xt)
Z (102) vel=( (</e())))))) - 6 ((((m))
e-J(m))
-2(gs(Te: 1), 70 Uel= (xgl2)) 2
(ve)=( f)
Zoz (21g)
(21)
Z (dz.sg(Ttt 10 1) + vo( Maja (1a=(11)
(57)
CRGM
(58)
Where used the conclusion of Eq. (52), and inserted terms that vanish after V make PRGM
(3) Marginalized Reweighted Guidance Matching Loss @MRGM The above loss Eq. (55) can be re-assigned weight, which will result in the same optimal 90(2,, t) as in Eq. (11). Specifically, by changing 20z
we have
plaa) su (Zest)dar
e-1())
S Se Se-J(ri)((2dds (10( + vo( [=)=(2+|2]113
(59)
We only need to prove that
f p(ai)z((zi)da=== / e-J(en)((2)dz.
(60)
Recall that
Ze(z,)= /
(61)
80
(ellaee--(lvddae / p( p(zx) = ff plas) / p(2/ar)e- s( (owdd,de
(62)
= / p(2)e (( dz
(63)
Eq. (45) can also be derived by applying importance sampling p 261) [1]-13] Ee-p(s) flow matching objective of the new VF for the new target distribution p' (xx) p(x)) J(m.).
((m))
| the
2
Diseussions The losses have the same expected gradient, but their performance may differ. Among the four losses, /MRGM is the only one that does not require the auxiliary model Z However, PRGM assigns loss weight dependent on Tt. The weight is emphasized when the expectation of ((x)) under ((x)) is small. Compared these two losses, (GM (YGM do not reweight the loss. The variance of zGM will be smaller if J is smooth, while PVGM is better when i/ is more complex. $
A.8. Algorithm Details and Variants of g MC
The pseudocode for computing g MC as follows.
21

---

On the Guidance of Flow Matching
Algorithm Monte Carlo estimation of the guidance gx()))
Require: Current I, 3t, known Pt (=telz)
1: Sample zi ~ p(z), where i = 1, .,,, N Recall 2; = (æi, zx))
2: po(x)) N E, (x
3: (xx) f N Ei (=)(( (wela))
M(re)
4: Si (x1)) f N E -oo
(F)l2)))))) pelaale) Po(as)
(a,)
5: return gt. (x1)
Independent Couplings. Although we introduced the flow matching using the condition & = (xp, 21), it can also be
chosen as Zg or æ1 (Lipman et al., 2024). When we 2 = 21, Algorithm can be readily adopted for the 26 condition. This way, the Monte Carlo estimation reduces the integration region dimensionality to half of the original one, thus becoming more efficient.
In the case where (zo, x1) and the data coupling is independent ( p(zo), show here that the MC estimation can be simplified to the co-oodiite case that is more efficient:
((m)
1)udes (2e/22) pr(2z((11)]
gt
MC-#1 (x+) A Exiop(e))
(64)
Zi
p((
z MC-n (xt) = B3smp(z1) e ((x) pe(2)(((1)
(65)
Po(xo)
Obviously, Z, p( 21 (xz)e J(z)) (())dogday I p(ro|21, x =1) (x))) J(a)) (())d integrating out zo gives Z, Zi MM Therefore, to prove the above simplification, only need to prove that:
((e))
()0( (psplla) ( (e-((e)) 1)0(a)lo2))
E Eng ppploo (ns)
(66)
Ze
Ze
The proof is simply integrating out zo:
e edx()
1)u(a) xn )drgdr
Zz
/ p(Zoo11, (()0 (e)0(e
((())
(ro, a )dro
Zr
=V(2(221)
[(x1)
= (()))
1)p(1a (elrrla1))d 1.)d
(67)
Ze
It should be noted that v( is defined to be generally different from v(xe(=o, x1), and to do MC estimation via importance sampling, we need the forward probability path p(z,(z1) to have a known density. The variance-reducing variant of g is summarized in Algorithm 2.
Algorithm 2 Monte Carlo estimation of the guidance g (x.)
Require: Current t, 24, known Pt (x
Sample æf ~ (z1),, where 1, 1,2,...
2: (((2)) 1 Σ, (xx
3: (xx))) t ト Σ; J(x)) (m)l
p(ae)
4: ((())) + 1/2 E.(5 (--oi) s(r
( ( p((z)l))) p.lo,)
2.(2z)
5: return (1x))
22

---

On the Guidance of Flow Matching
A.9. Localized Approximation
To get glocal, we presume p(z(az) is localized, and we can use a point estimation approximate Z₁:
Ze(x,) - ((=lax)e- ((1)) e (661)
(68)
where 01 = Exg 2p(1) [11) and then expanding to the first order
((ai)
ge(2)) 2 (xx)))) leaa) Bemp(s)le))
[(=) 1) (1sl2)
e (-)(6)) - J - b11) 1)
~ Eg (a(p(a
(-
- --Brrpp(alke
[(z] 21)00)= V (
(69)
To quantify the approximation error, we have
||óg| | == 1 local
j(z1)
E Bsmp(elze)
()01)=(0112)
(xtr))
(11) V J(11) -f1) ()0
|
(-)(6))
e-)(x))
e- - J(r)( -81)) (o) e-J(h1
Ezup(+
(70)
Zz(x))
2
where
(xx)) Reupp() J(z1)]. [e-
(71)
We start by computing the error bound of approximating Z, with - ((b1), Using Taylor expansion and the Taylor Remainder Theorem 9
(x(e)) - c
Ex-ple
Σ
D a.
c
J(x))
la = (01 - 22
k!
k=2
1
Beppleled
(2) 01)² Vo, VV, Vaye-((a) ((w))
21) m1 =1 ((0) -81)
(x)
(72)
(0)
where E [0, 1).
If we set the L2 norm of the covariance matrix E Egmp(s)= [(= -1)(21 - -1) as oi, and the eigenvalue with the largest absolute value of max [ to be An. can show that
Ze((re) - -
||
SE (1 81) (1 (xI +1)
< <Bants - 21) An (x1 - -+1]
< A Me 21)² (x1 --1)
< tn
LAnoyd,
(73)
"The notations here neglect the order of vector/matrix products, but this does matter all of them will be scaled using the triangle incquality.
23

---

On the Guidance of Flow Matching
where Σn is the covariance matrix of pla, (mn), is the dimensionality of x Rd. The last inequality follows from trA = Σ X S max; ' and the 1.2 norm of a matrix is its largest singular value, i.e. for the covariance matrix, that is the largest eigenvalue.
Then.
(-J(me)
c-
Va, (á) - ) Uz/=
5g B2=p((//re)
(x(1))
e(a())
(())
e- ((n)
e e-)(za) ((((
e (1 - J(i) - -&1))
(74)
Ze(3e)
{=)(2))
e- ((11
Using bound
Therefore,
A Zz(xx) (
||óg1|2 -
((r) [G()) E Ezmp(e)ze) 1(11) 2//2
2
e J(z1) - e ((31) - Va, (6g (2) - 21))
+ (emp(et()))
e-J(E1)
2
AnoId
E Eemp(=|z,) 1(x1)
(1ole)- 01/=
Z:(x;)e ((a))
1
(81) (1- (())) +1)) R2 e
-
Va, ((t)((II =1)) 0112
+ (xpp(()))
(75)
e-J(
By using the Taylor Remainder Theorem again, we have
1 (x) - =1)² Vee -(()
-01 R₂ = 2
J(S)
(x) - 21).
(76)
( -b1)
Thus,
|/gg| <
Apord
Ele ((z) v(2
+
E Ex)p(z)es)
1 2e-J(
(x) b1) 21)
B(e-J( 1(1)) -((())
Ele-J M(2)) u [z)]
Ble Hee)(e
-(())) 1(21)
(In - -1) 11 (x) - 2n1 111""
+ E Bzmp(z|er
E Ex-n(elen [1(221=))12
2e ((81)
Ele [( [22) [x+(=)]]
blavd
< p
+
E [10(00())
(77)
Ble Mori)ee 1(11) (((())
2e ((ar)
Then we have
E(e-J(z))) v [
A d
2
|| S Anond Ele-J(as) - J( {
+
I..
2e
J [((e))
2
dlord
E E(e-
1
c ((B[a))
+
E
(78)
Ci
C2
24

---

On the Guidance of Flow Matching
where we omit = p(z(az) (2) in [x= and simplify the notation to El-]- Therefore, the approximation error of glocl is bounded by (M (C1 + C2)/le->(bb))) where λ is the largest eigenvalue of h, the Hessian matrix of the objective function e e is the 1.2 norm of the covariance matrix, d is the sample dimensionality, C1 is constant that has to do with the norm of the new VF, and C2 is the variance of the original conditional VF. Some intuitions can be emphasized:
1. The error is small when J is smooth, in which case the Hessian of e will approach zero. This corresponds to the mild guidance, where approximation-basee gloval works well.
2. The error is small when d1 is small, i.e. the covariance matrix Σ1 has a small Frobenius norm. This is the case when the flow time + (and oe = 0), where 2y predicts 21 well.
3. The magnitude of le [( reflects how well how well the estimated generated sample E[z]] matches the objective given the current Zt. If E [ lies inside the region where J is small, i.e., E[ri] is good sample, then the approximate guidance will be more accurate as the optimization is conducted locally, and gradient can reflect the landscape well. If [[B(aa]) is large, the gradient is almost randomly exploring the sample space, producing a larger approximation error.
4. The cases where C₁ and C2 are small are not necessarily those where the guidance is of better accuracy. Because of the small norm of the VF, the error in the guidance VF will likely cause a larger deviation due to increased relative error.
A.10. Estimation of 1
Under the affine path assumption (Assumption 3.2), we can estimate the expectation of æ under the distribution p(2 (1)). This is a well-known trick (Lipman et al., 2024; Pokle et al., 2024), but our analysis includes the dependent coupling case.
Since the flow matching model learns
U/ v 1) x ve (x())) = Bemp(sla)) [=(x]]=)]
(79)
using the affine path assumption (x₃ = 04 + 3,00 + ozŌrE),
0(0z12) = dt = (áz) + Brr0 + o,E).
(80)
s0
(x1 Ez)p(=/>)) [dæ) + B1000 + 0,5
(81)
Meanwhile, taking the expectation of xa under p(2(1;)) yields
Eezep(ale)) [2:] = xt = Repp(e an) loror + Bero + o.s).
(82)
bocaus f =p(s|1))do=1
Then, by using Eq. 81 and 82, we can eliminate either ún or ④n in each other's expression:
cg = [em = â, (21(
àioe arOrE
+ Ezep(=)e))
(83)
3rdre 3.00.
Biàr Brar.
=
-Ber + (10)(
BroTe - Brore
(84)
B,dg Brau
Biàr - Brac
=st
It should be noted that we have assumed that o, is small and thus CP and Ç) also small in the affine path assumption (Assumption 3.2):
20 -hyo, + ago
Bi.r Bron IE
-, + anăr
I plar (ro, (100 (T x1) edandar
Bràr B,o0
p(xz)
-û:0; + -440
/
1
E Bempele) (n(o 21, e), xr me)e] dr
(85)
Bràr - B,or
p(x,)
25

---

On the Guidance of Flow Matching
Since (),, is probability max; (x) M(11, R2), and thus
distribution
that
is assumed
to be
bounded,
denote
- + or
/ p(zx) 1 [ de de =
lim & de 30,00 +0
lim
(86)
o: -0,60
+0
B, - Be
Since everything in the integral is independent of e, zo. or Ot, as of + 0 5 simply converges to zero. A similar approach can prove that 1i t is also zero.
Next, explain why specifically care about the case where the small o; assumption holds. In independent coupling flow matching, dNE is exactly zero since we can use two of 2,, and to express the third one. In dependent coupling flow matching, this assumption also holds for famous methods such as optimal transport conditional flow matching or Schrodinger Bridge conditional flow matching (Tong et al., 2024), where ~ NV I) and o, is set as a small constant. Therefore, the assumption that o, small in affine path assumption is general and applies to many existing flow matching methods. Hence, by approximating Ç and Ct as zero, we have the final estimation of 2t
d4 - 0400 (xe, 1)
④0 R
(87)
B.ù, - Brar
- B,x; + B,0 (2x)
Φ1 R
(88)
Bràr 3,00
where Eq. (88) is just Eq. (5). Note the approximations become exact under Assumption 3.3.
A.11. Proof of yoy
Here, we prove that under the affine path assumption (Assumption 3.2), Eq. (6)
à,
3,a
g
local se gi
2 Va, ((1),
(89)
3r
schodule
where
9t
local = -R 02) ( - t1 [1)011((Ta(2)] ((1)).
(90)
Under the affine path H, at31 + Br00 ore the conditional vector field U1je follows
(ie((r)) = d + 3,000 + o,s.
(91)
Plugging this into the definition of pocal and we get
local Esup(elea) (01-21)(ámm) (áyzz + 3,0o + + ((1
substitute za with des, and
3 (xt
Eewp(slen)l - B1 (i)((
+
a:2 018) + V ((t))
Br
(x) (x1) ((2ci (Brde, Bras - an
-- -EEpp(alan
11 + 5x + (ō. o1)8 V ((i
Br
in,3 Broue
Egjo V2, [(xi) (at oz (e f (())
(92)
Br
=T, limo, s0.d, 1|:11==0
where the 2, term is canceled out because f (()) (
p() - Ez-p(z [x]] = 0,
Ejje = Expp(()e)) [(x1 (21 ..)), and the residual term that characterizes the approximation error (denoted [|3)
26

---

On the Guidance of Flow Matching
in Eq. (6) (restated in Eq. (89)) is
Y =0; oz ) Bepp(
21 ((1) V1) p(Zole)p(z)
= 5z V (
p(ar) (2) - jedd)ddddr
=(a 8, Va, ((,) /
(Z0 (z) 21))
1 (0,
a,31 Broo)de daz
p(x))
= V ((11 /
p(a1)
(21 21)d21 / ((0
p
/
p(a1) p(a))
1 ( aræ1 o15) 21 dx1,
=(o V., (
(2) 21 Beep T
(93)
where (e) is the marginal distribution of e. Suppose || (# 0,31 o,s) 11) 11 = ( 21) M(x 24) (which is a function independent of e, then
|
/ p((1))
(I1 81 Bo)pee)) (0) F ( (2) (00--10 an orE) 21 [ dæj
< - a,) 1
p(zz)
<l(o, (17r--,)]11 (8)) /
p(x1)
(x) 21)
(enni(t) a ( (3 (1x arei - oxs) x
6.)
dr
p(x))
((MEemnac)lllell)) s S.Maarp..
/
<1(a - (
vr)) Varp, dri,
(94)
all of which are independent zo or. Thus.
lim |T]12 0. -00
(95)
A.12. The Jacobian Trick
We prove the Jacobian Trick here.
Proposition A.5. The Jucobian trick. Under Assumption 3.3, the inverse covariance matrix of p(x1(11)) Enjo is affine to the Jacobian of the VF Se, and is proportional to the Jacobian 021, oxe
dv
3 0&
E1jt on (r B,or))
(- (-Be + 3r
Ox. 0r
Proof.
To begin with, we prove Ejj: o, az," affine Gaussian path flow matching:
. 80,
A similar conclusion has been proved in Ye et (2024). We generalize their proof
Recall from Eq. (88) that
3e
B.
G1
+
(96)
3,as
-,,0
and
a4
50
It
dv,B, Br00 Vt.
(97)
3
Brore
So have the Jacobian trick
08
B,
B.
(x)(
(98)
Ox.
à
3,a0
àu 3,an
gz,
27

---

On the Guidance of Flow Matching
and because the VF is associated with the score
3e Blar)
dt +
v((2))
Ve, (og)
21-
(99)
a
a4
Next, we try to prove
1
ar
Vx V po:)
E
(100)
31
which allows us to connect the derivative of the score V2 log ((zz)) with the covariance matrix Eije-
V2,0(ar)
2
p(r)
Vv, logp(z;) log p(z))
21
p(are)
1
/ p(Z1)
dr Va, logg(o;) Vn, p(zr(
p((r))
using V2p=p log + (Vgg)) logp)?
1
((x1)((( V2
+ p(2./1)) logp(x./=1) logp(z:l21))dzz
p(x,)
Vn, logp(x;) V. log)(
22 log (())//2221)) (211 Vz, (ogp(xs/a)1) p(
Vz, logp(w;) log (1g)(
I1 14
21
ag mplan (mx) [m1]
-Ex, (2())
B
1
0
+
[Elzaat]
E[r11 [(x11
B?
B
a
5
(101)
B2
Bt
Then by combining Eq. (99) and (100) we have
0+1
Be
Be
(rr - Brass)
V.. Vo, (xr)
0x.
à,B,
3,a,
àr., - 3,00
at
at
Be
3r
Br - -Brrs)
1
a
(-
+
E
Blas
ôe - 3,00
att
B3
Br
02
at
(102)
3
Inserting back Eq. (88) and we prove
8.
Ovr
E11 al(án - B,0r)
(-Be + Br
(103)
A.13. Proof for Sim-
We begin with
/ e-((z)) (e-(ea)-1) Vel
Dt
sim-in inv (xre)
11
(104)
Z,
where 2, = /
fe-Jtay e-dlan) ((2lo))d))
(105)
We use VV and 2 interchangeably, with little abuse of notation. It should not cause confusion since the size of the terms in the equations must match.
28

---

On the Guidance of Flow Matching
and approximate p()) with (1 Ex) where #1 == Bempleles) and Eg is already known.
With Assumption 3.2 and assuming e e=)()) = =N(HHi y,, o, we have
2, = c [(x)) ((2/2))d
203 -il
liv-Hai Hml - (3- 21 d=
(106)
where 2 = (ão, 21) is the expectation of = under p(z(1x). Note H operates on only, and we pad the blocks related to xpp with zero H.
Then, by inserting the Gaussian approximation
sim-inv 9t
(2x)
/
e
(=((1))
-1)
1) (drz Be p(z)x))
(107)
Z,
Gaussian
/ Zi
exp
lly
H 112 2
- 5) 2) (dyz + (roo)d2 (x(x)).
(2
(108)
20
=
Remark A.6. Note that 2, couples zo and 21. This is fundamental feature of dependent couplings (Zo. x1). However, it may seem tempting further assume that Σ,1 is diagonal or even scalar. It should be noted that this assumption completely discards the dependency of zg and æ1 in the coupling, and thus, we try avoid that in the dependent coupling case.
For clarity, we need to express E, with
Σ A
E00
Eo1 E1
(109)
1
(-20g lly Hmm11 - _ 2)' (z - $)
Then, the distribution exp
is still a Gaussian, and to estimate the expectation of = = (zo; 21) we need to simply the probability density of this Guassian into a standard form.
1 (2 11a-27 ,3= (z 2)
Z,p(2|11)) = exp
2 ly Hx1ll2
1 (1lv12
2(y, Hol) + (11
1
-
1
2
(2. 2)
Σエ
exp
20
2
since 27,
=
1
11 H
21
1
exp
2
T
o
+
2
2(2,
o2
y +
Σ-
+
2
|y
2
Σー
1/8
(110)
It is obvious that the mean of this Gaussian is
-1
H
H
1T
+
og y + E
(111)
y
=
where we can find P's blocks to be
E
E En
P
E
= o3
H1
(112)
Then, by computing j = (ão, 2,) we can compute gr sim-iny + vt, where s f are the xy and x term in the integral of Eq. (108), because
St
sim-inv
+ 2 F. (( (dran + Bmo]
(113)
29

---

On the Guidance of Flow Matching
To simplify, insert back ot to get
gt g.
E (nng(llaa)) [d + Baro] - E (a (d20 + Berol
= -Brr àn!) P-1
H
0
+
Ego
Eo1
P
80
o y/
1
E11
11
0
0
0
= - dn1) p-1
H
%
y
+
0
H
H
= (BiI a,l) p-1
HT
1/
H
11
(114)
03
Usually, (3e1 àel) p-1 is difficult to obtain:
H 02
H
gt
sim-in inv (BrPoi axPri)
21
(115)
y
where Poi' and Pii requires computing the inversion of P and thus in general intractable. Using block matrix inversion, we have
- (-AETT Fol (En1
H H oy =10= -1 + ài (E1 of - -10
Hº
HT y
HT o (116)
9t gim-inn
+
$1
For general (possibly coupled) affine path flow matching, we can make approximations and set the blocks in Σ, to scalars, It should be noted that this Gaussian assumption can still capture some coupling between and 2ı since the off- blocks Eor and E10 are not set to zero. Specifically, we have
Dt
sim sim--nn-AA
+ HH H) HT (y - Hai),
(117)
where d and r² are hyperparameters. A approximates de i absorbing the flow schedule.
Special case: the non-coupled affine Gaussian path
Next, we prove that giin-ine covers IIGDM (Song et al., 2023a) and OT-ODE (Pokle et al., 2024) as special cases. Under the uncoupled affine Gaussian path assumption (Assumption 3.3), one may think that the covariance matrix is block diagonal, but it is false: zp and æ1 are still dependent on each other in the distribution p(=[=z) = p(ru, xy (xx) even the coupling independent. the uncoupled case, the probability graph is zo + H2 < 21, so although mo and #1 are marginally independent (I( 21) p(z)) )), their conditional can be dependent p( x1 lxx) * p(ro (arp::ppp////))) (r.). Then, we notice the uncoupled path
(118) so we actually should not have approximated the distribution Pz/z, Gaussian in the uncoupled case. Fortunately, there is workaround to make zu almost entirely dependent on Ø1. We can set To setting + 0 gives our desired uncoupled path results. The covariance matrix of 25 and æ1 to:
Zt 0131 + 3,0O.
a: Φ1 + f8, 24 + Ec, where c ~ N(0 I), and 3.
+
Σ,
3f
mym
(119)
Note that 1n1 A F as En is a block in the inversion of the larger matrix Ex, Next we compute Σ,
1-1
(Ezues - azExra (a
2 Emn
121)
I
ae I 3
g²
0 I
(Ezyzi Exjoy (Eezz) + 82
(120)
8,52
a,
30

---

On the Guidance of Flow Matching
where a 21 Therefore, En + oc, Soo
10
oir 3,C"
co, and Eoo = 1
xo. Thus, we need more detailed
3,
calculations to get the result:
HTH
H H
9t
sim-inn-diffusion
-
E11 +
310-T/0011
+ + E11 +
oy
oj
I
000
x00
HT
H H oz
of
Ø1
(121)
Obviously we want to find the finite term left in E11 - E10
lim Em - Ein
500
3 22 -1
-1
lim
Emy=
Emjar
+
- -E10ET150
{00
32
-1 af
lim {-0
Emio
Enjar (Emio)
22 1)
-1 ESmpon
18202
5 + 2
22
lim {-+
Σxyer
E Exizr
(Zor
7 25
21 Exizi
at
at
lim 5-+0
at 385²
Enjor
Ezres
37 +
-2
-1 -1
(122)
Now we have
ôr 3rco
H²
H
H o
gt
diffiin-
a² 1/
(123)
3r
y/
This is essentially the same formulation as in I1GDM (Song et al., 2023a) and OT-ODE (Pokle et al., 2024). Next, we will make some trivial conversions to cover the formulations exactly.
In diffusion paths (Assumption 3.4) we proved that 0h, lently,
E1j where Enje is just what we denote E Eny,,, here. Equiva-
S2, 3
dr.
(124)
Fä,
an
Thus,
Gr - BBot
HTH HT
HTH
9t
sim-inv-diffusion
Σ-1 +
o2 V
o2 in
B:
à, - -Brac
DMios 1091 + Ezia, 11 11 11) 11T (y H8:)
B,ar Bi 081 (02) + Ex,e, H H) (HT y H H
Br at dz,
Bi - Bhax))
( (o + En,a, HJ H) (HT y HTT H
a1
Oz:
Belrn - Broat) (w- !² T и (0 + Enj,, H H) 08, T Ox,
(125)
a1
31

---

On the Guidance of Flow Matching
Now make the same approximation in IIGDM that Exior = =ri Then by noticing that
( ( H =H H (o +
H (o)) + -) = (o " 11
(126)
We exactly cover
It
sim inn- Com-inv-TIGnng HIGDM
Be(du - B(as)
(y- H + + HH² H
0i1 Ox
(127)
at
and the scheduler fe(d, B.as) de
in the path 0g = 1, = becomes 1.5 which exactly covers the schedule in OT-ODE 021 instead of approximating it with ry-
which takes the same path. In addition, we can also directly compute Σx, using Buy, This corresponds to the approach in Boys et al. (2023), which uses the Jacobian to acquire the covariance and then remove the approximation enror in computing (o)I+ Σ,,,, (TTH)
Remark A.7. Starting from the more general assumption of affine path flow matching, we derived the guidance compatible with dependent coupling flow matching, including OT-CFM The fact that our guidance can exactly cover classical diffusion guidance like IIGM and affine Gaussian path flow matching guidance like OT-ODE verifies the validity of our theory.
B. Experiment Details
B.1. Synthetic Dataset Experiment Details
The training of flow matching models involves sampling To from a source distribution of {Circle,8 Gaus- sians,Uniform, ) } and sampling I1 from the target distribution of (S-Curve,Moons,) Guassians). The model backbone an MLP of 4 layers with hidden dimension of 256. The models are trained le5 steps.
To evaluate the asymptotic exactness of gMC, we compute the Wasserstain-2 2 (W2) distance of the samples generated under guidance, with the ground truth energy-weighted distribution p(z))e-((x)) /Z. Since the source distribution p(z1) is learned, the flow matching model itself has a small error w, which can also be quantified using the W2 distance. In principle, this error w characterizes the performance upper bound of the guided distribution: the W2 distance of the guided distribution will, in principle, not be significantly lower than w. The result shown in Figure 4, where w is demonstrated using the dashed line.
B.2. Planning Experiment Details
Settings. The experiment leverages the D4RL (Datasets for Deep Data-Driven Reinforcement Learning) dataset (Fu et al., 2020), specifically the Locomotion datasets, which is a common choice to evaluate offline reinforcement learning methods, as well as offline planning methods (Janner et al., 2022; Dou & Song, 2024). The datasets contain non-expert behaviors from which the model is required to learn the optimal policy, such mixture of expert and medium-level experts, the training replay buffer of an RL. agent.
To evaluate the performance of different guidance methods, we conduct experiments on offline RL tasks where generative models have been used as planners (Janner et al., 2022; Chen & Lipman, 2024). Our setting is based on that of a classical generative planner called Diffuser (Janner et al., 2022), where generative model generates state-action pair sequence of multiple future steps, and another critic model that predicts the future reward" of the generated plans. The generative model then optimizes its plans using guidance for higher future rewards. Following the formulation in Levine (2018); Janner et al. (2022), the optimization is realized through sampling from ( (e))))) where R is the critic model. This aligns with the goal of guidance which we discussed in this paper, so we chose this experiment to evaluate different guidance methods.
Baseline Methods. The results of the two baselines are collected from the literature (Janner et al., 2022). Behavior cloning refers to using a Gaussian distribution to fit the offline behavior distribution. Diffuser refers to using a diffusion model to learn the offline behavior and then guiding the model to generate plans with higher expected future returns. Note that the Diffuser also adopts training-based guidance, which requires re-training the guidance model when switching to a new objective function. On the contrary, the training-free guidances gav--,, good. gaim-MC, and MC has zero-shot generalization
Formally, it predicts the discounted return-to-go.
32

---

On the Guidance of Flow Matching
1.0
Circle - Moons
Gaussian + Moons
0.8
8 Gaussians Moons
W2 Distance
0.6
0.4
0.2
0.0
10a
102
103
Number of Samples
Figure 4: Error scaling with Monte Carlo sample number. In the synthetic dataset, the guidance performance (W₂ distance between the generated distribution and the ground truth energy weighted distribution p(z1)e /Z)))/ /Z) decreases as the number of Monte Carlo samples increases. The dashed lines denote the W/2 distance between the learned unguided distribution and the original ground truth distribution p(æ)). The reason why the guided generation errors (crosses) do converge to the dashed lines that they measure the W2 distance of p(x1) and p(a) ) -a()) /Z, respectively.
ability for (Zhou al., 2024) the objective function. the experiment results, we do not highlight the results baselines as we focus on the comparison between different guidance methods.
Schavior-cloning method but captures the actual action distribution rather than approximating with Gaussian. The generative model we consider here is the CFM or mini- optimal transport CFM with affine paths are an 8-layer Transformer with a hidden dimension of 256. The models are trained with le5 steps, a batch size of 32, a learning rate of 2c-4, and the cosine annealing learning rate scheduler. As for the critic model, it trained with the same backbone model using the last token as the value output and trained 1e4 steps, batch size 64, and learning rate of 2e-4. The value discount factor is set to 0.99 for all 3 datasets. We use planning horizon of 20 steps and the planning stride 1, We exclude tricks such using the inverse dynamics model, planning with stride, and using cample-and-seleet methods (Luu al., 2025), During evaluation, the same base model is utilized for different guidance methods to ensure fair comparison. We report the normalized score (Fu et al., 2020) where 100 is the expert RL agent's 's return.
Hy eyperparameters. As mentioned, generative model is first trained on the offline dataset
3, = 1 - t,, and whose backbones
For different guidance methods, different hyperparameter combinations are tuned. We elaborate on them here.
gov-A; We tune X, in (constant, cosine decay, exponential decay, linear decay) with a scaler (0.01, 0.1, 1.0, 10.0). where the schedule functions are normalized [0,
cov-G, The same hyperparameters are tuned as in 2
g MC, We tune the scale of J in (0.2, 2, 3,
5). The Monte Carlo sample number limited to be smaller than (128).
We also include a small number e to enhance numerical stability. We conduct an ablation study to show the performance is insensitive 6, as shown in Table
g MC, We tune scale before in f0.1, 1, 10) and the assumeed standard deviation of p(z) (z;) (0.1, 0.5, 1, 10). and do extra schedule and scale of the estimated guidance with schedule tuned in (linear decay, constant) and the
33

---

On the Guidance of Flow Matching
scale tuned in (0.1, 10). it worth noting that if the objective function J is properly normalized, the scale does not require extensive tuning.
9o: Training- methods have many hyperparameters involving model architecture and the training settings. We switch between different model depth and hidden dimensions, and different training losses. The best results for each loss are provided in Table 4 and 5.
Finally, for each pre-trained VF (CFM or OT-CFM), we try adding different guidance VFs (also CFM or OT-CFM), and then the best result is reported.
Estimation of the ground truth distribution of J. Suppose the unguided model generates p(x), and J(x) follows the distribution (J). Then, if x' ~ p((z) J(m), then J' follows
((()= - (x))det
8x )=
7 ((o)))-ddddde det
1
Ox 0J(z))
(128)
aJ(x))
Since for the original distribution
dr
p(J) p(x)det
(129)
aJ(x))
so
(((J) ---
(130)
Therefore, by sampling from the unguided model and then reweighting the distribution of J, we can compute the ground truth distribution p' (J) for the J under ideal guidance. Note that in the planning experiment, RR
should be noted that although gradient-based guidances gevv-A and gew-G result in distributions where the estimated that their performance is better: first, the goal of the guidance is the gray
return R is higher, it does not necessarily line, what we assume here is that the methods produce distribution close to the gray line is better; second, practically speaking, the high return is predicted by the critic model, but gradient methods may produce plans that the critic has not seen during training, which is called distribution shift, thus cheating the critic. On the contrary, the target guided distribution R(=1) /Z regularizes the guided distribution on the support of p(x1). alleviating the problem of distribution shift.
Additional Results on the Distribution of Generated R. The additional results of the distribution of R in different environments with different guidance scales (the in p' ((R)e R /Z)
/2) are shown in Figure 5.
Additional Results. The complete results, including standard deviations, are provided in Table 4 and 5.
Table 4: Full experiment results on D4RL Locomotion datasets. The base model is mini-batch optimal transport conditional flow matching. Entries with 2 95% score than the best per task are highlighted in bold. Baselines are excluded from the ranking.
w/o g
g
groo
glinMM
MC
9o GM
9. VGM
9g RGM
9. MRGM
Medium-Exppe
HalfCheetah
61.9 9
64.8 a 12.7
9.52
78.1
86.4 0.8
59.5 4 18.4
57.7 4 14.1
57.5 = 13.1
70.2 a 18.1 89.3
Hupper
22.2 97.3
112.3
112.3
112.7 a
23.3
98.1 16.3
Walker2d
39.1
107.2 1.4
101.0 10.2
107.5 1.0
87.0 16.7
90.5 + 10.0
88.0 17.2
91.3 11.7
Medium
HallCheetah
3.66
42.2 a 0.8
42.9 a 0.9
43,1 + 1.7
43.1 a 0.4
4.
43.0 1.2
42.7 0.8
43,4 0.9
Hopper
4.6
75.1 + 14.9
89.8 # 13.6
76.2 13.2
79.8 + 14.8
79.7 12.4
71.6 9.2
6.6
72.5 + 6.0
Walker2d
72.4
82.7 + 5.3
81.3 + 2.0
83.4 1.9
83.0 + 3.4
80.6 2.2
50.2 + 2.0
78.4
76.6 6.1
Medium-RRepayy
HalrCheetah
25.6
31.7 + 3.4
36.1 + 5.1
36.8 = 1.8
40.0 = 1.6
33.4
35.5
32,9
34.7 + 3.1
Hopper
3..1
15.4
74.1
13.1
11.6
$4.6
46.6 11.9
55.3
Walker2d
3.02+600
62.5 16.8
82.5 10.8
6.74
88.1 2.1
45.6 17.2
37.8
23.3
$2.4 20.6
B.3. Image Experiment Details
We pre-trained a CFM and mini-batch optimal transport CFM model with affine path a, t, 11 on CelebA-HQ 256x256 dataset. The flow matching model utilizes the backbone of a U-Net following (Pokle et al., 2024). The pretraining was conducted with a learning rate of le-4 and batch size of 128 for 500 epochs. The run time was roughly days on two
34

---

On the Guidance of Flow Matching
Jerti
2ALAAN gabieco
20C (Nt pananee
Retum Date butlon
Postur Dise bution
Retum Diertbu
0.05
Chemiiee Senale
2.000
0.03
0.030
2.008
6.01
0.03
3.000
202
402
300
1.00
309
200
200
403
500
0.09
200
220
246
243
206
bokvoted ketum
(a): HalfCheetah, scale 0.001.
(b): Walker2d, scale 0.001.
(c): Hopper, scale 0.001.
Sasteens #511 ract puidenci
Jasey
Rotum Distr bution
Det bution
Return Disributton
0.67
0.090
0.65
6.02%
2.006
0.64
3.002
0.835
0.65
0.990
402 Ditimotd Ratamn
Eiiimeted
Cutimutedd Fosuer
(d): HalfCheetah, scale 0.01.
(e): Walker2d, scale 0.01.
(f): Hopper, scale 0.01.
L,0000
Jo0teeaa AJA FAN pailasci
Ja
pth Iuls galtincal
Betturn Dldd buttin
3.032
0:04
3.002
0.65
6.855
0.000
0.62
3.00
3.000
202
403
4.40
.003
309
230
320
243
200
203
300
(g): HalfCheetah, scale 0.05.
(h): Walker2d, scale 0.05.
(i): Hopper, scale 0.05.
Figure 5: The complete results of the distribution of R. The distribution of J under MC matches the ground truth value (gray dashed line) very well.
Table Full experiment results on D4RL Locomotion datasets. The base model is conditional flow matching. Entries with 2 95% score than the best per task are highlighted bold. Baselines are excluded from the ranking.
w/o
g goo0
MC
9a GM
So VGM
RGM
9s MRGM
Medium-Expee Expert
HalfCheetah
46.4 10.1
63.4 4 17.8
68.5
83,5 + 4,2
87.7 :: 1.8
61.2 17.1
8.75
64.2 20.7
66.4 4 19.2
Hopper
83.4 19.2
93.9 a: 22.5
113.3 1.8
88.5 à 28.0
113.3
91.4 16.1
84.2 4/.22
86.2 18.7
86.5 a 22.4
Walker2d
96.2
1.2.3
100.9
98.2
Medium
HallCheetah
43.6
43.3
43.8
43.8
43.7
43.7
43.8
Hopper
73.2
79.1 9.8
82.7 11.9
82.1 9.2
88.0 11.3
14.4
85.2 15.5
74.0 16.3
71.6 14.7
Walker2d
7..2
80.7
8 2.8
81.9
81.9 1.4
23.7
2.19
63.3
$5.9 28.6
Medium-Replay
HaltCheetah
12.2
3.1
2.0
37.9 1.4
40.6 2.0
3..9
39.1
36.8 3.13
Hopper
17.2
63.0 4: 17.5
69.3 16.4
61.0 22.6
80.9 + 15.7
22.6
63.5 12.7
48.6 10.9
$7.3 + 24.0
Walker2d
28.3
64.9 1: 20.2
76.6 4 10.7
$8.9 à 18.9
70.9 21.7
57.5
70.3
53.1 22.0
$4.6 18.7
35

---

On the Guidance of Flow Matching
Table 6: Ablation study of the impact of the epsilon to the performance of g are highlighted in bold and underlined.
The best results and the second best per task
1
le
56-3
le-2
5e
HalfCheetah
Medium
42.5 1.6
43.1 + 0.6
39.8 + 8.4
41.7 2.9
43.2 1.5
Medium-Fxpert
68.2
66.9 + 17.1
75.6 + 12.6
74.6 + 12.1
72.7 = 16.6
Medium-Rephie
3.9
31.7 = 12.6
39.7 + 2.0
34.7 10.9
37.3 = 6.3
Hopper
Medium
69.0 10.6
67.6
73.1 9.4
72.2 10.0
72.6 12.3
Medium-Expert
95.4 # 19.5
103.2 # 19.2
108.0 # 12.3
107.1 + 14.3
101.5 + 20.8
Medium-Replay
53.8 18.7
59.1 + 17.0
68.2 + 18.7
68.1 18.1
74.3 + 18.8
Walker2d
Medium
74.6 6.5
75.1 + 15.2
74.0 10.6
71.1 13.8
74.4 11.0
Medium-Expert
79.0 26.4
95.7 + 17.8
94,2 + 22.0
100.9 # 17.6
103.0 + 7.9
Cedium-Replay
48.7 + 21.5
49.5 + 16.7
54.7 + 20.6
57.6 + 22.3
56.7 18.6
H800 GPUs. For the CelebA dataset, we employed a train-validation-tes. split of 8:1:1. The test data was subsequently used for three downstream tasks: central box inpainting, superresolution by four times, and Gaussian deblurring which is all common benchmarks.
Settings for the experiments. We evaluated the guidance methods using 3,000 images randomly sampled from the test set across the three inverse problems. Specifically, for deblurring, we apply 61 x61 Gaussian kernel with standard deviation of 1.0. For super-resolution, we perform 4 x downsampling on the CelebA images. In the case of box-inpainting, we use a centered 40 mask. Furthermore, for all three tasks, we add Gaussian noise after the degradation operation with a standard deviation of a 0.05 to the images.
Metrics. In this paper, we use four commonly adopted metries for image quality assessment: FID (Fréchet Inception Distance), which measures the distance between generated and real image distributions; LPIPS (Learned Perceptual Image Patch Similarity). which evaluates the perceptual similarity between images; and PSNR (Peak Signal-to-Noise Ratio) and SSIM (Structural Similarity Index) to quantify image quality in terms of signal preservation and structural consistency, respectively.
Why is MC bad at image inverse problems? As can be seen from Figure and Figure 7, the images generated by gCC do not respect the reference degraded image. This is largely due to the variance of the MC estimation being too high given the limited number of samples. Specifically, estimate It. one needs to obtain samples from regions where e is significantly higher than average, which corresponds the images that already look like the degraded image. Sampling such images requires infeasibly large number of samples. More advanced MC sampling techniques may help address this shortcoming, such as the control variable method (Owen, 2013). Combining gC and methods that are biased but with lower variance, such local or g>im, may also boost the performance.
However, on tasks such as conditional generation, as long as the condition often appears in the dataset, it will be casier to obtain an accurate estimation of gr using st Such scenarios include property-condition molecular structure generation, label-conditioned image generation, and decision-makingg tasks, which are included in our experiments.
Visualizations. We provide visualizations of the results of the inverse problems in Figure 6 and 7.
36

---

On the Guidance of Flow Matching
Clean
Degraded
g A
gsim-A A
g
IGGMM
g MC
Figure 6: The visualization of the image inverse problems with the base flow matching model of mini-batch optimal transport conditional flow matching (OT-CFM). Three rows show the results of Gaussian deblurring, box-inpainting, and super-resolution from top bottom.
Clean
Degraded
g
cov--A
g sim-A
g geov-G G
IIDM
g MC
Figure 7: The visualization of the image inverse problems with the base flow matching model of conditional flow matching
(CFM). Three rows show the results of Gaussian deblurring, box box-inpainting, and super-resolution from top to bottom.
37


Reviews:
[{"review_id": "FEmsLCCnXS", "reviewer": "Reviewer_YEWM", "summary": "The paper introduces a framework for guiding flow-matching models, which are advanced generative models. It extends the concept of guidance from diffusion models to a more general form. The framework includes training-free, asymptotically exact guidance using Monte Carlo methods, new training-based guidance losses, and approximate guidance methods that cover classical guidance techniques as special cases. The paper validates these innovations through theoretical analysis and experiments on synthetic datasets, offline reinforcement learning, and image inverse problems, demonstrating improved effectiveness and flexibility.\n\n## update after rebuttal", "questions": "", "limitations": "", "rating": 4, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Thank you for acknowledging the theoretical and empirical soundness of our work, as well as the potential impact in addressing the challenges in the generative modeling field. We answer your questions in the following:\n> Q1: How can the MC sampling efficiency be improved?\n\nMany existing techniques can be readily applied to enhance the efficiency of $g_t^{\\text{MC}}$. For example, we can adopt importance sampling to reduce the variance of the MC estimation. Specifically, using\n$$\ng_t^{\\text{MC-IS}}(x_t) = \\mathbb{E}_{x_1,x_0\\sim \\tilde{p}(z)} \n\\left[\\frac{{p}(z)}{\\tilde{p}(z)}\n(\\frac{e^{-J(x_1)}}{Z_t} - 1)  \\frac{p_t(x_t|z)}{p_t(x_t)}\nv_t (x_t|z) \n\\right],\n$$\n\n$$\nZ_t(x_t) = \\mathbb{E}_{x_1,x_0\\sim \\tilde{p}(z)} \n\\left[\\frac{{p}(z)}{\\tilde{p}(z)}\ne^{-J(x_1)} \\frac{p_t(x_t|z)}{p_t(x_t)} \n\\right],\n$$\nwe can select an alternative distribution $\\tilde{p}$ such that $\\frac{e^{-J(x_1)}}{\\tilde{p}(z)}$ has lower variance (i.e., when $e^{-J(x_1)}$ is large, $\\tilde{p}(z)$ is also large, and vice versa). This can be achieved by using another guided VF to sample from $\\tilde{p}$, such as using $g^{\\text{cov-A}}$. Then $\\frac{p(z)}{\\tilde p(z)}$ can be estimated using, for example, the Hutchinson trace estimator to preserve scalability [1]. It should be noted that this estimation is still unbiased. We conduct experiments to validate the effectiveness of this method, and the results in the table below showcase a performance comparable to the state-of-the-art methods on the image inverse problem, where the vanilla $g_t^{\\text{MC}}$ fails.\n \n|Method|FID$\\downarrow$|LPIPS$\\downarrow$|PSNR$\\uparrow$|SSIM$\\uparrow$|\n|-|-|-|-|-|\n|$g^{\\text{MC-IS}}$|7.863|0.1889|23.63|0.8429|\n|$g^{\\text{MC}}$|22.75|0.5589|8.67|0.3484|\n|$\\Pi GDM$|15.27|0.1753|25.48|0.8700|\n\n> Q2: What are the limitations of our $\\mathcal{P}=1$ approximation?\n\nFirst, we would like to clarify our approximation. Our framework allows us to choose any $\\pi'(x_0|x_1)$ (and hence $\\mathcal{P}$) as long as the source distribution is consistent: $p(x_0) = \\int\\pi'(x_0|x_1)\\frac{1}{Z}p(x_1)e^{-J(x_1)}dx_1$. In other words, the error induced by setting $\\mathcal{P}=1$ can be characterized by the deviation in either the source distribution or the vector field. \nIn the former case, we assume the guidance VF to be exact, i.e., $\\pi'(x_0|x_1) = \\pi(x_0|x_1)$. Here the error is induced by the fact that we should have sampled from $\\int\\pi'(x_0|x_1)\\frac{1}{Z}p(x_1)e^{-J(x_1)}dx_1$, rather than the original $p(x_0)$. In the latter case, we assume the source distribution to be unchanged, i.e., we need $\\pi'(x_0|x_1)=p(x_0)$ to make the source distributions compatible automatically. In this case, the error is caused by approximating $\\mathcal{P}=\\frac{p(x_0)}{\\pi(x_0|x_1)}$ with $1$.\n1. In the case of strongly dependent couplings, $\\mathcal{P}\\approx 1$ still holds as long as $J$ varies slowly. This is demonstrated by the small deviation in the error of the source distribution (assuming $\\pi'(x_0|x_1)=\\pi(x_0|x_1)$) as we discussed above. If J is always near its average value, the new source distribution $\\int\\pi(x_0|x_1)\\frac{1}{Z}p(x_1)e^{-J(x_1)}dx_1$ is almost $\\int\\pi(x_0|x_1)p(x_1)dx_1 = p(x_0)$ that is the original source.\n2. Nevertheless, when both the coupling is strong and $J$ varies intensively, a more complicated treatment is required for exact guidance. For example, we can try to sample from the new source distribution $\\int\\pi(x_0|x_1)\\frac{1}{Z}p(x_1)e^{-J(x_1)}dx_1$. Although one may argue that this may be equally difficult as sampling from the target distribution $\\frac{1}{Z}p(x_1)e^{-J(x_1)}$ exactly, it may be learned more easily as the target distribution is potentially smoothed after being convolved with the \"kernel\" $\\pi(x_0|x_1)$.\nWe will add this discussion to the revised manuscript.\n\n[1] Lipman, et al., Flow Matching for Generative Modeling, ICLR 2023.", "claims_and_evidence": "The claims in the paper are supported by thorough theoretical derivations and extensive experimental results. The introduction of the Monte Carlo-based training-free guidance is demonstrated to be asymptotically exact, backed by theoretical analysis and pseudocode.", "methods_and_evaluation_criteria": "Yes. The proposed methods are well-suited for the addressed generative modeling challenges.", "theoretical_claims": "Theoretical claims are carefully proven, such as the equivalence of the general flow matching guidance to classical diffusion guidance under certain assumptions.", "experimental_designs_or_analyses": "Yes. The experimental design is sound, employing appropriate baseline comparisons", "relation_to_broader_scientific_literature": "The paper builds on existing work in flow matching and diffusion models", "essential_references_not_discussed": "No", "other_strengths_and_weaknesses": "No", "other_comments_or_suggestions": "No", "questions_for_authors": "- Could the efficiency of the Monte Carlo sampling method be further improved for high-dimensional image tasks?\n- What are the major limitations you're currently addressing in P estimation for strong coupling?", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "h6yJT7zDm4", "reviewer": "Reviewer_reFm", "summary": "This paper provides a unified perspective on the guidance of flow matching and proposes a bunch of guidance methods to make it more general. The result shows the relevance between the tasks and guidance methods.", "questions": "", "limitations": "", "rating": 4, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Thank you for acknowledging our contribution in the theoretical framework, the novelty of guidance methods, the soundness of our empirical validation, and the clarity of presentation. We will respond to your questions below:\n\n> Q1: How to further address the scenarios where the $\\mathcal{P}\\approx 1$ approximation does not apply?\n\nFirst, we would like to emphasize that $\\mathcal{P}=1$ is a valid approximation for dependent couplings in realistic datasets such as CelebA $256\\times256$ in our experiment. As we show in the table below, the learned VF of mini-batch OT CFM (batch size as large as 128) and uncoupled CFM are close at different flow time steps, with a relative error of $\\sim 10^{-2}$, so their guidance VFs can be approximately the same, which validates our approximation of $P=1$.\n|time|0.05|0.25|0.5|0.75|0.95|\n|-|-|-|-|-|-|\n|Relative L2|$0.0382\\pm0.0076$|$0.0297\\pm0.0043$|$0.0271\\pm0.0032$|$0.0312\\pm0.0033$|$0.0717\\pm 0.0096$|\n\nTo produce exact guidance for dependent couplings, one approach is to dynamically adapt the guidance VF as you pointed out. Since $\\mathcal{P}\\neq 1$ changes high-dimensional integrals, it is costly to directly compute its influence. However, if we make assumptions on the form of $p(x_0|x_1)$ of the original VF, we can derive the corresponding $g^{\\text{MC}}$ and approximate guidance. Meanwhile, the approximation error caused by $P=1$ can also be compensated by adapting the source distribution as we discussed in our response to YEWM (Q2). Therefore, we can also parameterize the source distribution and optimize it to recover the exactness of the energy guidance. We will add a discussion on these future directions in the revised manuscript.\n\n> Q2: Test more tasks to highlight real-world utility.\n\nThank you for your suggestions. The experiments in our paper include data modalities from time-series data to images, and are realistic and high-dimensional. Therefore, we believe our empirical evaluation can effectively reveal the utility of different guidance methods on different types of realistic generative modeling tasks. \nIn addition, we provide an additional experiment on a class-label conditioned image generation task to increase the variety of guidance energy functions. With the trained CFM model in our image inverse problem experiment, we use another classifier on the gender to produce the objective function $J$, and consider two cases where either the male or female is set as the target. The table below shows the classification accuracy of the samples generated by different guidance methods:\n|Guidance \\ Target label|Male|Female|\n|-|-|-|\n|$g^{\\text{cov-A}}$|98%|85%|\n|$g^{\\text{MC}}$|82%|68%|\n\nThese results reveal that on image generation tasks, the performance gap between $g^{\\text{MC}}$ and $g^{\\text{cov-A}}$ is narrowed when the objective function is less complicated.", "claims_and_evidence": "All the claims are clear and convicing.", "methods_and_evaluation_criteria": "This paper proposes different guidance methods for different tasks.", "theoretical_claims": "NA", "experimental_designs_or_analyses": "NA", "relation_to_broader_scientific_literature": "NA", "essential_references_not_discussed": "NA", "other_strengths_and_weaknesses": "Strengths:\n- This paper provides a unified Framework for flow-matching guidance applicable to various distributions and couplings.\n- The training-free (g^MC) and training-based (g_φ) guidance techniques are novel.\n- Demonstrates effectiveness across synthetic data, image tasks, and RL, showcasing adaptability.\n- Contributions and derivations are well-structured and accessible.\nWeakness:\n- Does not fully address scenarios where couplings significantly influence outcomes.", "other_comments_or_suggestions": "Test more tasks to highlight real-world utility.", "questions_for_authors": "Can P be dynamically estimated to relax the P ≈ 1 assumption?", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "RO8GE5NkII", "reviewer": "Reviewer_erey", "summary": "This paper proposes a general framework for guidance in continuous flow matching that includes arbitrary source distributions, conditional paths, and coupling (to some extent).  Guidance is viewed as tackling energy-based sampling or posterior sampling given an existing flow matching model.  This general theory is shown to cover past instances of flow matching guidance as approximations and the framework leads to several new guidance methods including an asymptotically exact Monte-Carlo version.  The paper considers both training-free and training-based guidance, and also introduces several loss functions for training the guidance based on the framework.  The methods are then evaluated and compared on synthetic datasets, image inverse problems, and offline RL settings, where performance differences are understood relative to the approximations being made.\n\n\n## update after rebuttal\nThe rebuttal addressed performance in high dimensions and showed Monte-Carlo guidance could be useful for image inverses.  While the training-based losses' performance in practical tasks seems still lacking, I increased my score as the rebuttal increased my confidence that the results are both theoretically and practically valuable.", "questions": "", "limitations": "", "rating": 4, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Thank you for acknowledging the theoretical and empirical soundness, the presentation, and ample details of our work, as well as the contributions and potential benefits for future works in the field. We would like to address your concerns in the following:\n\n> Q1: The correctness of guidance VF assumes the trained VF to be identical to the true VF.\n\nThank you for raising this question. We indeed made this assumption throughout the paper. We will make it explicit in the revised manuscript.\n\n> Q2: There are assumptions on the specific type of guidance VF and coupling, limiting the framework's generality.\n\nThank you for your comment, and we appreciate your recognition of the overall generality of our guidance. We will add a more detailed discussion on these assumptions we made in the revised version, but would like to make the following clarifications:\n\nFor the conditional VF assumption, it is indeed an interesting research question to explore other possible conditional probability paths that may have different advantages, e.g., enhancing \"straightness\" of the VF for accelerated sampling. Nevertheless, our assumption of conditional VF is natural, and it allows us to simplify the form of guidance, covering many existing guidance methods.\n\nFor the assumption of $\\mathcal{P}=1$ in the dependent coupling case:\n\n1. Empirically, we argue that $\\mathcal{P}=1$ is a valid approximation for dependent couplings in realistic datasets such as CelebA $256\\times256$ in our experiment. As we show in the table below, the learned VF for mini-batch OT CFM (batch size as large as 128) and uncoupled CFM are close at different time steps, with a relative error of $\\sim 10^{-2}$, so their guidance VFs can be approximately the same, which validates our approximation of $\\mathcal{P}=1$.\n\n|Flow time|0.05|0.25|0.5|0.75|0.95|\n|-|-|-|-|-|-|\n|Relative L2|$0.0382\\pm0.0076$|$0.0297\\pm0.0043$|$0.0271\\pm0.0032$|$0.0312\\pm0.0033$|$0.0717\\pm 0.0096$|\n\n2. Theoretically, the $\\mathcal{P}=1$ assumption holds for any dependent couplings when $J$ is slow-varying. A more detailed discussion can be found in our response to reviewer YEWM (Q2).\n\n> Q3: Inconsistency of the general guidance expression between Figure 1 and the main text.\n\nThank you for pointing this out. We will fix it in the revised manuscript.\n\n> Q4: Are MC and training-based guidance useful in practice? What do you think of the experiment results of these guidance in high dimensions?\n\n1. We believe $g^{\\text{MC}}$ is of practical use in high dimensions.\n\nFirst, $g_t^{\\text{MC}}$ is practical (at least in some tasks) as it shows satisfactory performance in the widely used offline RL task of D4RL, where the sample dimensionality is not very small ($23\\times 20$ per sample).\n\nBesides, there are many techniques that can be readily applied to enhance the efficiency of $g_t^{\\text{MC}}$. For example, we can adopt importance sampling to reduce the variance of the MC estimation. Specifically, using\n\n$$\ng_t^{\\text{MC-IS}}(x_t) = \\mathbb{E}_{x_1,x_0\\sim \\tilde{p}(z)} \n\\left[\\frac{{p}(z)}{\\tilde{p}(z)}\n(\\frac{e^{-J(x_1)}}{Z_t} - 1)  \\frac{p_t(x_t|z)}{p_t(x_t)}\nv_t (x_t|z) \n\\right],\n$$\n\n$$\nZ_t(x_t) = \\mathbb{E}_{x_1,x_0\\sim \\tilde{p}(z)} \n\\left[\\frac{{p}(z)}{\\tilde{p}(z)}\ne^{-J(x_1)} \\frac{p_t(x_t|z)}{p_t(x_t)} \n\\right],\n$$\nwe can select an alternative distribution $\\tilde{p}$ such that $\\frac{e^{-J(x_1)}}{\\tilde{p}(z)}$ has lower variance (i.e., when $e^{-J(x_1)}$ is large, $\\tilde{p}(z)$ is also large, and vice versa). This can be achieved by using another guided VF to sample from $\\tilde{p}$ such as using $g^{\\text{cov-A}}$ and then $\\frac{p(z)}{\\tilde p(z)}$ can be estimated using, for example, the Hutchinson trace estimator to preserve scalability [1]. It should be noted that this estimation is still unbiased. We conduct experiments to validate the effectiveness of this method, and the results in the table below showcase a huge improvement comparable to the state-of-the-art methods on the image inverse problem, where the vanilla $g_t^{\\text{MC}}$ fails.\n\n|Method|FID$\\downarrow$|LPIPS$\\downarrow$|PSNR$\\uparrow$|SSIM$\\uparrow$|\n|-|-|-|-|-|\n|$g^{\\text{MC-IS}}$|7.863|0.1889|23.63|0.8429|\n|$g^{\\text{MC}}$|22.75|0.5589|8.67|0.3484|\n|$\\Pi GDM$|15.27|0.1753|25.48|0.8700|\n\n2. As for the training-based guidance, it has the potential to be widely applicable because it demonstrates the theoretical exactness in the synthetic dataset experiments. Although currently, its performance is restricted, possibly due to high variance induced by the dependency among multiple neural networks in training and inference, it can be potentially addressed by dynamically estimating $Z_t$ rather than training another NN to approximate it, or fine-tuning the guidance VF on the actual original VF. \n\n[1] Lipman, et al., Flow Matching for Generative Modeling, ICLR 2023.", "claims_and_evidence": "- Claims are supported throughout.  The framework is demonstrated useful through both organizing and understanding past research, as well as understanding relative performance on the experimental tasks", "methods_and_evaluation_criteria": "- The choice of methods, datasets, and evaluation criteria are appropriate for analyzing guidance.", "theoretical_claims": "- Checked proofs briefly in Appendix which appeared correct, but did not go through in detail.\n\n- The guidance in Theorem 3.1 is exact with respect to the true marginal vector field, but not necessarily a trained marginal vector field.  This is not an correctness issue in the proofs, but could be emphasized more in the main text.\n\n- Similarly, the conditional probability path and conditional VF are assumed the same for the guided distribution, and most of the paper considers independent coupling.  While the framework is still quite general, the authors could clarify these limitations further.", "experimental_designs_or_analyses": "- Experiment details for the RL, image inverse, and synthetic data setting appears sound", "relation_to_broader_scientific_literature": "Key contributions: \n- Framework to understand flow matching guidance covering and organizing many past approaches\n- General guidance methods that expand the scope of when guidance can be applied (arbitrary sources, conditional probability paths)", "essential_references_not_discussed": "None", "other_strengths_and_weaknesses": "Strengths:\n- Generally well-written with ample details provided, Figure 1 is a helpful reference organizing past research on flow matching guidance\n- Code to reproduce experiments is provided\n- Highly likely to be used as a reference for future research on guidance with flow matching models\n\nWeaknesses:\n- Usefulness of the Monte-Carlo guidance and the training-based losses in practical settings is underdeveloped", "other_comments_or_suggestions": "- Figure 1 contains notation (see general guidance expression) that disagrees with the rest of the text.", "questions_for_authors": "1. Do you anticipate that the training-based losses and / or asymptotically exact Monte-Carlo guidance will be useful in high dimensions?  To my understanding, the training-based methods were generally unhelpful outside the synthetic dataset example and were not tried in the image inverse setting.  Further, the Monte-Carlo guidance was also not useful for image inverses as discussed in Appendix C.3.", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "aB30o902MQ", "reviewer": "Reviewer_R43h", "summary": "In this paper, the authors provide a general flow matching framework for conditional generation based on an energy function.  The authors propose a unifying framework that constructs guidance for arbitrary source distributions and couplings. They derive various guidance methods based on MC estimation, which then they approximate with Taylor expansion, furthermore simplify using affine path assumptions, and finally assume stronger uncoupled affine Gaussian paths. Each of these provides one guidance method, which are all theoretically justified and then empirically analyzed. Then, the authors also provide derivative-free guidance and an inverse problem guidance. Finally, the authors also give training-based exact guidances. These are all examined on toy examples, RL and image problems.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Thank you for your detailed review and for acknowledging the contribution and potential impact of our work. We will address your concerns in the following:\n\n> Q1: Misleading expression of \"guidance\"\n\nWe apologize for the confusion. We will switch to 'energy guidance' to further enhance clarity.\n\n> Q2: The assumption of \\mathcal{P}=1 seems to contradict the claim in the paper that the guidance is substantially different from diffusion guidance.\n\n1. From the empirical perspective, we argue that $\\mathcal{P}=1$ is a valid choice for dependent couplings in realistic datasets. As we show in the table below, the learned VF of the OT-CFM in CelebA and uncoupled CFM have small relative error at all flow time steps, so their guidance VFs are approximately the same, validating our approximation of $\\mathcal{P}=1$.\n\n|Flow time|0.05|0.25|0.5|0.75|0.95|\n|-|-|-|-|-|-|\n|Relative L2|$0.0382$|$0.0297$|$0.0271$|$0.0312$|$0.0717$|\n\n2. Theoretically, with a slow-varying $J$, the approximate $\\mathcal{P}=1$ holds for any coupling. A detailed discussion can be found in our response to reviewer YEWM (Q2).\n\n3. We would like to emphasize that in addition to dependent couplings, our framework is also substantially different from diffusion guidance because (a) it extends to any source distribution and conditional probability paths as is also recognized by reviewer erey and reFm (b) a different theoretical framework is provided, as our derivations do not start from score-based models.\n\n> Q3. The Monte Carlo guidance has the limitation of lower sample efficiency, so is it practical?\n\n1. We argue that $g_t^{\\text{MC}}$ is practical (at least in some tasks) as it shows satisfactory performance in the widely used offline RL task of D4RL. The dimensionality ($23*20$) is already high enough in many practical generative modeling tasks, including generative modeling and molecular structure generation.\n2. Besides, there are many variance-reducing MC techniques, such as importance sampling. Specifically, we can use another guided VF to sample from an alternative distribution $\\tilde{p}$ such that $\\frac{e^{-J(x_1)}}{\\tilde{p}(z)}$ has lower variance. For the details of the new $g^{\\text{MC-IS}}$, please refer to our response to reviewer YEWM (Q1). It should be noted that this estimation is still unbiased. We conduct experiments to validate the effectiveness of this method, and the results in the table below showcase a huge improvement comparable to the state-of-the-art methods on the image inverse problem, where the vanilla $g_t^{\\text{MC}}$ fails.\n\n|Method|FID$\\downarrow$|LPIPS$\\downarrow$|PSNR$\\uparrow$|SSIM$\\uparrow$|\n|-|-|-|-|-|\n|$g^{\\text{MC-IS}}$|7.863|0.1889|23.63|0.8429|\n|$g^{\\text{MC}}$|22.75|0.5589|8.67|0.3484|\n|$\\Pi GDM$|15.27|0.1753|25.48|0.8700|\n\n> Q4. Why do many methods perform poorly in toy examples?\n\nActually, the toy examples are not trivial: sampling from $\\frac{1}{Z}p(x_1)e^{-J(x_1)}$ requires guidance theoretically exact. Otherwise, the samples will be distorted or exhibit mode collapse. Gradient-based guidance methods ($g^{\\text{cov-A}}$, $g^{\\text{cov-G}}$) rely on rough approximations; while approximate guidance ($g^{\\text{sim-MC}}$, CEG) produces biased guidance vector fields, leading to distorted sample distribution. \n\n> Q5. Why do these methods exhibit significant improvements when applied to more complex problems?\n\nNot all tasks require exact energy-guided sampling as in the toy example. There are tasks where sampling from a distorted, rather than exact, target distribution $\\frac{1}{Z}p(x_1)e^{-J(x_1)}$ may be practically useful, as long as both $e^{-J(x_1)}$ and $p(x_1)$ are high. The image inverse problem in our experiment is one instance where the approximate methods demonstrate improved performance. On the contrary, the offline RL task is conditioned on different initial conditions, necessitating stable guidance, so theoretically exact energy guidance is more robust.\n\n> Q6. More explanation is required for classfier-free guidance in the current framework (End of section 3.5, line 347-349)\n\nIn our framework, directly following our definition of the general guidance VF, the classifier-free guidance is simply subtracting the original VF from the conditioned VF (which also extends previous CFG to dependent coupling and arbitrary source distributions). However, as you pointed out, our training-based guidance is actually the flow matching version of the diffusion classifier-based guidance, rather than the classifier-free guidance. We will revise this paragraph and move this to the discussion section, as well.\n\n> Q7. The calculation of $g^{\\text{local}}$ is unclear.\n\nYou are correct. We will add the derivation of $g^{\\text{local}}$ in the main text in the revised version.\n\n> Q8. Other typos.\n\nThank you. We will fix these.\nFor 4, the conditional probability path is a design choice in flow matching, and we have thus assumed the new conditional probability path to be identical. We will make the assumption more explicit.", "claims_and_evidence": "Upon reviewing this paper, I have identified several claims that appear to require further clarification or support. Firstly, the title and abstract may be perceived as somewhat misleading, as they refer to \"Guidances of Flow matching\" without explicitly indicating that the primary focus is on energy-guided sampling. To avoid potential confusion, I think the authors should change the title and abstract to emphasize this key aspect of the work.\n\nIn Theorem 3.1, the authors assume that \\mathcal{P} equals or can be approximated as 1. Then, the authors say that it is reasonable for independent couplings or mini-batch OT flow matching with small batch size. Doesn't sufficiently small batch size OT basically behave almost as independent couplings? The reason why I am pointing this out is that later, at beginning of page 4, the authors put a lot of emphasis on \"guidance substantially different from diffusion one\", and as one of the examples give dependent coupling, which does not seem convincing given this assumption on \\mathcal{P}.\n\nFurthermore, I question the claim that experiments on synthetic datasets demonstrate the effectiveness and correctness of the proposed guidance methods. While some methods do perform well, others struggle to replicate simple base distributions, as illustrated in Figure 2. Specifically, only two methods (g^MC and g^\\phi) achieve satisfactory results, however the Monte Carlo method requires a nested MC estimation, which may not be practical. Furthermore, similar limitations are observed in the image experiments, where the authors acknowledge that g^MC does not perform well due to high complexity and sample budget constraints.\n\nRegarding classifier-free guidance, the authors mention its relevance but do not provide sufficient context or explanation. According to existing literature (e.g., Lipman et al.'s \"Flow Matching Guide and Code\"), classifier-free guidance can be readily applied using specific transformations between velocity fields and score functions, even though the theoretical derivations in their paper in order to establish CFG motivation are limited to Gaussian paths. The authors briefly mention CFG through \"These losses open the design space of the training loss for classifier-free guidance of flow matching (Ho & Salimans, 2022; Zhang et al., 2023).\", however it is unclear what the authors meant by this. I recommend rephrasing or removing the sentence to accurately reflect this.", "methods_and_evaluation_criteria": "The proposed methods and evaluation criteria appear to be well-reasoned and sound. However, I have some questions regarding the results presented in Figure 2. Specifically, it is intriguing that only two of the proposed methods demonstrate satisfactory performance on several simple and toy examples. This raises concerns about the generalizability and robustness of the other methods.\n\nWhat is really surprising is that some of these methods seem to exhibit significant improvements when applied to more complex problems. It would be helpful if the authors could provide further insight into this, as it may indicate that there are specific conditions or characteristics of the problems that favor certain methods over others.", "theoretical_claims": "I did not go through the proofs in the supplementary material but the theoretical claims in the main paper seem correct. However, the calculation of g_t^local should be referenced in the main paper as it is not clear how the formulation follows directly. If I am not mistaken, this is calculated in line 1080 in the appendix? If so, shouldn't the first line of Eqn (68) say g^local rather than g^cov?", "experimental_designs_or_analyses": "Please see above.", "relation_to_broader_scientific_literature": "The contribution seem timely and relevant, particularly considering the importance and need of guidance methods in flow matching.", "essential_references_not_discussed": "I am not aware of any relevant works that exist but have not been cited.", "other_strengths_and_weaknesses": "N/A", "other_comments_or_suggestions": "- Figure 1. is not completely clear. It would be nice if there was an explanation of it in the supplementary material at least.\n- Shouldn't the first sentence on in Section 2. Background, say data samples x_1 rather than x_t?\n- Furthermore, line 060, it should say \"it has been proven\" rather than \"it has been proved\"\n- Lines 154-156, where it is stated that \"the new VF has the conditional probability path as that of the original\" this is unclear why. The authors should elaborate further.", "questions_for_authors": "If the authors could address my concerns above I would be willing to increase my score.", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Meta-review: All reviewers agreed that this paper provides a solid contribution to the community by mapping the different FM guidance methods in prior work and proposing new and better methods.
Most of the issues raised by the reviewers were addressed in the rebuttal.
In contrast to training-free guidance methods, there were concerns about the effectiveness of the training-based guidance methods.
The authors agreed to change the general term of "guidance" to "energy guidance" to clarify the scope of the paper.
Decision: Accept (spotlight poster)