Denoising Diffusion Probabilistic Models (DDPMs) have emerged as a powerful class of generative models, capable of producing high-quality images, audio, and other data. This article breaks down the foundations, implementation details, and recent enhancements of DDPMs.
Foundations
DDPMs are inspired by non-equilibrium thermodynamics. They define a Markov chain of diffusion steps that slowly add random noise to data, then learn to reverse the diffusion process to construct desired data samples from pure noise. The core idea is to train a neural network to denoise a slightly noisy image, effectively learning the score function of the data distribution.
Implementation
A typical implementation involves two main processes:
-
Forward process: Gradually adds Gaussian noise to an image over T steps, following a fixed variance schedule. This transforms the data distribution into a simple isotropic Gaussian.
-
Reverse process: A neural network (often a U-Net) predicts the noise added at each step, allowing iterative denoising from random noise back to a clean sample. The training objective is a simplified variational lower bound that reduces to a mean-squared error between the predicted and actual noise.
Enhancements
Researchers have proposed several improvements:
-
Improved DDPMs: Adjust the noise schedule and incorporate a learned variance to reduce the number of sampling steps while maintaining quality.
-
Latent diffusion models: Perform the diffusion process in a lower-dimensional latent space (e.g., using a pre-trained autoencoder) to boost efficiency and scalability.
-
Classifier-free guidance: A technique to trade off diversity and fidelity by combining conditional and unconditional score estimates.
DDPMs have become a cornerstone of modern generative AI, powering tools like DALL·E 2, Stable Diffusion, and many others. Their flexibility and high-quality outputs continue to drive innovation in content creation and beyond.