Advanced Topics / Diffusion Models
Diffusion Models
AdvancedGenerative models that learn to reverse a gradual noising process, powering modern image and video generation.
Forward and reverse process
The forward process adds Gaussian noise over T steps. When the cumulative signal coefficient is sufficiently small, the terminal distribution is approximately standard Gaussian. A neural network (usually a U-Net or transformer) learns to predict the noise for reverse sampling.
For the simplified DDPM noise-prediction objective, t is uniform over {1, …, T}, x₀ is a data sample, ε ∼ N(0, I), and 0 < βₜ < 1 defines the noise schedule. This is not the full variational objective.
Key ideas
- DDPM and DDIM sampling
- Latent diffusion (Stable Diffusion)
- Classifier-free guidance for text conditioning
Interview questions & answers
Q1. What happens in the forward and reverse diffusion processes?
Answer: The forward process gradually corrupts data with noise according to a schedule. A trained model guides a reverse sampling process from noise toward a data sample. Reverse generation is learned and stochastic in many samplers; it is not an exact undoing of a specific corruption trajectory.
Q2. Why do many diffusion models learn to predict noise?
Answer: Known noise can be added to a training sample at a randomly selected time step, providing a direct supervised target. Predicting that noise helps estimate a denoising direction for sampling. Other parameterizations predict the clean sample or a velocity target instead.
Q3. How do latent diffusion and classifier-free guidance help generation?
Answer: Latent diffusion performs denoising in a compressed representation and decodes the result, reducing compute compared with full-resolution pixel diffusion. Classifier-free guidance combines conditional and unconditional predictions to strengthen prompt adherence, with excessive guidance potentially reducing diversity or causing artifacts.