How a diffusion model destroys data on purpose: a noising chain whose rescaled steps keep the variance at one, a closed-form jump to any step, and the noise schedules used in practice.
Take a photo and add a faint layer of Gaussian noise. Add another, and another. After a thousand layers nothing of the photo is left, and the result looks like any other draw from N(0,I). Destroying an image this way needs no learning. Played backwards, the same film would turn noise into a photo, one small denoising step per frame.
That reversed film is a diffusion model. Unlike the energy-based models before it, it never runs a sampler during training: the noising process is fixed, and a network learns only the way back. DDPM, Denoising Diffusion Probabilistic Models (Ho, Jain and Abbeel, 2020), made this work at image quality competitive with GANs, building on the diffusion models of Sohl-Dickstein et al. (2015).
Before any network appears, the noising process has to be designed. Two properties make it useful. Wherever the image starts, the process must end at one fixed distribution that we can sample, because generation will start there. And it must be possible to jump from the image to any intermediate step in one draw, because training will need noisy images at random steps millions of times.
Write x0 for a data point, an image whose pixels are scaled to [−1,1], and xt for its noised version after t steps, t=1,…,T. One noising step is a conditional distribution q(xt∣xt−1), and the steps form a Markov chain: xt depends on the past only through xt−1. The data distribution is written q(x0), since the chain starts there. The learned reverse step, from xt back to xt−1, is written pθ(xt−1∣xt), with θ the parameters of a network.
The forward chain adds noise; the model walks back
Forward arrows: the fixed noising step q(xₜ | xₜ₋₁). Curved arrows: the learned reverse step pθ(xₜ₋₁ | xₜ). Tiles are samples xₜ = √α̅ₜ x₀ + √(1 − α̅ₜ) ε for α̅ = 1, 0.8, 0.5 and 4 × 10⁻⁵ (the end of DDPM's schedule), with one fixed noise draw ε.
We work in one dimension, a single pixel. Every pixel of an image is noised independently with the same rule, so for images 1 becomes the identity matrix I. Throughout, ε∼N(0,1) is standard Gaussian noise, drawn fresh at every step, and the second argument of N(μ,σ2) is the variance.
After t steps, q(xt∣x0)=N(x0,tβ). The jump from x0 to any xt is one Gaussian draw, so the second property holds. The first does not. The mean stays at x0 forever, and the variance tβ grows without bound, so there is no fixed distribution at the end of the chain to start generation from. This is the variance-exploding process (Isachenko, 2025, lecture 11). Models built on it stop at a large finite noise level and start sampling from a wide Gaussian of that size; the score matching note works with one.
for every image x0. Adding noise alone cannot do it, because the mean never moves. So each step also shrinks the previous point by a factor a, pulling the mean towards 0:
xt=axt−1+βtε.
The noise variance βt∈(0,1) may now change from step to step. Which a? The fresh noise is independent of xt−1, so the variance of a sum is the sum of the variances, and scaling by a multiplies a variance by a2:
Var(xt)=a2Var(xt−1)+βt.
The target N(0,1) has variance 1, and a point already at the target must stay there. Setting both variances to 1:
Single steps and one-jump shortcuts for two chains; in both, t steps collapse into one Gaussian jump q(xₜ | x₀). Without rescaling (top) the mean stays at x₀ and the variance grows without bound. Scaling by √(1 − β) (bottom) shrinks the mean and keeps the variance 1 − α̅ₜ below 1.
The step leaves N(0,1) exactly unchanged. If xt−1∼N(0,1), then xt is a linear combination of two independent standard normals, hence Gaussian (affine maps of Gaussians), with mean 0 and variance (1−βt)+βt=1. A process whose step keeps unit variance is called variance-preserving.
There is also a reason the step pulls towards N(0,1) in particular. For small βt a Taylor expansion gives 1−βt≈1−βt/2; at βt=0.02 the two are 0.98995 and 0.99. So
xt≈xt−1+2βt(−xt−1)+βtε.
The score of N(0,1), the gradient of its log-density, is −x. The step is therefore one step of unadjusted Langevin dynamics with step size βt towards the standard normal: a sampler for N(0,1), run from the image (Isachenko, 2025, lecture 7).
Given x0, this is x0 times a constant plus two independent Gaussians, so it is Gaussian. Linearity of expectation gives its mean, and independence of ε1 and ε2 gives its variance as a sum:
The variance simplifies once we subtract it from 1 and use β=1−α:
1−α2β1−β2=α2−α2β1=α2α1=αˉ2.
So q(x2∣x0)=N(αˉ2x0,1−αˉ2). With toy values β1=0.1 and β2=0.2: αˉ2=0.72, the mean coefficient is 0.72=0.849, and the variance is 0.8⋅0.1+0.2=0.28=1−0.72.
The same argument, repeated, is an induction on t. Suppose xt−1=αˉt−1x0+1−αˉt−1ε′, where ε′ is a standard normal built from the noises of steps 1,…,t−1, so it is independent of the fresh ε. Substituting into the step:
The mean coefficient is αˉt by the definition of αˉt. The two independent noises merge into one Gaussian whose variance is the sum:
αt(1−αˉt−1)+βt=αt−αˉt+1−αt=1−αˉt.
The base case t=1 is the step itself. Hence, for every t,
q(xt∣x0)=N(αˉtx0,1−αˉt)
or, as a recipe, xt=αˉtx0+1−αˉtε (Ho, Jain and Abbeel, 2020, Eq. 4). Here ε is the merged standard normal, so the equality holds in distribution. The two squared coefficients always add up to 1, the variance-preserving property again.
If every βt lies in some interval [βmin,1) with βmin>0, then αˉt≤(1−βmin)t→0. The image term αˉtx0 goes to 0 and the noise coefficient 1−αˉt goes to 1. A Gaussian density is a continuous function of its mean and variance, so it converges pointwise to N(0,1): q(xt∣x0)→N(0,1) for every x0. For a constant β=0.02, so that αˉt=0.98t, the two chains compare as follows:
t
αˉt
mean coefficient αˉt
noise std 1−αˉt
naive noise std tβ
1
0.980
0.990
0.141
0.141
10
0.817
0.904
0.428
0.447
50
0.364
0.603
0.797
1.000
100
0.133
0.364
0.931
1.414
200
0.0176
0.133
0.991
2.000
For small t the two chains almost agree. Then the naive noise passes the target spread and keeps growing, while DDPM’s approaches 1 from below as the image fades.
Figure
Variance exploding versus variance preserving
Coefficients of xₜ = (mean coefficient)·x₀ + (noise std)·ε for a constant β = 0.02. Naive chain: the mean coefficient stays 1 and the noise std √(tβ) reaches 2.0 at t = 200. DDPM chain: √α̅ₜ falls to 0.13 and √(1 − α̅ₜ) rises to 0.991. Dashed: the target std 1.
The whole data distribution follows. Its marginal at step t is q(xt)=∫q(xt∣x0)q(x0)dx0. The variance recursion above, with a2=αt and βt=1−αt, moves the distance of the variance from 1 by a factor αt at each step:
where the last line repeats the step down to x0. Hence Var(xt)=αˉtVar(x0)+1−αˉt, a weighted average of the data’s variance and 1. For a mixture of Gaussians the marginal stays a mixture. The integral over x0 is linear, so each component can be pushed through separately, and a component N(μk,σk2) scaled by αˉt plus independent noise of variance 1−αˉt is again Gaussian (affine maps):
Every component is pulled towards mean 0 and variance 1. The figure below takes q(x0)=0.45N(−1.3,0.422)+0.55N(1.25,0.452) and DDPM’s linear schedule. The two humps move together; counting the local maxima of the exact q(xt) on a fine grid, the density has two up to t=266 and one from t=267, where αˉt=0.48. It ends as a single bell curve.
Figure
The data distribution dissolves into N(0, 1)
A 1-D mixture of two Gaussians, noised with DDPM's linear schedule (T = 1000). Curves: the exact marginals q(xₜ) = Σₖ πₖ N(√α̅ₜ μₖ, α̅ₜσₖ² + 1 − α̅ₜ). Bars: a histogram of 600 samples pushed through the same steps. The two humps merge and end as N(0, 1).
The sequence β1,…,βT is the schedule. DDPM uses T=1000 steps and a linear schedule from β1=10−4 to βT=0.02 (Ho, Jain and Abbeel, 2020, §4). Small steps at the start keep the early xt close to the image; larger steps later finish the job. With this schedule αˉt falls below 0.5 at t=260 and below 0.01 at t=674, and it ends at αˉ1000=4.0×10−5: the image term of x1000 is scaled by αˉ1000=0.0064.
Figure
A linear β schedule and the resulting α̅ₜ
Top: βₜ grows linearly from 10⁻⁴ to 0.02. Bottom: α̅ₜ = ∏ (1 − βᵢ) falls slowly at first, is ≈ 0.5 at t ≈ 259, drops below 0.01 at t = 674 and ends at 4.0 × 10⁻⁵.
A schedule can also be read as a signal-to-noise ratio,
SNRt=1−αˉtαˉt,
the squared coefficient of the image over the variance of the noise. For the linear schedule it falls from 104 at t=1 to 4.0×10−5 at t=T. Continuous-time diffusion models parameterize the schedule by this ratio directly (Murphy, 2023, §25.2.4).
The quadratic schedule interpolates the noise amplitude βt linearly, so its steps stay small for longer. The sigmoid schedule is flat at both ends and makes its change in the middle; since sigmoid(±6) is not exactly 0 or 1, its βt actually run from 1.5×10−4 to 0.01995.
The cosine schedule prescribes αˉt instead and derives the steps from it, using αˉt=αtαˉt−1 (Nichol and Dhariwal, 2021, Eq. 17):
The offset s=0.008 keeps the first step’s noise amplitude just below the width 1/127.5 of one pixel level, and βt is clipped at 0.999: without the clip, f(T)=0 would give βT=1.
Figure
Four noise schedules: how α̅ₜ falls
α̅ₜ for four schedules with T = 1000: linear, quadratic and sigmoid with β from 10⁻⁴ to 0.02, and cosine with s = 0.008. Dots mark where α̅ₜ first drops below 0.5: t = 260, 419, 440 and 497. Compare how long each stays at medium noise.
With T=1000:
schedule
αˉt<0.5 from
αˉt<0.01 from
αˉ1000
linear
t=260
t=674
4.0×10−5
quadratic
t=419
t=851
7.3×10−4
sigmoid
t=440
t=721
4.0×10−5
cosine
t=497
t=936
2.4×10−9
The linear schedule destroys the image fastest: from t=674 on less than 1% of the signal variance is left, so its last third works on almost pure noise. Nichol and Dhariwal observed on ImageNet 64×64 that a model trained with it barely loses FID when up to 20% of the reverse process, the noisiest end, is skipped. Their cosine schedule falls almost linearly through the middle and crosses 0.5 near T/2; with T=4000 it improved FID from 31.3 to 27.0 on that dataset (their Table 1).
Generation starts from N(0,1), but the chain ends at q(xT∣x0). The mismatch is the KL divergence between the two, which the next note meets as the term LT of the training bound. For one pixel, the KL divergence between two 1-D Gaussians (derived here) with μP=αˉTx0, σP2=1−αˉT and Q=N(0,1) is
Compare two chains on a pixel at x0=1, the brightest value:
chain
αˉT
q(xT∣x0=1)
LT, bits
DDPM, T=1000, linear
4.0×10−5
N(0.0064,1.0000)
2.9×10−5
toy, T=100, sigmoid from 10−5 to 10−2
0.605
N(0.78,0.40)
0.67
For pixels spread uniformly over [−1,1], E[x02]=1/3 and DDPM’s chain gives LT=9.7×10−6 bits per pixel, in line with the ”≈10−5 bits per dimension” that Ho, Jain and Abbeel report (§4). The toy chain keeps 78% of the image’s amplitude at its last step. A sampler that starts from N(0,1) then starts from the wrong distribution: its first reverse steps are trained on inputs that still show the image, and they are handed pure noise.
Scale matters for the same reason. The image term αˉTx0 is small only relative to x0. DDPM maps pixel values 0,…,255 to [−1,1]; on the raw scale the leftover image at T=1000 would reach 255⋅0.0064=1.6, larger than the noise.
The diffusion notebook of the HSE-LAMBDA Deep Generative Models repository works on a 2-D Swiss roll of 10,000 points with T=100 steps. The notebook has no saved outputs, so it documents procedures rather than results. Its forward part:
The step-by-step chain with a constant β=0.0005, for which αˉ100=0.951: after 100 steps the roll is still almost intact.
make_beta_schedule with the linear, quadratic and sigmoid shapes above, called with the sigmoid shape from 10−5 to 10−2; the actual βt run from 3.5×10−5 to 0.0100, and αˉ100=0.605.
q_sample, the one-draw jump xt=αˉtx0+1−αˉtε, plotted for several t: independent draws for each t, not one trajectory.
The schedule is the toy chain of the failure above: the reverse samplers later in the notebook start from N(0,I), although q(x100∣x0)=N(0.78x0,0.40I). The reverse part is described in the next note.
We now have a process that turns any image into noise indistinguishable from N(0,I), and a formula for every intermediate step. Running it backwards needs the reverse step q(xt−1∣xt), which depends on the unknown data distribution. DDPM: reverse process and training objective trains a network to imitate it, starting from a bound on the likelihood.
Конспект курса «Байесовские методы в анализе данных», 2026, github.com/bmml-team/bmml_ftda, лекция 5 (the forward process and its closed form).
R. Isachenko. Deep Generative Models, MIPT and Yandex School of Data Analysis, 2025. Course repository; lecture 7 (forward Gaussian diffusion and its link to Langevin dynamics), lecture 11 (variance-preserving and variance-exploding processes).