Problem 3Diffusion models
50 ptsGuided
SummaryDerive the diffusion training objective from first principles: properties of the forward process, Bayes' rule for the reverse process, KL divergence, and the neural-network parameterization.
- Generative AIGaussian processesKL divergence
Submission Requirements
-
Each contestant must submit a Jupiter Notebook (.ipynb). You should put all your solutions on this file.
-
Your submitted file must follow the format
Diffusion_LastName_FirstName_SchoolName -
Each part’s name/number must appear in a text cell in bold section format, such as
# **Part 1.3.4**
In this problem, we study the diffusion model, which is widely used in modern generative AI systems. For simplicity, we consider one-dimensional data, so all variables take values in .
Notation and Preliminaries For a random variable , we write
to denote that follows a normal distribution with mean and variance . The probability density function of a one-dimensional Gaussian distribution is
When conditioning on another variable , we write
to mean that conditional on , the random variable follows a normal distribution with mean and variance . Define
Part 3.1. Properties of the Forward Process
Let be a sequence of parameters. The forward diffusion process is defined by
where
and the noise variables are independent. The sequence
forms a Markov chain describing the gradual addition of Gaussian noise.
Part 3.1.1
5 ptsMathematically prove that can be written in the form
where
Find explicit expressions for and . Then, using this expression, conclude that the conditional distribution of given is Gaussian, and compute its mean and variance. A complete derivation is required.
Part 3.1.2
5 ptsMathematically prove that for any , can be written in the form
where
Find explicit expressions for and . Then, using this expression, conclude that the conditional distribution of given is Gaussian, and compute its mean and variance. Your final answers should be written in terms of and . A complete derivation is required.
Part 3.1.3
5 ptsWe have
Compute
Your final answers should be simplified as much as possible. Reasoning is required.
Part 3.2. Kullback–Leibler Divergence
Part 3.2.1
5 ptsLet and be two one-dimensional normal distributions defined as
Compute the Kullback–Leibler divergence
Your answer should be expressed in terms of . A complete derivation is required.
Part 3.2.2
5 ptsIn the diffusion model, the true posterior distribution of the forward process is
while the reverse generative model is
Compute
Your answer should be expressed in terms of
A complete derivation is required.
Part 3.2.3
10 ptsCompute and in
Your final answers should be expressed in terms of , and . A complete derivation is required.
Part 3.2.4
5 ptsRecall from Part 3.1.2 that can be written in terms of and . First express in terms of and . Then substitute this expression into the formula for obtained in the previous part, and rewrite it in terms of , and . A complete derivation is required.
Part 3.2.5
5 ptsAssume that
Suppose that at time step , the model outputs a quantity , and that the reverse-process mean is written in terms of and in the same form as the expression obtained for in the previous part.
Using this parameterization, compute
Your final answer should be simplified as much as possible. A complete derivation is required.
Part 3.3
5 ptsNeural Network Parameterization
In the reverse generative process, we use a deep neural network to predict the noise term
Suppose the input is a tensor with shape
where denotes the batch size, denotes the number of channels, and denote the spatial or data dimensions. The output has the same tensor shape as . Because the function depends on the time step , explain how to design the architecture of the deep neural network so that the information of is incorporated into the model. Your answer should describe how the time step is represented and how this representation is incorporated into the neural network. No programming or implementation is required. Provide a conceptual explanation.