As we established, directly computing the true reverse probability p(xt−1∣xt) is generally intractable. Our strategy is to approximate this reverse transition using a parameterized distribution, typically a Gaussian, learned by a neural network: pθ(xt−1∣xt). The network needs to estimate the parameters of this Gaussian distribution, specifically its mean μθ(xt,t) and variance Σθ(xt,t).
While the network could be trained to directly predict the mean μθ(xt,t) or even the denoised sample xt−1, a different approach has proven remarkably effective in practice: predicting the noise componentϵ that was added during the forward process at timestep t.
Let's see why this is useful. Recall the closed-form expression for sampling xt directly from x0 in the forward process:
xt=αˉtx0+1−αˉtϵ
Here, ϵ is a standard Gaussian noise sample, and αˉt is derived from the noise schedule. This equation links the original data x0, the noisy version xt, and the noise ϵ added to reach that state.
If our neural network, let's call it ϵθ, can accurately predict the noise ϵ based on the noisy input xt and the timestep t, we can use this prediction, ϵθ(xt,t), to inform our estimate of the previous state xt−1.
How does predicting noise help estimate the mean μθ(xt,t) of the reverse step pθ(xt−1∣xt)? The original Denoising Diffusion Probabilistic Models (DDPM) paper showed that the mean of the reverse transition p(xt−1∣xt,x0) can be expressed as:
μ~t(xt,x0)=αt1(xt−1−αˉt1−αtϵ)
where αt=αˉt/αˉt−1. Notice this expression depends on the original data x0 (through ϵ) which we don't have during generation.
However, we can rearrange the first equation to get an estimate of x0 if we know xt and ϵ:
x0≈x^0=αˉt1(xt−1−αˉtϵθ(xt,t))
By substituting our network's noise prediction ϵθ(xt,t) for ϵ in the equation for μ~t, we arrive at an expression for the mean of our approximate reverse transition pθ(xt−1∣xt):
μθ(xt,t)=αt1(xt−1−αˉt1−αtϵθ(xt,t))
This establishes a direct link: if our network ϵθ(xt,t) successfully predicts the noise added at step t, we can calculate the mean required for the denoising step xt→xt−1. The variance Σθ(xt,t) is often fixed to a value related to the forward process variances, or sometimes also learned, but predicting the noise is primarily used to determine the mean.
Why Predict Noise?
Parameterizing the reverse process by predicting noise offers several advantages:
Simpler Learning Target: The noise ϵ is typically drawn from a simple distribution (e.g., standard Gaussian). Predicting this noise might be an easier task for the neural network compared to directly predicting the complex structure of the data x0 or xt−1, especially at high noise levels (large t).
Alignment with Loss Function: As we will see in the next chapter, the training objective for diffusion models often simplifies to a mean squared error loss between the true noise ϵ added during the forward process and the network's predicted noise ϵθ(xt,t). Training the network to directly output ϵθ perfectly aligns the network's output with this common loss function, potentially leading to more stable training.
Empirical Success: This noise prediction formulation has been central to the success of many high-performing diffusion models, particularly in image generation.
Therefore, the standard approach involves training a neural network ϵθ that takes the noisy data xt and the timestep t as input and outputs a prediction of the noise ϵ that was used to generate xt from x0. This predicted noise ϵθ(xt,t) then allows us to compute the parameters (specifically the mean) of the approximate reverse distribution pθ(xt−1∣xt), enabling the step-by-step generation process.
The neural network ϵθ takes the current noisy sample xt and the timestep t as input. Its goal is to predict the noise ϵθ that was likely added to the original data to produce xt. This prediction is the core component used to guide the reverse denoising step.
What are Diffusion Models?, Lilian Weng, 2021 - This comprehensive blog post from a reputable researcher offers a clear and in-depth tutorial on diffusion models, detailing the forward and reverse processes and explicitly explaining the role and advantages of noise prediction in the DDPM framework.