Classifier Guidance is a technique used in diffusion‑based generative models to steer the sampling process toward a desired condition (e.g., a specific class label or text prompt) by incorporating information from an external, pre‑trained classifier.
How it works
- Separate classifier – A classifier is trained on the same data (or on noisy versions of the data) to predict the condition given a noisy sample .
- Gradient‑based steering – During each denoising step the gradient of the classifier’s log‑probability is computed.
- Score modification – The diffusion model’s predicted noise is adjusted by this gradient.
- Conditional generation – The modified score pushes the reverse‑diffusion trajectory toward regions of the data space that the classifier assigns high probability to the target condition, yielding samples that better match the desired label while preserving the diversity of the original model.
Why it matters
- Post‑training control – The diffusion model itself does not need to be retrained for each new condition; only the classifier is added, allowing flexible conditioning after the fact.
- Trade‑off between fidelity and diversity – A larger guidance scale improves adherence to the condition (higher fidelity) but can reduce sample diversity; a smaller scale preserves diversity at the cost of weaker conditioning.
- Broad applicability – Used for class‑conditional image synthesis, text‑to‑image generation, and other tasks where a clear label or embedding can be defined.
In summary, classifier guidance augments the diffusion sampling process with classifier gradients, enabling conditional generation without altering the original diffusion model’s weights. This approach is especially useful when one wants to add new conditioning signals after the model has been trained.
声明:文章均为AI生成,请谨慎辨别信息的真伪和可靠性!