PathGuide: Dynamic Classifier-Free Guidance via On-Policy Transport Alignment
Organizations: Technion - Israel Institute of Technology
Abstract
While modern generative models excel at modeling complex data, precise inference-time control in conditional generation remains a critical challenge. Classifier-free guidance (CFG) is a primary mechanism for such control, yet it is typically treated as a static tuning parameter. In flow-based models, however, the guidance scale fundamentally dictates the velocity field and the resulting probability path, making guidance selection a dynamic path-optimization problem. We introduce PathGuide, a framework that reformulates scalar CFG selection as an on-policy transport problem. Leveraging the weak form of the continuity equation, we derive a selection criterion with a direct path-correctness interpretation: we prove that if the guided field is weakly equivalent to the exact conditional field along the generated rollout, the sampler's path coincides with the target conditional law. For scalar CFG, this criterion yields a strictly quadratic local objective with an efficient, closed-form selector for each solver interval. PathGuide enables optimal guidance scales to be computed and used online during generation or fitted offline as a reusable piecewise-constant schedule. We validate our method on low-resolution image manifolds and controlled settings across various continuous-time flow constructions, demonstrating that this transport-based selector improves path alignment and sample fidelity over both fixed and state-of-the-art adaptive guidance baselines.
Figures & tables
| KL | MMD | ||||||
|---|---|---|---|---|---|---|---|
| Variant | Method | ||||||
| RF ( Liu et al., 2022 ) | Plain CFG | ||||||
| CFG-Zero ∗ | |||||||
| CFG-MP | |||||||
| R-CFG++ | |||||||
| PathGuide (Ours) | |||||||
| RF ( Liu et al., 2022 ) | OT ( Lipman et al., 2023 ) | ||
|---|---|---|---|
| Method | FID | Method | FID |
| Plain CFG | Plain CFG | ||
| CFG-Zero ∗ | CFG-Zero ∗ | ||
| CFG-MP | CFG-MP | ||
| R-CFG++ | R-CFG++ | ||
| PathGuide (Ours) | PathGuide (Ours) | ||
Appendix figures & tables20 assets
Supplementary material from the paper’s appendix.
Appendix
| (54) |
| Variant | Conditioning | Path sample | Velocity label |
|---|---|---|---|
| RF [ Liu et al., 2022 ] | |||
| OT [ Lipman et al., 2023 ] | |||
| I-CFM [ Tong et al., 2024 ] | |||
| VP [ Song et al., 2021b ] |
| Item | Value / convention |
|---|---|
| Endpoint law | Eq. ( 81 ) |
| Source law | |
| Dimension | |
| Class schedules | fitted separately for each |
| Main solver | fixed-grid Euler |
| Solver grid |
| Method | Sweep grid |
|---|---|
| Plain CFG [ Zheng et al., 2023 ] | |
| CFG-Zero ∗ [ Fan et al., 2025 ] | , |
| CFG-MP [ Cai et al., 2026 ] | , (GM); (MNIST) |
| Rectified-CFG++ [ Saini et al., 2025 ] | , |
| Flow | Paired FID | 95% CI | Mean schedule diff. | |
|---|---|---|---|---|
| RF | ||||
| OT | ||||
| RF | ||||
| OT | ||||
| RF | ||||
| OT |
| Ablation | Variant | Time | |||
|---|---|---|---|---|---|
| reuse | online | 0.0059 0.0041 | 0.0075 0.0048 | 0.0009 0.0005 | 13.58 5.67 |
| offline, same | 0.0060 0.0042 | 0.0076 0.0049 | 0.0009 0.0005 | 13.58 5.66 | |
| weights | posterior | 0.0059 0.0041 | 0.0074 0.0048 | 0.0008 0.0005 | 13.51 5.72 |
| uniform | 0.0060 0.0042 | 0.0075 0.0049 | 0.0009 0.0005 | 13.42 5.61 | |
| stability | floor off | 0.0065 0.0048 | 0.0079 0.0053 | 0.0009 0.0006 | 13.52 5.73 |
| floor on, | 0.0059 0.0041 | 0.0075 0.0048 | 0.0009 0.0005 | 13.57 5.60 |
| Flow | MMD | KL | Mean error | Cov. error | |
|---|---|---|---|---|---|
| RF | |||||
| I-CFM | |||||
| OT | |||||
| VP |
| Flow | Pointwise projection: / KL / MMD 2 | PathGuide: / KL / MMD 2 |
|---|---|---|
| RF | / / | / / |
| I-CFM | / / | / / |
| OT | / / | / / |
| VP | / / | / / |
| Flow | KL | MMD 2 | |
|---|---|---|---|
| RF | |||
| I-CFM | |||
| OT | |||
| VP |
| Method | Offline fit cost | Sampling cost | Memory | NFE-equivalent |
|---|---|---|---|---|
| Conditional-only | none | |||
| Constant CFG | sweep over | |||
| Proposed, offline | Eq. ( 86 ) | |||
| Proposed, online | none | Eq. ( 86 ) during sampling | plus estimator work |
| Workload | CFG / stored PathGuide | PathGuide fitting | |
|---|---|---|---|
| GMM, , , | 10.0 s / 34 MB / | 19.7 s / 34 MB / | 137 s / 333 MB / |
| MNIST, , , , | 29.9 s / 315 MB / | 59.6 s / 327 MB / | 230 s / 578 MB / |
| Experiment family | Runs | Total time | Mean time |
|---|---|---|---|
| Baseline sweeps | 163 | 226.9h | 1.4h |
| Correction-field diagnostics | 173 | 27.8h | 9.6min |
| Online path alignment | 11 | 22.8h | 2.1h |
| Fit-at- , infer-at-coarser- | 136 | 145.3h | 1.1h |
| Monte Carlo scaling | 87 | 236.5h | 2.7h |
| Schedule heatmap overlays | 86 | 60.3h | 42.1min |
| Variant | Method | Configuration | KL | MMD | |
|---|---|---|---|---|---|
| RF | Plain CFG | ||||
| CFG-Zero ∗ | , | ||||
| , | |||||
| , |
| Variant | Method | Configuration | KL | MMD | |
|---|---|---|---|---|---|
| RF | Plain CFG | ||||
| CFG-Zero ∗ | , | ||||
| , | |||||
| , |
| Variant | Method | Configuration | FID |
|---|---|---|---|
| RF | Plain CFG | ||
| CFG-Zero ∗ | , | ||
| , |
| Method | |||
|---|---|---|---|
| Practical schedule | |||
| Exact field |