Elamur Research

Classifier-Free Diffusion Guidance

Paper · 2022 · Jonathan Ho and Tim Salimans

Summary

Diffusion models had no clean way to trade sample diversity for per-sample quality, as truncation does in BigGAN or low temperature does in Glow. Simple tricks such as scaling scores or reducing sampling noise only blur the outputs. The earlier fix, classifier guidance from Dhariwal & Nichol, adds the gradient of a separate classifier during sampling. That classifier must be trained on noisy inputs, which complicates the pipeline. It also raises a worry: the reported FID and Inception score gains might come from adversarially exploiting classifiers. Ho and Salimans remove the classifier entirely. During training, one network is fed the class label most of the time, and occasionally the label is replaced by a null token. A single model thus learns both conditional and unconditional denoising. At sampling time, the two noise estimates are mixed with a weight w, which pushes samples toward what is specific to the condition. On class-conditional ImageNet, sweeping w gives an FID/IS trade-off comparable to classifier guidance. This shows that a purely generative model can reach these quality levels without any classifier gradients.

Key points

  • Training (Algorithm 1) is ordinary denoising with ε-prediction, plus one change: with probability p_uncond the conditioning c is replaced by ∅, so one network covers both modes.
  • The method needs no auxiliary classifier and no extra trained network. Guidance happens only at sampling time, by combining the conditional and unconditional score estimates.
  • Experiments use class-conditional ImageNet at 64x64 and 128x128, with qualitative grids for the malamute class. Figure 8 contrasts non-guided samples with guided ones at w = 3.0.
  • In theory, guiding an unconditional model with weight w + 1 matches guiding a conditional model with weight w. Even so, Dhariwal & Nichol got their best results guiding an already conditional model.
  • A toy mixture of three Gaussians shows the mechanism. As guidance grows, each class's mass moves away from the other classes and concentrates in smaller, high-confidence regions.

Interesting ideas

  • I1. Conditioning dropout. Randomly replacing the conditioning with a null token during training yields one model that works both with and without the extra signal, at no added cost.
  • I2. Contrast with the unconditional prediction. Moving a prediction away from the "no condition" output and toward the conditioned one amplifies what the condition contributes, without any extra critic model.
  • I3. Suspecting metric gaming by the guide. The authors note that steering with a classifier's gradient may simply fool classifier-based metrics, so they design a variant that avoids this confound.
  • I4. Explicit fidelity–diversity knob, with a fairness caveat. A single weight w sets the trade-off at inference time, and the paper warns that lower diversity can hurt underrepresented parts of the data.
  • I5. Toy-scale visualization before scaling up. A 2D Gaussian mixture makes the effect of guidance visible and easy to reason about before ImageNet runs.

For Mova

How these ideas could serve Mova, our small open language model — its files, stages and tests:

  • I1 (tree): gparse could be trained with its auxiliary inputs (e.g. predicted tags or morphology features) randomly blanked. One parser would then handle both clean and noisy upstream input, and comparing its two outputs shows how much a tag actually drives an attachment.
  • I2 (back): when generating text from the meaning graph, word choices could be scored with and without the graph. Preferring words whose likelihood rises because of the graph makes the output more faithful and makes that faithfulness inspectable.
  • I3 (learn): if an LLM teacher or a witness parser both shapes silver data and judges it, gains may be self-confirming. Evaluating with an independent witness and negative controls guards against this.
  • I4 (learn): self-play or silver-data generation could expose a similar strength knob. Tracking how often rare constructions survive would catch the moment higher-confidence data starts erasing the long tail.
  • I5 (answer): a new reader heuristic could first be tried on a tiny hand-built set of fables or word problems where every answer shift can be traced. Only after that would it be run on full school-course tests.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

 Institutions

 Fields, topics and concepts

Cite

Cite as Jonathan Ho and Tim Salimans. 2022. Classifier-Free Diffusion Guidance. arXiv:2207.12598.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2207.12598 · arXiv 2207.12598

