Classifier Guidance is a technique for conditioning diffusion model generation on class labels or other attributes by using the gradients of a separately trained classifier to steer the sampling process toward desired classes. During reverse diffusion sampling, the classifier's gradient ∇_{x_t} log p(y|x_t) is added to the score function, biasing the generated samples toward inputs that the classifier confidently assigns to the target class y.
Why Classifier Guidance Matters in AI/ML: Classifier guidance was the first technique to achieve photorealistic conditional image generation with diffusion models, demonstrating that external classifier gradients could dramatically improve sample quality and class fidelity without modifying the diffusion model itself.
• Guided score — The conditional score decomposes as: ∇_{x_t} log p(x_t|y) = ∇_{x_t} log p(x_t) + ∇_{x_t} log p(y|x_t); the first term is the unconditional diffusion model score, the second is the classifier gradient that pushes samples toward class y • Guidance scale — A scalar parameter s controls the strength of classifier influence: ∇_{x_t} log p(x_t|y) ≈ ∇_{x_t} log p(x_t) + s·∇_{x_t} log p(y|x_t); larger s produces more class-specific but less diverse samples, with s=1 being standard Bayes and s>1 amplifying class fidelity • Noisy classifier training — The classifier must operate on noisy intermediate states x_t at all noise levels, not just clean images; it is trained on noise-augmented data with the same noise schedule as the diffusion model • Quality-diversity tradeoff — Increasing guidance scale s improves FID (sample quality) and classification accuracy up to a point, then degrades diversity and introduces artifacts; the optimal s balances sample quality against mode coverage • Limitations — Requires training a separate noise-aware classifier for each conditioning attribute, doesn't generalize to text conditioning easily, and the classifier can introduce adversarial artifacts; these limitations motivated classifier-free guidance
| Guidance Scale (s) | FID | Diversity | Class Accuracy | Character |
|---|---|---|---|---|
| 0 (unconditional) | Higher | Maximum | Random | Diverse, unfocused |
| 1.0 (standard) | Moderate | Good | Moderate | Balanced |
| 2.0-5.0 | Lower (better) | Moderate | High | Sharp, class-specific |
| 10.0+ | Higher (worse) | Low | Very high | Oversaturated, artifacts |
Classifier guidance pioneered conditional generation in diffusion models by demonstrating that external classifier gradients could steer the sampling process toward desired attributes, achieving the first photorealistic class-conditional image generation and establishing the gradient-guidance paradigm that inspired the more practical classifier-free guidance method used in all modern text-to-image systems.
Explore 500+ Semiconductor & AI Topics
From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.