Dynamic Classifier-Free Diffusion Guidance via Online Feedback

Pinelopi Papalampidi, Olivia Wiles, Ira Ktena, Aleksandar Shtedritski, Emanuele Bugliarello, Ivana Kajic, Isabela Albuquerque, Aida Nematzadeh

Introduction

In the realm of text-to-image diffusion models, Classifier-Free Guidance (CFG) serves as the critical "knob" controlling the trade-off between image diversity and how accurately the generated image aligns with the text prompt. Currently, the standard practice is to use a static guidance scale (e.g., a fixed value like 7.5) for every prompt and across every step of the denoising process.

However, this "one-size-fits-all" approach is inherently suboptimal. A simple, open-ended prompt like "a sunset" might benefit from lower guidance to maintain aesthetic diversity, whereas a complex, highly constrained prompt like "a sign that says 'Safety First' next to five cookies" requires high guidance to accurately render text and numbers. Previous attempts to address this issue relied on fixed heuristic schedules or computationally expensive gradient-based corrections, neither of which generalize well across different model families or diverse prompt types.

To solve this, researchers have introduced a framework for Dynamic Classifier-Free Guidance, which replaces static scales with a schedule that adapts in real-time. By leveraging lightweight "latent evaluators" to provide online feedback at every denoising step, the model greedily selects the optimal guidance scale for each specific prompt, significantly improving both text alignment and visual quality.

The Dynamic CFG Framework

The core innovation of this paper is the implementation of a closed-loop feedback system during the inference (sampling) process.

Dynamic CFG Framework

Instead of blindly applying a fixed scale, the framework evaluates multiple potential paths at each step:

  1. Latent Evaluators: The authors developed a suite of small-scale, specialized models capable of "seeing" into the noisy latent space of the diffusion process. These evaluators include CLIP-based models for prompt alignment, discriminators for visual fidelity, human preference reward models for overall aesthetic "vibe," and specialized heads for niche tasks like text rendering (OCR) and numerical reasoning (counting).
  2. Greedy Search: At each denoising timestep, the model "previews" the next state using a discrete set of candidate CFG scales (e.g., low vs. high CFG). It runs these candidates through the latent evaluators and selects the scale that yields the highest composite score.
  3. Adaptive Weighting: Recognizing that different types of feedback are valuable at different stages, the framework uses a dynamic weighting scheme. It prioritizes coarse alignment early in the generation process and shifts focus to fine-grained details (like legible text) toward the end.
  4. Computational Efficiency: Crucially, because these evaluators operate directly on compressed latent representations rather than fully decoded pixels, the entire search process adds only about 1% to the total FLOPs. In contrast, performing this evaluation in pixel space would incur a massive 400% computational overhead.

Key Insights

  • The "Optimal" Schedule is a Moving Target: The research demonstrates that the best CFG schedule is not a universal curve; it is highly prompt-dependent. Creative prompts thrive with more freedom, while technical prompts demand strict, sustained guidance.
  • Noisy Latents are Informative: A major finding is that evaluators do not need a clean, fully denoised image to judge quality. They can extract reliable signals for alignment and quality from as early as 25% into the denoising process.
  • Heuristics are Brittle: While heuristic schedules (like "annealing") worked for older models like Stable Diffusion, they actually degraded performance when applied to state-of-the-art models like Imagen 3. The dynamic search approach, however, scaled perfectly.
  • Emergent Behavior: When allowed to optimize freely, the greedy search often naturally "rediscovered" the arc-shaped guidance schedules that previous researchers had found through painstaking manual tuning, validating the method's effectiveness.

Experimental Results

The researchers tested their dynamic method on both standard Latent Diffusion Models (LDMs) and Google's state-of-the-art Imagen 3, evaluating across benchmarks like Gecko, GenAI-Bench, MSCOCO, MARIO-eval, and GeckoNum.

Win Rates of Dynamic CFG

The dynamic approach yielded substantial improvements:

  • Human Preference: On Imagen 3, Dynamic CFG achieved a 53.8% win rate over the default static baseline for general prompts (GenAI-Bench).
  • Specialized Capabilities: The win rate jumped even higher for complex tasks, reaching 55.5% for text rendering (MARIO-eval) and 54.1% for numerical reasoning/counting (GeckoNum)—areas where diffusion models traditionally struggle.
  • Pareto Improvement: Unlike previous methods that often traded visual quality for better alignment, Dynamic CFG improved both simultaneously.

Limitations and Future Work

While highly effective, the current framework relies on a "greedy" search, picking the best immediate step rather than optimizing the entire trajectory globally. Although preliminary tests with beam search showed only marginal gains, true global optimization remains an area for future exploration. Additionally, the system's performance is inherently bottlenecked by the quality of the latent evaluators; if an evaluator cannot detect a specific artifact, the dynamic CFG cannot correct it.

Looking forward, the authors suggest this real-time feedback framework could be expanded beyond just tuning the CFG scale, potentially allowing models to dynamically adjust other sampling parameters or steer attention mechanisms on the fly.

Summary updated

BibTeX
@inproceedings{papalampidi2026dynamic,
  author = {Pinelopi Papalampidi and Olivia Wiles and Ira Ktena and Aleksandar Shtedritski and Emanuele Bugliarello and Ivana Kajic and Isabela Albuquerque and Aida Nematzadeh},
  title = {{Dynamic Classifier-Free Diffusion Guidance via Online Feedback}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=z9YC9bvfUL},
}
Figure