NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Learn to Guide Your Diffusion Model

Alexandre Galashov, Ashwini Pokle, Arnaud Doucet, Arthur Gretton, Mauricio Delbracio, Valentin De Bortoli

In the world of generative AI, Classifier-Free Guidance (CFG) is the "secret sauce" that makes diffusion models like Stable Diffusion and DALL-E 3 actually follow your prompts. By mixing a conditional prediction (with your prompt) and an unconditional one (without it) using a fixed weight $\omega$, we can force the model to prioritize alignment with the text.

However, CFG is a blunt instrument. Use too little guidance, and the model ignores you; use too much, and the images become over-saturated, "deep-fried," and lose their natural diversity. A new paper from researchers at Google DeepMind, titled "Learn to Guide Your Diffusion Model," argues that we shouldn't be using a single, static weight. Instead, we should learn the optimal guidance weight as a function of the prompt and the specific step in the denoising process.

TL;DR

Instead of manually tuning a static guidance weight ($\omega$), this paper introduces a method to learn a dynamic guidance network that adapts $\omega$ based on the prompt and the current denoising timestep. By minimizing the distributional mismatch between guided samples and the true data distribution, the authors achieve state-of-the-art image quality (FID) and superior prompt alignment without the artifacts of traditional CFG.

What Problem Does This Paper Address?

Standard CFG operates on a simple linear combination: $$\hat{x}_\theta(x_t, c; \omega) = \hat{x}_\theta(x_t, c) + \omega(\hat{x}_\theta(x_t, c) - \hat{x}_\theta(x_t, \emptyset))$$

While effective, this approach has three major flaws:

  1. Distributional Mismatch: High guidance weights push samples toward the "edges" of the data distribution, leading to a loss of realism and diversity.
  2. Static Nature: The "correct" amount of guidance likely changes as an image evolves from pure noise to a crisp picture.
  3. Prompt Sensitivity: Some prompts are easy for the model to follow and need little help, while others require heavy steering.

The authors aim to replace the hand-tuned $\omega$ with a learned function $\omega_{c,(s,t)}$ that knows exactly how much to "nudge" the model at every moment.

Methods

The core innovation is a framework for training a small Guidance Network (a lightweight MLP) alongside a frozen, pre-trained diffusion model.

1. The Self-Consistency Condition

The authors derive their objective from a "self-consistency" requirement. In an ideal world, if you take a real image, add noise to it (time $t$), and then denoise it back to a cleaner state (time $s$), the resulting distribution should match the distribution of real images noised to that same level $s$. They use Maximum Mean Discrepancy (MMD)—a kernel-based method to compare distributions—to penalize the guidance network whenever the guided denoising process drifts away from the "true" noised data distribution.

2. Reward-Guided Sampling

The framework is flexible enough to incorporate external rewards. For text-to-image tasks, they integrate the CLIP score into the loss function. This encourages the guidance network to find weights that specifically maximize the similarity between the generated image and the input text prompt.

3. Training Setup

Unlike training the diffusion model itself, training the guidance network is computationally cheap. It only involves passing embeddings through a small MLP and calculating the MMD loss on small batches of "particles" (samples).

Key Insights and Ideas

  • Guidance as Error Correction: The paper suggests that CFG actually acts as a correction for the approximation errors in the learned denoiser. By learning $\omega$, we are essentially learning the optimal correction schedule.
  • The "Aha" Moment on Timesteps: The learned weights are not uniform. For many classes, the model learns to apply high guidance in the middle of the denoising process and tapers off toward the end. This prevents the "over-smoothing" or "saturation" often seen when high guidance is applied to the final pixels.
  • Prompt-Specific Steering: The analysis shows that different prompts receive vastly different guidance "schedules." For example, complex prompts require more aggressive, dynamic guidance than simpler, more common subjects.
Learned guidance weights over time, comparing methods (left) and showing class-specific variations (right).
  • Large Gaps Matter: Surprisingly, training the guidance network with larger time increments ($\delta \approx 0.1$) worked better than training on tiny steps. This provides a more stable and informative gradient signal for the network to learn from.

Key Results

The learned guidance consistently outperformed unguided models and standard CFG baselines across standard benchmarks (ImageNet $64 \times 64$, CelebA, and MS-COCO T2I):

  • ImageNet 64x64: Achieved an FID of 1.99, outperforming the best baseline (Limited Interval Guidance) at 2.11 and standard CFG at 2.40.
Quantitative results comparing baseline guidance methods to learned guidance approaches on ImageNet 64x64.
  • MS-COCO (T2I): The learned guidance reduced the FID from 24.74 (unguided) to 18.01.
  • Alignment: When using the CLIP reward, the model achieved a CLIP score of 0.306, matching the best hand-tuned baselines but with significantly better visual quality (lower FID).
  • Qualitative Improvements: Images generated with learned guidance show better adherence to complex spatial prompts without the distorted colors typical of high-static-weight CFG.

Limitations and Future Work

  • Training Overhead: While the guidance network is small, it still requires a separate training phase after the main model is done.
  • Reward Hacking: Like all RL-style optimizations, there is a risk of "reward hacking" where the model finds weird artifacts that satisfy the CLIP score but look bad to humans. The authors mitigate this with regularization, but it remains a delicate balance.
  • Future Directions: The authors suggest exploring more complex reward functions (like human preference models) and investigating the theoretical properties of the guidance solutions that emerge from this training.

Summary updated

BibTeX
@inproceedings{galashov2026learn,
  author = {Alexandre Galashov and Ashwini Pokle and Arnaud Doucet and Arthur Gretton and Mauricio Delbracio and Valentin De Bortoli},
  title = {{Learn to Guide Your Diffusion Model}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=l8XOk4ylBH},
}
Figure