Abstract
We investigate the theoretical foundations of classifier-free guidance (CFG). CFG is the dominant method of conditional sampling for text-to-image diffusion models, yet unlike other aspects of diffusion, it remains on shaky theoretical footing. In this paper, we first show that CFG interacts differently with DDPM (Ho et al., 2020) and DDIM (Song et al., 2021), and neither sampler with CFG generates the gamma-powered distribution $p(x|c)^\gamma p(x)^{1-\gamma}$. Then, we clarify the behavior of CFG by showing that it is a kind of predictor-corrector method (Song et al., 2020) that alternates between denoising and sharpening, which we call predictor-corrector guidance (PCG). We prove that in the SDE limit, CFG is actually equivalent to combining a DDIM predictor for the conditional distribution together with a Langevin dynamics corrector for a gamma-powered distribution (with a carefully chosen gamma). Our work thus provides a lens to theoretically understand CFG by embedding it in a broader design space of principled sampling methods.
Introduction
Classifier-Free Guidance (CFG) has become the standard technique for ensuring that text-to-image diffusion models faithfully follow user prompts. By mixing conditional and unconditional scores with a guidance scale $\gamma$, CFG allows for a trade-off between sample quality and diversity. Despite its empirical success, the theoretical underpinnings of CFG have been poorly understood. The common intuition that CFG samples from a "sharpened" distribution $p(x|c)^\gamma p(x)^{1-\gamma}$ is mathematically incomplete, as the CFG score does not correspond to a valid forward diffusion process. This work addresses this gap by reinterpreting CFG as a Predictor-Corrector method.
Methodology: Predictor-Corrector Guidance
The authors bridge the theoretical gap by introducing Predictor-Corrector Guidance (PCG), a framework that explicitly separates the sampling process into two distinct phases:
- Predictor: A standard denoising step, such as DDIM, which moves the sample along the diffusion trajectory toward the data manifold.
- Corrector: A Langevin dynamics step that "corrects" the sample by pushing it toward a sharpened version of the conditional distribution.
This decomposition allows for a more principled analysis of the guidance mechanism. The paper demonstrates through 1D synthetic examples that standard CFG does not strictly sample from the expected gamma-powered distribution and that its behavior varies significantly between different samplers like DDPM and DDIM.
Theoretical Equivalence
The core theoretical contribution is Theorem 4.4, which establishes an equivalence between CFG and PCG in the continuous-time (SDE) limit. Specifically, the standard CFG update is shown to be mathematically equivalent to a PCG step where the effective guidance scale $\gamma'$ in the Langevin corrector is related to the CFG scale $\gamma$ by the mapping: $$\gamma' = 2\gamma - 1$$ This finding reveals that CFG is essentially performing implicit sharpening via annealed Langevin dynamics during the denoising process. It also explains why CFG concentrates sampling in high-probability regions (modes) where the model's learned scores are most reliable, thereby improving generalization.
Experimental Results
The proposed PCG framework was validated on ImageNet using EDM2 models and on high-resolution text-to-image tasks using Stable Diffusion XL (SDXL).
Quantitative Performance
On ImageNet, PCG demonstrated competitive performance, sometimes exceeding standard CFG in terms of Fréchet Inception Distance (FID). For instance, at a guidance scale of $\gamma=1.1$, PCG with five Langevin corrector steps achieved an FID of 3.35, compared to 3.90 for standard CFG.
Visual Consistency
Qualitative evaluations on SDXL confirm that the PCG sampler, when using the derived $2\gamma-1$ scaling, produces images that are visually consistent with those generated by standard CFG. This confirms that the theoretical mapping holds in complex, high-dimensional settings.
Conclusion and Future Work
By framing CFG as a Predictor-Corrector method, this work provides a rigorous theoretical foundation for the most widely used guidance technique in diffusion models. While it clarifies the stochastic version of CFG, future research is needed to fully analyze the deterministic (DDIM) variant and to develop methods for automatically determining optimal guidance scales. PCG opens a new design space for sampling methods that can potentially improve both the efficiency and quality of conditional generation.
Summary updated