home/ atoms/ classifier-guided-diffusion

Classifier-guided diffusion steers generation by adding classifier-score gradients to the noise prediction

To generate class-conditional samples without retraining the diffusion model, a separate classifier trained on noisy images provides gradients that point toward the desired class. At each reverse step, the noise prediction is modified by subtracting these gradients, scaled by a guidance weight w. A higher w produces samples more strongly guided toward the class at the cost of reduced diversity. This approach (ADM-G by Dhariwal and Nichol 2021) was among the first diffusion methods to beat BigGAN on ImageNet. The downside: it requires training and running a second classifier at inference, roughly doubling per-step compute. The classifier must be trained on noisy images (x_t at various t), not clean ones, since that is what it sees during reverse sampling.

Examples

w=1.0 gives mild steering; w=5.0 gives very class-consistent samples but reduced variation. The classifier at each step t evaluates the noisy intermediate x_t, not a clean image.

Assessment

Describe how classifier guidance modifies the sampling process. What does the guidance weight w control, and what is the computational overhead compared to a standard diffusion model?

“To control the strength of the classifier guidance, we can add a weight $w$ to the delta part”
corpus · what-are-diffusion-models-lil-log-lilian-weng · chunk 8