Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Improving Classifier-Free Guidance of Flow Matching via Manifold Projection

About

Classifier-free guidance (CFG) is a widely used technique for controllable generation in diffusion and flow-based models. Despite its empirical success, CFG relies on a heuristic linear extrapolation that is often sensitive to the guidance scale. In this work, we provide a principled interpretation of CFG through the lens of optimization. We demonstrate that the velocity field in flow matching corresponds to the gradient of a sequence of smoothed distance functions, which guides latent variables toward the scaled target image set. This perspective reveals that the standard CFG formulation is an approximation of this gradient, where the prediction gap, the discrepancy between conditional and unconditional outputs, governs guidance sensitivity. Leveraging this insight, we reformulate the CFG sampling as a homotopy optimization with a manifold constraint. This formulation necessitates a manifold projection step, which we implement via an incremental gradient descent scheme during sampling. To improve computational efficiency and stability, we further enhance this iterative process with Anderson Acceleration without requiring additional model evaluations. Our proposed methods are training-free and consistently refine generation fidelity, prompt alignment, and robustness to the guidance scale. We validate their effectiveness across diverse benchmarks, demonstrating significant improvements on large-scale models such as DiT-XL-2-256, Flux, and Stable Diffusion 3.5.

Jian-Feng Cai, Haixia Liu, Zhengyi Su, Chao Wang• 2026

Related benchmarks

TaskDatasetResultRank
Text-to-Image GenerationGenEval
Overall Score61.41
467
Text-to-Image GenerationPick-a-Pic
PickScore22.51
47
Image GenerationImageNet 256x256 50k images (val)
FID7.77
42
Text-to-Image GenerationDrawBench
Pick Score23.26
40
Class-to-image generationImageNet 256x256 50k images 2012 (test)
FID7.77
28
Showing 5 of 5 rows

Other info

Follow for update