Stanford Online

Stanford CS229 Machine Learning | Spring 2026 | Lecture 11: Diffusion Models

Published 2026-07-31 · Duration 1:22:31

Summary

The lecture introduces Diffusion Models as a predominant class of generative models used for tasks like image, video, and action generation. The core mechanism involves two processes: the forward process (gradually adding Gaussian noise to an original clean image $X_0$ over time steps $T$) and the reverse process (learning to iteratively denoise the noisy data back to a clean state). Training these models is achieved by applying the Evidence Lower Bound (ELBO) framework, which minimizes the Kullback-Leibler (KL) divergence between the true conditional distribution and the parameterized model's prediction.

Download summary

Key takeaways

  1. Diffusion Models Overview

    These models are generative frameworks that can be applied to images, videos, and robotics actions. They are noted as a superior approach compared to GANs and Variational Autoencoders (VAEs) for image generation.

  2. Forward vs. Reverse Process 4:05

    The forward process is a fixed, known noising process that transforms $X_0$ to noise $X_T$. The reverse process is the learned component, parameterized by $ heta$, which predicts $p_ heta(X_{t-1}|X_t)$—the step-by-step denoising path.

  3. Training Objective (ELBO) 6:25

    The goal is to maximize the marginal likelihood $ ext{log } p_ heta(X_0)$ by applying the Evidence Lower Bound (ELBO). This involves minimizing the KL divergence between the true posterior $q(X_{t-1}|X_t, X_0)$ and the parameterized model's distribution.

Technical details

  • Forward Diffusion Process (Noising) 285s

    The process is defined by adding Gaussian noise iteratively. The transition from $X_{t-1}$ to $X_t$ can be modeled as: $X_t = rac{1}{ ext{sqrt}(ar{eta}_t)} X_0 + ext{sqrt}(1 - ar{eta}_t) oldsymbol{ ilde{ u}}$, where $oldsymbol{ ilde{ u}}$ is standard normal Gaussian noise. The overall process maintains the scale and co-variance of $X_0$ (assuming normalization).

  • Reverse Diffusion Process (Denoising) 340s

    The reverse process is modeled as a Markov chain, predicting the distribution $p_ heta(X_{t-1}|X_t)$. This model is parameterized by $ heta$ and assumes a Gaussian form with mean $oldsymbol{ ilde{oldsymbol{ u}}}(X_t, t)$ and variance $ ext{sigma}_t^2$.

  • Loss Function Derivation 425s

    The training objective requires decomposing the KL divergence using a chain rule for KL. The final loss function minimizes the difference between two Gaussian distributions: $q(X_{t-1}|X_t, X_0)$ and $p_ heta(X_{t-1}|X_t)$. When assuming equal co-variance, the loss simplifies to minimizing a quadratic form based on the mean difference.

Mentioned resources

Channel & topics

Watch on YouTube · Back to latest

This independent, AI-assisted summary is provided for commentary and informational purposes. It may contain errors or omit important context. Please watch the original video for the creator's complete presentation. Video, thumbnail, and related copyrights belong to their respective owners.