Particle Dynamics of Flow Matching and Classifier-Free Guidance from a Stagewise Geometry Perspective
Authors: Jian-Feng Cai, Zhengyi Su, Chao Wang
Organizations: Department of Mathematics The Hong Kong University of Science and Technology Hong Kong SAR, China · Department of Statistics and Data Science Southern University of Science and Technology Shenzhen, Guangdong, China
Flow matching, together with classifier-free guidance (CFG), is widely used in generative modeling, yet much of the theoretical understanding remains distribution-wise. Since practical sampling follows individual trajectories, distribution-level guarantees alone do not fully capture how trajectories interact with the data geometry or how guidance reshapes it. To overcome this limitation, we establish a unified stagewise geometric theory of attraction and absorption for both continuous dynamics and explicit Euler discretization. Specifically, with t∈[0,1] running from noise to data, we show that unconditional flow trajectories are successively attracted toward a neighborhood of the global mean, the data convex hull, and a neighborhood of a possibly nonconvex local cluster. Across these stages, the corresponding distance satisfies a common contraction estimate, yielding an O(1−t) decay of the distance in the final stage. For CFG, the same structure persists with an extrapolated mean, an inflated conditional convex hull, and, near the target cluster, the restored local geometry of conditional flow matching. We further show that a general time schedule a(t) replaces the O(1−t) decay by O(1−a(t)). Together, these results provide a unified particle-level geometric account of flow matching and CFG across continuous and discrete sampling.
Figures & tables
Stage
Ref
Dynamics
Geometry and result
Contraction / terminal rate
Early
Theorem 4
Uncond. flow (cont.)
mean-ball attraction
(1−t)/(1−s)
Theorem 5
Uncond. flow (disc.)
mean-ball attraction
(1−ti)/(1−tj)
Theorem 12
CFG (cont.)
extrapolated mean-ball attraction
(1−t)/(1−s)
Theorem 38
CFG (disc.)
extrapolated mean-ball attraction
(1−ti)/(1−tj)
Early and inter.
Theorem 6
Uncond. flow (cont.)
Conv(D) attraction
(1−t)/(1−s)
Theorem 7
Uncond. flow (disc.)
Conv(D) attraction
(1−ti)/(1−tj)
Table 1: Stagewise summary of the main theoretical results.
Figure 1: Schematic illustration of the geometry behind UFM. The smoothed squared-distance term distt2(x,tD) captures the moving data geometry associated with tD , while the full objective ft(x)=21distt2(x,tD)−21−t∥x∥2 determines the ideal flow direction.
Figure 2: Stagewise moving geometries for the unconditional trajectory. In the early stage, xt moves toward the moving mean ball tBrmean(yˉ) . The scaled data convex hull tConv(D) provides a global localization geometry. In the final stage near a target cluster Ω , xt moves toward the cluster neighborhood tBrΩ(Ω) .
Figure 3: Conditions behind the final-stage theorem. (i) The working neighborhood BR(Ω) lies inside the ρΩ -neighborhood on which the metric projection is single-valued. (ii) The polynomial lower mass bound holds uniformly at every y∈Ω . (iii) The separation from BR(Ω) to the rest of the data is larger than R+DΩ , equivalently γΩ=δΩ2−(R+DΩ)2>0 .
Figure 4: Stagewise moving geometries under classifier-free guidance. In the early stage, guidance changes the attractor to the extrapolated mean yˉcfg . The neighborhood of the scaled, inflated conditional convex hull provides a coarse localization geometry; after capture and separation, this neighborhood is refined to a smaller one. In the final stage near a conditional cluster Ωc , xt moves toward tBr~Ωc(Ωc) .
Figure 5: Convex-hull attraction and absorption. Left: the Euler trajectory and selected scaled convex-hull snapshots; the star marks the first entry into tiConv(D) , and the dashed curves show the moving convex hull at selected grid times. Right: dist(zi,tiConv(D)) decreases to zero and remains zero after the first entry.
Figure 6: Final-stage local-cluster attraction and absorption. Left: five Euler trajectories enter their corresponding scaled cluster neighborhoods; stars mark the first entry, squares mark the final positions, and dashed contours show the initial, first-entry, and final scaled-neighborhood snapshots. Right: dist(zij,tiBr(Ωj)) decreases to zero and remains zero after first entry.
Figure 7: CFG trajectory geometry. Left: larger w shifts the extrapolated mean yˉcfg and redirects the early trajectory, while the full trajectories subsequently turn toward Ω5 ; dashed rays indicate scaled extrapolated means, circles mark trajectory snapshots, and squares mark scaled-mean snapshots. Right: In the final stage, dist(zi,tiB0.05(Ω5)) decreases to zero and remains zero after first entry.
Figure 8: Early-stage CFG attraction to the extrapolated mean with radius r=0.05 . Left: w=1.5 . Right: w=3.0 . Here, dist(zi,tiBr(yˉcfg)) decreases and stays below the linear reference (1−ti)∥x0∥ .
Figure 9: Final-stage Prediction-gap decay. The measured gaps are well fit by the asymptotic form 1−tiC1exp(−(1−ti)2C2) for w=1.5 and w=3.0 ; the shaded interval indicates the grid-time window used for the fit.
Figure 10: ImageNet-256 goldfinch early-attractor visualization. Top: unconditional, class, and extrapolated means. Bottom: samples from the same initialization. Larger w amplifies class-specific structure, while very large w over-saturates the output.
Figure 11: Late-stage removal of CFG extrapolation on ImageNet-256 with w=2 and 20 steps. After the indicated step, we remove w(vc−v∅) and finish with v∅ ; removing too early weakens performance, while removing after 12 or 16 steps stays close to the full CFG.
Switch-off
after 6
after 12
after 16
full CFG
NFE
26
32
36
40
FID ↓
8.45
6.24
6.23
6.24
Table 2: FID ↓ for late-stage CFG switch-off on ImageNet-256 using DiT-XL/2-256, w=2 , 20 steps, step size 1/20 , and 50k generated images.
Scheme A
Scheme B
Scheme C
Scheme A
Scheme B
Scheme C
Scheme A
Figure 12: Intermediate denoising states for Schemes A, B, and C under Euler sampling with fixed base step size Δt=1/105 . The three blocks show daisy, cup, and horse trajectories, respectively; each row contains 15 frames.
Dataset
NFE
w
A: standard
B: sampling reparam.
C: training reparam.
MNIST
60
1.5
10.24
10.67
9.78
CIFAR-10
100
1.1
5.20
5.38
4.85
ImageNet 32×32
100
1.2
5.05
5.45
4.93
Table 3: Ablation of training and sampling reparameterization. FID ↓ for (A) standard training and Euler sampling, (B) standard training with reparameterization in sampling, and (C) direct general-schedule training with Euler sampling.
Figure 13: DOPRI5 adaptive-solver cost by class for the directly trained models corresponding to Schemes A and C. Relative to a(t)=t , the nonlinear schedule a(t)=t+t2−t3 reduces both mean NFE/image and mean wall-clock time/image across all reported classes.
Schedule
FID ↓
Mean NFE/image ↓
Mean time/image (s) ↓
a(t)=t
5.74
156.21
10.67
a(t)=t+t2−t3
5.67
120.84
8.19
Table 4: Quality in FID( ↓ ) and sampling cost under DOPRI5. Both rows use the same DOPRI5 solver tolerances ( atol=rtol=10−5 ) and guidance scale w=3.5 .
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
Figure 14: Appendix-proof dependency map. The appendix is read from top to bottom.
Classifier-free guidance (CFG) improves conditional generation in Flow Matching, but strong guidance can distort the generated distribution and reduce diversity. We provide a geometric account of this behavior by viewing Flow Matching as a time-varying gradient flow and characterizing how CFG reshapes its underlying potential. This view explains how stronger alignment can be accompanied by mean displacement and trajectory concentration, and motivates controlling guidance through the model-implied terminal posterior mean. We therefore propose Posterior-Mean-Capped CFG (PMC-CFG), a training-free, per-sample method that adaptively retains the strongest feasible guidance without additional network evaluations. Experiments on synthetic and large-scale image-generation benchmarks show that PMC-CFG limits guidance-induced distortion and concentration while improving the alignment--diversity trade-off, with particularly strong benefits when nominal guidance is large.
Jishen Peng, Zheng Ma
School of Mathematical Sciences, Shanghai Jiao Tong University, Shanghai, China · Institute of Natural Sciences, MOE-LSC, Shanghai Jiao Tong University, Shanghai, China · Qing Yuan Research Institute, Shanghai Jiao Tong University, Shanghai, China +1
Despite the remarkable success of sampling-based generative models such as flow matching, they can still produce samples of inconsistent or degraded quality. To assess sample reliability and improve sample fidelity, we propose uncertainty-aware flow matching (UA-Flow), a lightweight extension of flow matching that predicts the velocity field together with heteroscedastic uncertainty. UA-Flow estimates spatially localized sample uncertainty by propagating velocity uncertainty through the flow dynamics. The resulting estimates serve as reliability signals that reflect data-manifold support for each generated sample or region. We further use them to steer generation via uncertainty-aware guidance (UG) and uncertainty-aware classifier-free guidance (UCFG). Experiments on ImageNet and CIFAR-10 show that UA-Flow's uncertainty tracks sample fidelity more consistently than element-wise baselines and that these signals also carry information about data-manifold support. On ImageNet, UG increases precision at the cost of recall and improves FID, while UCFG maintains lower FID than CFG at large guidance scales.
Flow matching has emerged as a simulation-free alternative to diffusion-based generative modeling, producing samples by solving an ODE whose time-dependent velocity field is learned along an interpolation between a simple source distribution (e.g., a standard normal) and a target data distribution. Flow-based methods often exhibit greater training stability and have achieved strong empirical performance in high-dimensional settings where data concentrate near a low-dimensional manifold, such as text-to-image synthesis, video generation, and molecular structure generation. Despite this success, existing theoretical analyses of flow matching assume target distributions with smooth, full-dimensional densities, leaving its effectiveness in manifold-supported settings largely unexplained. To this end, we theoretically analyze flow matching with linear interpolation when the target distribution is supported on a smooth manifold. We establish a non-asymptotic convergence guarantee for the learned velocity field, and then propagate this estimation error through the ODE to obtain statistical consistency of the implicit density estimator induced by the flow-matching objective. The resulting convergence rate is near minimax-optimal, depends only on the intrinsic dimension, and reflects the smoothness of both the manifold and the target distribution. Together, these results provide a principled explanation for how flow matching adapts to intrinsic data geometry and circumvents the curse of dimensionality.
Shivam Kumar, Yixin Wang, Lizhen Lin
Booth School of Business, University of Chicago · Department of Statistics, University of Michigan · Department of Mathematics, University of Maryland, College Park