Classifier-Free Guidance with Adaptive Scaling

Dawid Malarz, Artur Kasymov, Maciej Zięba, Jacek Tabor, Przemysław SpurekFrontiers in Artificial Intelligence and Applications 2025 · OpenAlexGitHub resource

Abstract

Classifier-Free Guidance (CFG) is essential for text-to-image diffusion models but often forces a trade-off between prompt alignment and image quality. We present $\beta$-CFG, a method that replaces constant guidance scales with a dynamic, time-dependent curve based on the $\beta$-distribution. By concentrating guidance in the intermediate stages of denoising and tapering it at the boundaries, $\beta$-CFG produces high-fidelity images that strictly adhere to prompts while remaining on the natural data manifold.

The Guidance Trade-off in Diffusion Models

In text-to-image generation, CFG is the standard mechanism for ensuring model outputs align with user prompts. However, practitioners face a persistent "guidance trade-off": high guidance scales improve prompt adherence but often result in "over-baked" images with saturated colors and reduced structural diversity. Conversely, low scales yield realistic images that may ignore the prompt entirely.

The authors identify the use of a constant guidance scale throughout the denoising process as the root cause. Diffusion sampling typically occurs in three phases: establishing global structure, developing semantic features, and refining fine details. Applying a uniform "force" at every step is suboptimal, particularly in the final stages where excessive guidance can push the image away from the manifold of realistic data.

Adaptive Scaling via the $\beta$-Distribution

To address this, the researchers introduce $\beta$-CFG, which utilizes a dynamic scaling curve derived from the $\beta$-distribution. This approach allows the guidance strength to be low at the start (allowing the model to find a natural initialization), peak during the middle stages (where semantic structure is determined), and vanish at the end (enabling a high-quality, realistic finish).

Guidance strength curves over denoising steps for different normalization parameters.

Additionally, the method incorporates Gradient-Based Adaptive Normalization. Controlled by a hyperparameter $\gamma$, this normalization ensures that guidance updates remain stable and independent of the data's dimensionality, preventing erratic trajectories during sampling.

Experimental Validation

The effectiveness of $\beta$-CFG was evaluated using MS-COCO 10k benchmarks on Stable Diffusion v1.5 and SDXL. Quantitative results show that $\beta$-CFG consistently achieves superior Fréchet Inception Distance (FID) scores compared to standard CFG and other baselines, particularly at higher guidance scales. Importantly, these gains in image quality do not degrade prompt alignment, as evidenced by stable CLIP similarity scores.

Qualitative comparison of ground truth, no guidance, standard CFG, and β-CFG.

Qualitatively, $\beta$-CFG avoids the artifacts and "washed out" appearance typical of high-scale standard CFG. As shown in the visual comparisons, $\beta$-CFG maintains structural integrity and detail that more closely matches the intended data distribution.

Conclusion and Future Work

By treating guidance as a time-dependent process rather than a static parameter, $\beta$-CFG breaks the traditional quality-alignment trade-off. While the current implementation introduces new hyperparameters ($a, b, \gamma$), future research aims to automate this parameter selection, allowing models to adaptively determine the optimal guidance curve for any given prompt or noise level.

Summary updated

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.
BibTeX
@inproceedings{malarz2025classifier,
  author = {Dawid Malarz and Artur Kasymov and Maciej Zięba and Jacek Tabor and Przemysław Spurek},
  title = {{Classifier-Free Guidance with Adaptive Scaling}},
  booktitle = {Frontiers in Artificial Intelligence and Applications},
  year = {2025},
  doi = {10.3233/faia250836},
}

Loading related content...

Figure