30 Apr 2023

Classifier-Free Guidance

Classifier Guidance

  • A method that combines score estimate of a diffusion model with the gradient of an image classifier.
  • It requires training an image classifier separate from the diffusion model, (in other words an extra classifier is needed)

BUT

Guidance can also be performed by a pure generative model without such a classifier → Classifier-free guidance.

Classifier-Free Guidance

→ Jointly train conditional (one that uses a prompt, eg. text) and unconditional (no prompt) diffusion model and combine the resulting conditional and unconditional score in order to get a trade-off between sample quality and diversity.

CFG Improves quality while reducing sample diversity in the diffusion model.

→ Images generated using CFG are very similar, but also high in quality.

→ Avoids training another classifier.

→ Very simple to implement (one-line code change)