[Paper Review] On the Mathematics of Diffusion Models
This paper provides a rigorous mathematical derivation of diffusion models using only Gaussian distributions, deriving both forward and reverse stochastic differential equations (SDEs) and likelihood formulas via variational autoencoder (VAE) and score-matching analyses. The key contribution is a direct, non-variational derivation of the reverse-diffusion SDE and ODE, showing that the reverse process can be expressed as a deterministic ODE with a score function derived from conditional expectations.
This paper gives direct derivations of the differential equations and likelihood formulas of diffusion models assuming only knowledge of Gaussian distributions. A VAE analysis derives both forward and backward stochastic differential equations (SDEs) as well as non-variational integral expressions for likelihood formulas. A score-matching analysis derives the reverse diffusion ordinary differential equation (ODE) and a family of reverse-diffusion SDEs parameterized by noise level. The paper presents the mathematics directly with attributions saved for a final section.
Motivation & Objective
- To provide a direct, mathematically rigorous derivation of diffusion model dynamics using only Gaussian distributions, avoiding reliance on Fokker-Planck or variational inference frameworks.
- To derive the forward and reverse SDEs and likelihood formulas through a VAE-based analysis, establishing a non-variational path to reverse-diffusion dynamics.
- To connect the reverse-diffusion process to the score function via conditional expectations, enabling a closed-form expression for the score in terms of $ E[y|t,z(t)] $.
- To generalize the reverse-diffusion process by introducing a noise-level hyperparameter $ \lambda $, allowing flexible stochasticity in the reverse path.
- To clarify the relationship between Langevin dynamics, simulated annealing, and reverse-diffusion, showing they are not directly related to the core reverse-diffusion mechanism.
Proposed method
- Uses a discrete-time diffusion process defined by $ z(t + \Delta t) = z(t) + \sqrt{\Delta t}\epsilon $, $ \epsilon \sim \mathcal{N}(0,I) $, and takes the $ \Delta t \to 0 $ limit to derive the forward SDE.
- Applies a Markovian VAE framework to derive the reverse-diffusion SDE by analyzing the conditional distribution $ p(z(t - \Delta t)|z(t), y) $, leading to a Gaussian with drift $ \frac{\Delta t}{t}(y - z(t)) $.
- Derives the reverse-diffusion SDE as $ z(t - \Delta t) = z(t) + \frac{\Delta t}{t}(E[y|t,z(t)] - z(t))\Delta t + \sqrt{\Delta t}\epsilon $, showing the drift depends on the conditional expectation.
- Derives the deterministic reverse-diffusion ODE as $ \frac{dz}{dt} = -\frac{1}{2}\nabla_z \ln p_t(z) $, where the score function is $ \nabla_z \ln p_t(z) = \frac{E[y|t,z] - z}{t} $.
- Introduces a generalized reverse-diffusion SDE with a noise-level parameter $ \lambda \geq 0 $, allowing interpolation between deterministic and stochastic reverse processes.
- Uses the Fokker-Planck equation to validate that the reverse-diffusion SDE correctly reverses the forward diffusion process, confirming consistency with the time-reversed Fokker-Planck dynamics.
Experimental results
Research questions
- RQ1How can the forward and reverse SDEs of diffusion models be derived directly from Gaussian processes without invoking Fokker-Planck or variational inference?
- RQ2What is the exact form of the reverse-diffusion SDE when conditioned on the data distribution and time?
- RQ3How does the deterministic reverse-diffusion ODE relate to the stochastic reverse-diffusion SDE, and why does the ODE have half the drift coefficient?
- RQ4Can the reverse-diffusion process be generalized to include a tunable noise level $ \lambda $, and what is the physical interpretation of such a parameter?
- RQ5What is the mathematical relationship between the score function, conditional expectation $ E[y|t,z(t)] $, and the reverse-diffusion dynamics?
Key findings
- The reverse-diffusion SDE is derived directly from the VAE framework as $ z(t - \Delta t) = z(t) + \frac{\Delta t}{t}(E[y|t,z(t)] - z(t))\Delta t + \sqrt{\Delta t}\epsilon $, with drift proportional to the conditional expectation.
- The deterministic reverse-diffusion ODE is derived as $ \frac{dz}{dt} = -\frac{1}{2}\nabla_z \ln p_t(z) $, where the score function is $ \nabla_z \ln p_t(z) = \frac{E[y|t,z] - z}{t} $, providing a closed-form expression.
- The reverse-diffusion SDE has twice the drift coefficient of the deterministic ODE, reflecting the need to counteract the diffusion effect of noise in both forward and backward steps.
- The generalized reverse-diffusion SDE with parameter $ \lambda $ is given by $ z(t - \Delta t) = z(t) + \frac{1+\lambda}{2} \cdot \frac{E[y|t,z(t)] - z(t)}{t} \Delta t + \lambda \sqrt{\Delta t} \epsilon $, enabling empirical tuning of stochasticity.
- The Fokker-Planck analysis confirms that the reverse-diffusion SDE correctly reverses the forward process, as it corresponds to the time-reversed Fokker-Planck equation.
- The likelihood formula is derived non-variationaly via the VAE framework, with the KL divergence term converging to zero and the log-likelihood term diverging as $ \frac{1}{2}\ln \Delta t $ in the $ \Delta t \to 0 $ limit.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.