Understanding Diffusion Models
Source: Lilian Weng10/07/2021, 21:00
Diffusion models represent an alternative approach to generative modeling compared to conventional methods like GANs and VAEs, offering more stable training and greater sample diversity. Inspired by non-equilibrium thermodynamics, these models learn to reverse a diffusion process that progressively adds Gaussian noise to data until transforming it into pure noise.
The mechanism operates in two distinct phases. First, the model iteratively adds noise to the original data through T steps controlled by a variance schedule. Second, a neural network learns to reverse this process, starting from pure noise and gradually removing noise to reconstruct coherent samples. A fundamental mathematical property enables sampling any intermediate state directly without executing all previous steps.
Training optimizes neural networks to predict the added noise at each stage or estimate the gradient of the data distribution. Recent improvements include cosine-based variance schedules, learnable conditional variance, and incorporation of class or text information for controlled generation. Specific variants such as DDPM, GLIDE, Imagen, and latent diffusion demonstrate the versatility of this approach across different applications.