1. Home
  2. Explore
  3. Computer Science
  4. Diffusion Models Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Diffusion Models Overview

  • 21Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Historical Context

Which 2015 paper first introduced diffusion models as we know them today?

21 questions

  1. 1

    Which 2015 paper first introduced diffusion models as we know them today?

    Model answer

    Deep Unsupervised Learning using Nonequilibrium Thermodynamics by Jascha Sohl-Dickstein and colleagues.

    Explanation

    The 2015 paper by Sohl-Dickstein et al. is the earliest known reference to diffusion models in the form used today.

  2. 2

    What was the main contribution of the 2020 DDPM paper by Jonathan Ho and collaborators?

    Model answer

    It transformed diffusion models from a theoretical concept limited to toy datasets into a state-of-the-art technique for image generation, primarily by introducing a simpler training objective.

    Explanation

    The DDPM paper made diffusion models practical and popular, simplifying the training objective compared to the 2015 version.

  3. 3

    What was the state-of-the-art in image generation when diffusion models were first introduced in 2015?

    Model answer

    GANs (Generative Adversarial Networks) were considered state-of-the-art at that time.

    Explanation

    GANs dominated image generation research in 2015, while diffusion models initially received little attention.

  4. 4

    In a variance-exploding diffusion process, what happens to the mean and variance of q(xt∣x0)q(x_t|x_0)q(xt​∣x0​) as ttt increases?

    Model answer

    The mean remains fixed at x0x_0x0​, and the variance increases without bound (explodes).

    Explanation

    In the variance-exploding formulation, the mean does not move toward zero, and the variance grows linearly with ttt, preventing convergence to a standard normal.

  5. 5

    How does the variance-preserving diffusion process ensure convergence to a standard normal distribution as t→∞t \to \inftyt→∞?

    Model answer

    By setting the mean to αˉt x0\sqrt{\bar{\alpha}_t} \, x_0αˉt​​x0​ and variance to 1−αˉt1 - \bar{\alpha}_t1−αˉt​, where αˉt=∏s=1t(1−βs)\bar{\alpha}_t = \prod_{s=1}^t (1-\beta_s)αˉt​=∏s=1t​(1−βs​) and βt∈(0,1)\beta_t \in (0,1)βt​∈(0,1). As t→∞t \to \inftyt→∞, αˉt→0\bar{\alpha}_t \to 0αˉt​→0, so the mean goes to 000 and variance to 111.

    Explanation

    The variance-preserving formulation scales down the original signal while adding noise such that the total variance remains bounded, eventually reaching a standard normal.

  6. 6

    Write the formula for xtx_txt​ in terms of x0x_0x0​ and noise ϵ\epsilonϵ in the variance-preserving diffusion process.

    Model answer

    xt=αˉt x0+1−αˉt ϵx_t = \sqrt{\bar{\alpha}_t} \, x_0 + \sqrt{1 - \bar{\alpha}_t} \, \epsilonxt​=αˉt​​x0​+1−αˉt​​ϵ, where ϵ∼N(0,I)\epsilon \sim \mathcal{N}(0, I)ϵ∼N(0,I).

    Explanation

    This is the reparameterization used in DDPM, allowing direct sampling of xtx_txt​ from x0x_0x0​ without iterating through intermediate steps.

  7. 7

    How is αˉt\bar{\alpha}_tαˉt​ computed when the noise schedule βt\beta_tβt​ varies at each step?

    Model answer

    αˉt=∏s=1t(1−βs)\bar{\alpha}_t = \prod_{s=1}^t (1 - \beta_s)αˉt​=∏s=1t​(1−βs​).

    Explanation

    The cumulative product of (1−βs)(1-\beta_s)(1−βs​) from step 1 to ttt accounts for the varying noise levels.

  8. 8

    What are the two conditions the variance-preserving diffusion process must satisfy to converge to a standard normal distribution?

    Model answer

    The mean must converge to zero and the variance must converge to one as ttt goes to infinity.

    Explanation

    These conditions ensure the final distribution becomes N(0,I)\mathcal{N}(0, I)N(0,I).

  9. 9

    Why is the true posterior q(xt−1∣xt,x0)q(x_{t-1} | x_t, x_0)q(xt−1​∣xt​,x0​) useful during training but not during inference?

    Model answer

    During training, x0x_0x0​ is known, so we can compute the exact reverse step. During inference, x0x_0x0​ is unknown, so we must approximate it using the neural network.

    Explanation

    The true posterior requires conditioning on the clean image, which is unavailable when generating new samples.

  10. 10

    What is the form of the approximate posterior pθ(xt−1∣xt)p_\theta(x_{t-1}|x_t)pθ​(xt−1​∣xt​) used in DDPM?

    Model answer

    It is a Gaussian distribution: pθ(xt−1∣xt)=N(xt−1;μθ(xt,t),σt2I)p_\theta(x_{t-1}|x_t) = \mathcal{N}(x_{t-1}; \mu_\theta(x_t, t), \sigma_t^2 I)pθ​(xt−1​∣xt​)=N(xt−1​;μθ​(xt​,t),σt2​I), where σt2\sigma_t^2σt2​ is a fixed constant (not learned).

    Explanation

    The variance is fixed to a constant, so the network only learns the mean. This simplifies training.

  11. 11

    What is the evidence lower bound (ELBO) and why is it used in training diffusion models?

    Model answer

    The ELBO is a lower bound on the log-likelihood log⁡pθ(x0)\log p_\theta(x_0)logpθ​(x0​). It is used because the exact log-likelihood is intractable due to the need to sum over all possible paths.

    Explanation

    The ELBO provides a tractable surrogate that can be optimized to maximize the likelihood indirectly.

  12. 12

    After simplifications, what is the final training loss for the DDPM model?

    Model answer

    The mean squared error between the true noise ϵ\epsilonϵ and the predicted noise ϵθ\epsilon_\thetaϵθ​: Et,x0,ϵ[∥ϵ−ϵθ(xt,t)∥2]\mathbb{E}_{t, x_0, \epsilon} \left[ \| \epsilon - \epsilon_\theta(x_t, t) \|^2 \right]Et,x0​,ϵ​[∥ϵ−ϵθ​(xt​,t)∥2].

    Explanation

    This loss is obtained by rewriting the KL divergence terms using the reparameterization trick and dropping time-dependent weights.

  13. 13

    During training, why is a random timestep ttt chosen for each sample instead of summing over all timesteps?

    Model answer

    Summing over all timesteps for every sample is computationally expensive. Sampling a random ttt per sample converges to the same objective over many samples.

    Explanation

    This stochastic approximation is efficient and standard in practice.

  14. 14

    What neural network architecture is used in the DDPM implementation described?

    Model answer

    A Diffusion UNet (U-Net architecture adapted for diffusion).

    Explanation

    The UNet is a common choice for image-to-image tasks and handles the denoising process effectively.

  15. 15

    What dataset is used to train the model in the provided implementation, and what image size is used?

    Model answer

    MNIST, resized to 32×32 pixels.

    Explanation

    MNIST consists of grayscale handwritten digits; the images are resized from 28×28 to 32×32 for consistency.

  16. 16

    What optimizer and learning rate are used in the training code?

    Model answer

    Adam optimizer with a standard learning rate (not explicitly specified, but typically 1e-4 or similar).

    Explanation

    Adam is a popular choice for training deep neural networks.

  17. 17

    In the code, how is the noise schedule βt\beta_tβt​ defined?

    Model answer

    Linear interpolation from a small βstart\beta_{\text{start}}βstart​ to a larger βend\beta_{\text{end}}βend​ over TTT timesteps.

    Explanation

    This linear schedule is used in the original DDPM paper.

  18. 18

    During inference, how many reverse steps are typically taken to generate a sample?

    Model answer

    A thousand steps (matching the number of forward diffusion steps).

    Explanation

    The reverse process iterates from pure noise back to a clean image over 1000 steps.

  19. 19

    How does the visual quality of DDPM samples compare to VAEs, and what is the trade-off?

    Model answer

    DDPM produces higher quality images than VAEs but requires many more forward passes (e.g., 1000 vs. 1), trading computation for quality.

    Explanation

    The iterative denoising gives better results at the cost of increased inference time.

  20. 20

    What is the purpose of the DeepInverse library in the implementation?

    Model answer

    It provides a ready-to-use implementation of the Diffusion UNet architecture and pretrained weights.

    Explanation

    DeepInverse simplifies the code by abstracting the model definition, allowing focus on training and inference.

  21. 21

    What is the key formula used to sample xt−1x_{t-1}xt−1​ from xtx_txt​ during inference?

    Model answer

    xt−1=1αt(xt−1−αt1−αˉtϵθ(xt,t))+σtzx_{t-1} = \frac{1}{\sqrt{\alpha_t}} \left( x_t - \frac{1-\alpha_t}{\sqrt{1-\bar{\alpha}_t}} \epsilon_\theta(x_t, t) \right) + \sigma_t zxt−1​=αt​​1​(xt​−1−αˉt​​1−αt​​ϵθ​(xt​,t))+σt​z, where z∼N(0,I)z \sim \mathcal{N}(0,I)z∼N(0,I) for t>1t>1t>1 and z=0z=0z=0 for t=1t=1t=1.

    Explanation

    This formula applies the predicted noise to reverse the diffusion step, optionally adding random noise to maintain stochasticity.

1 of 21
Question 1 of 21

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent