Source-linked AI summary
Rethinking the Diffusion Model from a Langevin Perspective
Candi Zheng, Yuan Lan
TL;DR
Diffusion models raise questions about how reverse denoising inverts forward noising and how their VAE, score-based, and flow-based formulations relate. The paper organizes these issues through a Langevin perspective, showing that diffusion processes split Langevin dynamics and that ODE/SDE and flow-matching formulations fit this common framework. It concludes that flow matching is equivalent to denoising and score matching under maximum likelihood, while ordinary Langevin sampling has practical initialization limitations.
Problem
Existing diffusion perspectives leave the reverse-process derivation difficult to access, diffusion’s advantage over ordinary VAEs unclear, and flow matching’s apparent simplicity potentially misleading.
Method
The paper uses Langevin dynamics as an organizing framework and distributes maximum-likelihood analysis across diffusion time to relate different model parameterizations.
Results
The Langevin perspective unifies forward and reverse diffusion, ODE and SDE formulations, and flow, denoising, and score parameterizations under a common maximum-likelihood framework.
Takeaways & Limitations
Diffusion variants can be understood as different parameterizations and discretizations of a coherent Langevin framework rather than disconnected methods.
Takeaways & Limitations
Langevin dynamics is inefficient in high-dimensional or multimodal settings because of slow mixing, hyperparameter sensitivity, and unreliable scores away from the data manifold.
Abstract
from arXiv · showhide
Diffusion models are often introduced from multiple perspectives, such as VAEs, score matching, or flow matching, accompanied by dense and technically demanding mathematics that can be difficult for beginners to grasp. One classic question is: how does the reverse process invert the forward process to generate data from pure noise? This article systematically organizes the diffusion model from a fresh Langevin perspective, offering a simpler, clearer, and more intuitive answer. We also address the following questions: how can ODE-based and SDE-based diffusion models be unified under a single framework? Why are diffusion models theoretically superior to ordinary VAEs? Why is flow matching not fundamentally simpler than denoising or score matching, but equivalent under maximum-likelihood? We demonstrate that the Langevin perspective offers clear and straightforward answers to these questions, bridging existing interpretations of diffusion models, showing how different formulations can be converted into one another within a common framework, and offering pedagogical value for both learners and experienced researchers seeking deeper intuition.
1 Introduction
Diffusion models are commonly explained through VAE, score-based, and flow-based perspectives, but each leaves important conceptual or mathematical questions unresolved. The article proposes a Langevin perspective as a simpler framework for deriving the reverse process and relating these formulations.
- The VAE perspective treats noising as encoding and denoising as decoding, but does not make diffusion’s advantage over one-step VAE decoding obvious.
- The score-based perspective clarifies the forward–reverse relationship, yet its reverse-process derivation relies on advanced mathematics and its objective is less general to flow matching.
- Flow-based models offer an intuitive straight-line interpolation between data and noise, but this apparent simplicity can obscure their mathematical equivalence to denoising and score matching.
- The article organizes diffusion theory around Langevin dynamics, using basic SDE techniques to derive the reverse process and establish maximum-likelihood equivalence with flow matching.
2 Langevin Dynamics as ’Identity’ Operation
Langevin dynamics samples from a target distribution while preserving it as its stationary distribution, motivating its interpretation as an identity operation on distributions. Diffusion models split this identity into forward noising and reverse denoising.
- Langevin dynamics is a stochastic process for sampling from a target probability distribution p(x), with score s(x) = ∇x log p(x).
- The Langevin SDE can be viewed as an ODE augmented by infinitesimal random perturbations, with Gaussian noise and a positive time-rescaling function.
- Because p(x) is the stationary distribution, Langevin dynamics converges to and remains at p(x) regardless of the initial distribution.
- Langevin dynamics acts as an identity on distributions by transforming a sample from p(x) into a new independent sample from the same distribution.
- Diffusion forward and reverse processes split this distributional identity into a noising phase and a denoising phase.
3 Spliting the Identity into Forward and Reverse Processes
Diffusion models can be understood as splitting Langevin dynamics into a forward noising phase and a reverse denoising phase. This perspective unifies parameterizations, explains ODE/SDE variants, and shows that model outputs can be converted exactly.
- Langevin dynamics is ineffective for generating samples from scratch because its learned score is reliable near data but poorly estimated far from the data manifold.Annealed Langevin dynamics addresses initialization by using samplers trained at multiple noise levels, progressively reducing noise from pure noise.
- Diffusion models split one Langevin identity operation into separate training and inference processes: forward diffusion creates progressively noised data, while reverse diffusion samples data from noise.The forward process is described by an Itô SDE, d x_t = f(x_t,t) dt + g(t) dW_t, whose drift and noise scale define the parameterization.
- The Forward Diffusion Process for Noising: VP, VE-Karras, and Rectified flow use different SDE parameterizations, but their forward processes differ only through time and state reparameterization and can be directly converted.VP pulls samples toward the origin while adding noise, VE-Karras adds noise without restoring drift, and Rectified flow uses a stochastic forward process.
- The Reverse Diffusion Process for Denoising: The reverse process conjugates the forward process, and composing them reproduces Langevin dynamics for the intermediate distribution p_t(x).The Langevin split divides the original noise into forward and reverse components, with independent Gaussian increments whose variances add.
- Unifying ODE and SDE Models: ODE- and SDE-based diffusion models are unified as different Langevin decompositions, with the ODE split placing no stochastic term in the reverse process.For the same VP model, distinct splittings arise from different time-scaling functions.
- Converting Between Different Model Types: VP scores, VE-Karras noise predictions, and Rectified flow velocities are mathematically equivalent outputs under parameter conversion, so flow matching is not fundamentally simpler.Flow matching’s practical advantage is expected to be lower trajectory curvature rather than universally straight trajectories; the straight-line behavior is special to the single-point example.
4 Forward–Reverse Duality
Forward and reverse diffusion steps are dual components of a Langevin dynamics that preserve corresponding probability densities while transforming between data and noise. Running the reverse process from the terminal Gaussian theoretically recovers the original data distribution, although practical score-network approximation introduces error.
- A reverse-time step undoes a forward step by decreasing the corresponding forward diffusion time.
- Composing forward and reverse steps forms a Langevin dynamics step linking samples at corresponding times.The correspondence is between x_t in the forward process and x_(T−t)' in the reverse process.
- Corresponding forward and reverse samples are distinct samples that follow the same probability distribution.Rows in the visualization represent consecutive Langevin steps that alter samples while maintaining probability density.
- Choosing T sufficiently large makes the forward distribution approximately Gaussian, allowing the reverse process to start from the same Gaussian and generate data-distributed samples.The reverse process evolves from reverse time 0 to T to recover the original data distribution.
- The theoretical reverse process exactly recovers p0, whereas ordinary VAEs provide no exactness guarantee even at the ELBO optimum.In practice, diffusion training introduces approximation error, so exact equality is the theoretical target rather than the practical guarantee.
- Reverse diffusion requires the score function at every time step, which is approximated in practice with a neural network.
5 Unifying Training of Diffusion Models as Maximal likelihood
The paper derives diffusion training from maximum likelihood by distributing KL minimization across diffusion time. This common objective shows that score, denoising, and flow matching are equivalent parameterizations rather than fundamentally different levels of simplicity.
- Maximum-likelihood objective: Maximum likelihood minimizes KL(p0∥q0) by examining how KL(pt∥qt) changes throughout the forward diffusion process.The time-zero objective is rewritten using the time derivative of KL along the shared dynamics.
- Score-based formulation: The instantaneous objective naturally contains the score functions of the true and model distributions, identifying the score as the quantity to model.The model score is approximated with a neural network, while the true score is estimated from samples.
- Score-based formulation: The denoising score matching loss and score matching loss are equivalent formulations of the same training objective.The equivalence lets training use the conditional score ∇log p(xt | x0) rather than the unknown data-distribution score directly.
- Parameterizations: Different diffusion parameterizations train different targets, including scores, Gaussian noise, x0, v, or velocity fields, while remaining algebraically related.The paper presents these choices in a unified summary of forward processes, reverse processes, and objectives.
- Flow matching: Flow matching is an equivalent reformulation of denoising and score matching under the maximum-likelihood objective.Its velocity field remains algebraically tied to the underlying score function, despite the straight-line interpolation intuition.
- Parameterizations: Loss reweighting changes the relative emphasis across noise levels without changing the optimal target at any individual time.The target score or velocity remains unchanged even when the coefficient outside the L2 norm is modified.
6 Conclusion
The conclusion presents diffusion models as a coherent Langevin framework rather than a collection of disconnected formulations. This perspective explains inversion, unifies SDE and ODE descriptions, and places flow matching within the same maximum-likelihood objective.
- Langevin perspective: Forward noising and reverse denoising are a carefully chosen split of Langevin dynamics, which acts as an identity map.The split provides the paper’s conceptual explanation for how sampling can invert noising.
- Flow matching: Flow matching estimates the same underlying score field as denoising and score matching under the maximum-likelihood objective.The paper therefore treats flow matching as an equivalent parameterization, not a fundamentally simpler class.
A.1 Why p(x) is stationary under Langevin dynamics
The appendix derives the stationary distribution of Langevin dynamics from energy-based dynamics and independent-copy consistency. The resulting density is exponential in the energy, with the quadratic-energy case yielding the Ornstein–Uhlenbeck process.
- Time rescaling: Rescaling time can set g(t)=1 because g(t) only determines the time unit and does not affect the stationary distribution.The transformation uses t′ = R t.
- Energy form: In energy-form dynamics, uniform random perturbations leave position information to the energy E(x), so stationarity has the form p(x)=f(E(x)).The stationary density depends on position through the energy function.
- Independent copies: For N independent copies, product-form and additive-total-energy descriptions force f(E)=e^−βE.The exponential is the only function converting the product of individual factors into a function of summed energy.
- Quadratic energy: Choosing E(x)=1/2∥x∥2 gives the Ornstein–Uhlenbeck process and its stationary distribution.The quadratic energy specializes the general energy-based construction to a well-known process.
A.2 Derivation Step 1: from forward SDE to Fokker–Planck
The Fokker–Planck equation describes how an SDE evolves probability density through drift and diffusion. Its terms follow from probability conservation under deterministic motion and Gaussian spreading under Brownian noise.
- Fokker–Planck equation: The Fokker–Planck equation gives the time evolution of the density induced by an SDE.It describes how the drift f and diffusion g jointly shape p(x,t).
- Drift term: For constant-velocity motion, density at position x comes from position x−vt at the initial time, yielding the continuity equation.Differentiating the transported-density identity with respect to time produces the conservation law.
- Drift term: General deterministic dynamics dx=f(x,t)dt place f inside the spatial derivative because it represents probability flux.With vanishing boundary density, integrating this total derivative preserves total probability.
- Noise term: Pure diffusion dx=g dW produces a Gaussian with variance g^2t, whose density satisfies the diffusion equation.The variance follows from accumulated Brownian motion over time t.
- Combined dynamics: Combining drift and diffusion yields the full Fokker–Planck evolution equation.The complete equation combines the deterministic transport and stochastic spreading contributions.
A.3 Derivation Step 2: KL decay and squared-score objective
For two solutions of the same Fokker–Planck equation, drift preserves their KL divergence while diffusion decreases it, making KL non-increasing along the forward process. This contraction supports decomposing maximum likelihood into local squared-score objectives.
- Setup: The derivation compares two densities p and q evolving under the same Fokker–Planck equation with shared drift f and diffusion strength g.The operator formulation sets ∂_t p = Lp and ∂_t q = Lq.
- KL evolution: The drift contribution cancels under integration by parts, so drift does not change KL(p_t∥q_t).The cancellation assumes vanishing boundary terms.
- KL evolution: Diffusion decreases KL by producing a nonpositive score-difference term in the KL derivative.The calculation uses ∇p = p∇log p and ∇q = q∇log q before subtracting the contributions.
- Conclusion: KL(p_t∥q_t) is non-increasing along the forward diffusion, with equality only when the two scores coincide almost everywhere.Thus diffusion strictly contracts KL except in the equal-score case.
- Conclusion: This monotone KL decrease justifies decomposing the global maximum-likelihood objective into local-in-time squared-score terms.The local terms are associated with individual diffusion steps.
A.4 Derivation: equivalence between DSM and SM
The derivation shows that denoising score matching and marginal score matching differ only by a constant independent of the model score. Their cross terms coincide, so both objectives have the same minimizer: the true marginal score.
- Conclusion: DSM and SM differ by a constant independent of s_θ, so both are minimized by the true marginal score.Consequently, they have the same minimizer at each time t.
- Definitions: The derivation defines denoising score matching at time t and score matching on the marginal distribution p_t(x_t).The marginal is obtained by integrating the forward conditional distribution against the initial distribution.
- Definitions: Conditional and marginal scores are related through the forward conditional distribution and its marginalization over x_0.The conditional score is defined as the gradient of the conditional log density.
- Objective comparison: Expanding both squared-error objectives separates score-dependent terms, cross terms, and terms independent of s_θ.The expansion uses ∥a − b∥2 = ∥a∥2 + ∥b∥2 − 2⟨a,b⟩.
- Objective comparison: The DSM and SM cross terms are identical because integration and differentiation can be interchanged under mild regularity conditions.The equality is applied coordinatewise to s_θ(x_t,t).