PathGuide: Dynamic Classifier-Free Guidance via On-Policy Transport Alignment
Machine Learning
Summary
The authors study how to better control the generation process in flow-based generative models. They introduce PathGuide, a method that treats the adjustment of classifier-free guidance (CFG) not as a fixed setting but as a dynamic optimization problem along the generation path. By using mathematical tools from transport theory, they find a way to choose guidance scales that keep the generated samples aligned with the desired outcomes. Their experiments show that PathGuide improves the accuracy of generated samples compared to existing methods.
Authors
Avishag Nevo, Tamir Hazan
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.