Classifier-free Guidance with Adaptive Scaling
Dawid Malarz, Artur Kasymov, Maciej Zięba, Jacek Tabor, Przemysław Spurek
TL;DR
Classifier-free guidance (CFG) often faces a trade-off between prompt adherence and image quality. The authors introduce β-CFG, which combines gradient normalization with a time-dependent $β$-distribution to adapt guidance strength across diffusion steps, stabilizing the sampling trajectory and reducing outliers. Empirically, β-CFG achieves better FID scores while preserving text-to-image CLIP similarity comparable to standard CFG on tasks like COCO-based generation with SD models, and demonstrations on toy 2D data show closer alignment to the data manifold. The approach provides a practical, parameterizable framework for adaptive guidance that improves data-manifold alignment and sample quality without external classifiers.
Abstract
Classifier-free guidance (CFG) is an essential mechanism in contemporary text-driven diffusion models. In practice, in controlling the impact of guidance we can see the trade-off between the quality of the generated images and correspondence to the prompt. When we use strong guidance, generated images fit the conditioned text perfectly but at the cost of their quality. Dually, we can use small guidance to generate high-quality results, but the generated images do not suit our prompt. In this paper, we present $β$-CFG ($β$-adaptive scaling in Classifier-Free Guidance), which controls the impact of guidance during generation to solve the above trade-off. First, $β$-CFG stabilizes the effects of guiding by gradient-based adaptive normalization. Second, $β$-CFG uses the family of single-modal ($β$-distribution), time-dependent curves to dynamically adapt the trade-off between prompt matching and the quality of samples during the diffusion denoising process. Our model obtained better FID scores, maintaining the text-to-image CLIP similarity scores at a level similar to that of the reference CFG.
