arXiv(opens in a new tab)cs.LGAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.29107

PathGuide: Dynamic Classifier-Free Guidance via On-Policy Transport Alignment

Avishag Nevo, Tamir Hazan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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.

1 Introduction

Modern generative modeling has achieved remarkable success due to its ability to model complex data distributions with minimal discrepancy between real and generated data laws. This is largely achieved by learning continuous-time dynamics [Dhariwal and Nichol, 2021b, Ramesh et al., 2022, Rombach et al., 2022, Saharia et al., 2022, Betker et al., 2023, Esser et al., 2024]. Within this paradigm, score-based models learn reverse stochastic or probability-flow dynamics [Sohl-Dickstein et al., 2015, Ho et al., 2020, Song et al., 2021b,a, Karras et al., 2022], while flow-based models learn probability paths via velocity-field regression [Lipman et al., 2023, Liu et al., 2022, Tong et al., 2024, Albergo et al., 2025, Huang et al., 2026, Chen and Lipman, 2024, Kapusniak et al., 2024].

Conditional generative modeling has enabled a vast array of machine learning applications, including text-to-image synthesis [Ramesh et al., 2022, Rombach et al., 2022, Saharia et al., 2022, Podell et al., 2023, Dai et al., 2023], video generation [Blattmann et al., 2023b,a, Singer et al., 2022], audio synthesis [Evans et al., 2024, Wang et al., 2023, Le et al., 2023], robotics and decision-making [Chi et al., 2023, Chen et al., 2021, Janner et al., 2021, 2022, Ajay et al., 2022], biomolecular modeling [Abramson et al., 2024, Corso et al., 2023, Yim et al., 2023], and post-training control tasks such as editing, inpainting, and spatial motion constraints [Avrahami et al., 2022, Brooks et al., 2023, Meng

∗^{*}Correspondence to avishag.nevo@campus.technion.ac.il.

Preprint.

et al., 2022, Lugmayr et al., 2022, Zhang et al., 2023, Bar-Tal et al., 2023, Garipov et al., 2023, Watanabe et al., 2026].

In these settings, inference-time control is paramount. Once a large-scale generator is trained, it is typically steered toward a desired condition using Classifier-Free Guidance (CFG), which usually relies on a constant scale or a hand-crafted schedule [Dhariwal and Nichol, 2021b, Ho and Salimans, 2022, 2021, Zheng et al., 2023, Lipman et al., 2024]. While effective at improving conditional alignment, misconceptions regarding the resulting sample law persist [Bradley and Nakkiran, 2024, Chidambaram et al., 2024], revealing deep path-wise inconsistencies: different segments of the trajectory often require varying guidance strengths [Kynkäänniemi et al., 2024, Wang et al., 2024, Castillo et al., 2023, Jin et al., 2026]. Excessive guidance scales can reduce diversity, trigger mode collapse and push samples away from the learned manifold [Chung et al., 2025, Jin et al., 2025, Wang et al., 2025, Saini et al., 2025, Cai et al., 2026, Fan et al., 2025, Sadat et al., 2025, He et al., 2024, Chidambaram et al., 2024]. Consequently, guidance selection should be treated as a path-optimization problem rather than a simple hyperparameter tuning exercise.

Existing methods attempt to mitigate these failures by heuristically adapting the guidance scale, training auxiliary networks for path correction, or imposing geometric constraints to counteract faulty interactions between the guidance scale and the model [Kynkäänniemi et al., 2024, Wang et al., 2024, Sadat et al., 2023, Xia et al., 2024, Yehezkel et al., 2025, Galashov et al., 2026, Koulischer et al., 2025, Chung et al., 2025, Jin et al., 2025, Fan et al., 2025, Wang et al., 2025, Saini et al., 2025, Cai et al., 2026, Watanabe et al., 2026, Sadat et al., 2025, He et al., 2024, Guo et al., 2024]. While useful, these approaches do not address a fundamental transport problem: which scalar CFG value ensures that the sampler's actual rollout remains faithful to the exact conditional probability path.

We introduce PathGuide, a framework that reformulates scalar CFG selection as an on-policy transport problem. Rather than treating guidance as a heuristic scaling factor, we derive a principled criterion using the weak form of the continuity equation [Villani, 2009, Ambrosio et al., 2005, Santambrogio, 2015] to establish a theoretical foundation for path correctness. Specifically, we derive a local objective with a direct path-correctness interpretation: if the guided field is weakly equivalent to the exact conditional field under the generated rollout, then - under the uniqueness of the weak continuity equation [DiPerna and Lions, 1989, Ambrosio, 2004] - the generated rollout coincides with the exact conditional probability path. By evaluating this objective directly on the sampler's empirical rollout and leveraging the endpoint-conditioned structure of flow matching [Lipman et al., 2023, Tong et al., 2024, Albergo et al., 2025], we translate this theory into a practical framework through the following contributions:

• We derive a rigorous local objective providing a principled measure of compatibility between the sampler’s realized rollout and the target conditional law at each time step.

• We prove that for the scalar CFG family, this objective is strictly quadratic and admits an efficient closed-form for the optimal guidance scale.

• We introduce a practical algorithm that supports both real-time online adaptation during sampling and the offline generation of reusable, piecewise-constant guidance schedules.

• Using controlled Gaussian-mixture flow-matching experimental validation across multiple flow families, we demonstrate consistent improvements in path alignment and endpoint fidelity over existing training-free baselines under matched protocols.