@misc{ho2022classifier,
  title = {{Classifier-Free Diffusion Guidance}},
  author = {Jonathan Ho and Tim Salimans},
  year = {2022},
  doi = {10.48550/arxiv.2207.12598},
  eprint = {2207.12598},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2207.12598}
}

References

23 references, from the paper's own bibliography.

  1. Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In International Conference on Learning Representations, 2019. our card
  2. Nanxin Chen, Yu Zhang, Heiga Zen, Ron J Weiss, Mohammad Norouzi, and William Chan. WaveGrad: Estimating gradients for waveform generation. International Conference on Learning Representations, 2021. OpenAlex ↗ · Scholar ↗
  3. Prafulla Dhariwal and Alex Nichol. Diffusion models beat GANs on image synthesis. arXiv preprint arXiv:2105.05233, 2021. OpenAlex ↗ · Scholar ↗
  4. Yves Grandvalet and Yoshua Bengio. Semi-supervised learning by entropy minimization. In Proceedings of the 17th International Conference on Neural Information Processing Systems, pp. 529–536, 2004. OpenAlex ↗ · Scholar ↗
  5. Peter Grünwald and John Langford. Suboptimal behavior of bayes and mdl in classification under misspecification. Machine Learning, 660 (2-3):0 119–149, 2007. OpenAlex ↗ · Scholar ↗
  6. Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a local Nash equilibrium. In Advances in Neural Information Processing Systems, pp. 6626–6637, 2017. OpenAlex ↗ · Scholar ↗
  7. Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, pp. 6840–6851, 2020. OpenAlex ↗ · Scholar ↗
  8. Jonathan Ho, Chitwan Saharia, William Chan, David J Fleet, Mohammad Norouzi, and Tim Salimans. Cascaded diffusion models for high fidelity image generation. arXiv preprint arXiv:2106.15282, 2021. OpenAlex ↗ · Scholar ↗
  9. Aapo Hyvärinen and Peter Dayan. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 60 (4), 2005. OpenAlex ↗ · Scholar ↗
  10. Diederik P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10215–10224, 2018. our card
  11. Diederik P Kingma, Tim Salimans, Ben Poole, and Jonathan Ho. Variational diffusion models. arXiv preprint arXiv:2107.00630, 2021. OpenAlex ↗ · Scholar ↗
  12. Zhifeng Kong, Wei Ping, Jiaji Huang, Kexin Zhao, and Bryan Catanzaro. DiffWave: A Versatile Diffusion Model for Audio Synthesis. International Conference on Learning Representations, 2021. OpenAlex ↗ · Scholar ↗
  13. Alex Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. International Conference on Machine Learning, 2021. our card
  14. Ali Razavi, Aaron van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with VQ-VAE-2. In Advances in Neural Information Processing Systems, pp. 14837–14847, 2019. our card
  15. Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. ImageNet large scale visual recognition challenge. International Journal of Computer Vision, 1150 (3):0 211–252, 2015. our card
  16. Tim Salimans and Jonathan Ho. Should EBMs model the energy or the score? In Energy Based Models Workshop-ICLR 2021, 2021. OpenAlex ↗ · Scholar ↗
  17. Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training GANs. In Advances in Neural Information Processing Systems, pp. 2234–2242, 2016. our card
  18. Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pp. 2256–2265, 2015. our card
  19. Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. In Advances in Neural Information Processing Systems, pp. 11895–11907, 2019. our card
  20. Yang Song, Conor Durkan, Iain Murray, and Stefano Ermon. Maximum likelihood training of score-based diffusion models. arXiv e-prints, pp. arXiv–2101, 2021a. OpenAlex ↗ · Scholar ↗
  21. Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. International Conference on Learning Representations, 2021b. our card
  22. Pascal Vincent. A connection between score matching and denoising autoencoders. Neural Computation, 230 (7):0 1661–1674, 2011. OpenAlex ↗ · Scholar ↗
  23. Yan Wu, Jeff Donahue, David Balduzzi, Karen Simonyan, and Timothy Lillicrap. LOGAN: Latent optimisation for generative adversarial networks. arXiv preprint arXiv:1912.00953, 2019. OpenAlex ↗ · Scholar ↗

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/ho-2022-classifier-free-diffusion-guidance/