Recommended resources
The freely available resources this lesson will direct you to.
Last lesson established that a diffusion timestep is best understood by its noise level, not by its integer index. For a variance-preserving forward process,
the relevant diagnostic is
This lesson asks a more practical question: how does the choice of noise schedule distribute SNR over the trajectory? We will compare the original DDPM linear schedule with the cosine schedule introduced by Nichol and Dhariwal, and distinguish carefully between “linear in timestep” and “linear in the actual corruption level.”
Two meanings of “schedule”
A diffusion schedule can be specified in several equivalent ways:
- Per-step noise variances
- Cumulative retained-signal variance
- Signal and noise amplitudes and
- SNR or log SNR
For comparison, the cumulative form is usually most revealing:
Thus,
Here denotes the total signal amplitude at timestep , not the one-step DDPM coefficient . Keeping those two conventions separate prevents a common source of confusion.
The two schedules have different starting points.
The DDPM linear schedule
The original DDPM schedule makes the per-step variance increase linearly:
Then
The word linear applies only to . It does not mean that , SNR, or log SNR decreases linearly. Since is a cumulative product, its behavior is substantially curved.
The cosine schedule
The improved DDPM cosine schedule instead designs the cumulative retained-signal variance directly:
where
The small offset , commonly set to , avoids an impractically tiny initial noise increment. Once is specified, the corresponding DDPM step variances are recovered as
In implementation, the final is usually clipped below , often to , to avoid a singular final step.
Improved Denoising Diffusion Probabilistic Models
Read Section 3.2, “Improving the Noise Schedule,” from Nichol and Dhariwal. This is the original motivation for the cosine schedule and includes the empirical observation that late portions of a linear trajectory can be unnecessarily noisy.
In Section 3.2, begin at the paragraph starting the observed linear-schedule problem. Continue through Figure 5 and the cosine-schedule definition, ending with the authors' design rationale. Focus on what is being shaped: \bar{\alpha}_t, not merely the individual \beta_t values.
Reading schedules through their SNR profiles
Because SNR is determined by ,
a schedule that preserves longer also preserves a higher SNR longer.
A particularly useful coordinate is
Recall the interpretation:
| Log SNR regime | SNR regime | Corruption state |
|---|---|---|
| Retained image structure dominates | ||
| Equal signal and noise power | ||
| Gaussian noise dominates |
The variance-preserving condition means that log SNR completely determines the two scales:
So comparing log-SNR curves is not merely a visualization convenience. It compares the full family of denoising tasks presented to the model.
V. The Noise Schedule - Tony Duan
Tony Duan’s “The Noise Schedule” provides a compact alternative view: a variance-preserving schedule can be described geometrically by signal and noise amplitudes, or equivalently by SNR.
First, in “Commonly Used Options,” read from the two schedule definitions. Then read the “Angular Interpretation” paragraph, paying attention to the relation between \alpha_t, \sigma_t, and an angle in the first quadrant. Finally, in “Signal to Noise Ratio,” locate the discussion beginning the SNR identities. Treat this as notation practice: verify for yourself that knowing log SNR is enough to recover both squared coefficients.
What the comparison looks like

The figure conveys three linked observations.
First, the cosine schedule keeps the signal amplitude higher over much of the trajectory. In the left plot, the red cosine curve declines more slowly than the blue linear curve through the middle timesteps. Since signal power is , this indicates greater retained information at matched timestep indices.
Second, the cosine schedule adds noise more gradually through much of the process. In the center plot, its rises later. This is the same fact viewed from the other side: when signal retention remains high, accumulated noise variance remains lower.
Third, the log-SNR plot shows why this matters for training and sampling. Over the main interior of the schedule, cosine maintains a higher log SNR than the linear schedule. A model trained at, say, therefore faces different denoising problems under the two schedules, even if both processes use steps.
The final part of the cosine curve drops sharply. This is intentional: the forward process still needs to reach an approximately Gaussian terminal distribution. In a practical discrete implementation, clipping prevents the final from becoming exactly .
There is no contradiction between these statements:
- Cosine changes gently near the beginning and end.
- Cosine log SNR changes very rapidly near idealized endpoints.
Near a clean sample, the noise variance approaches zero, so SNR tends toward infinity. Near pure noise, signal variance approaches zero, so SNR tends toward zero. Taking a logarithm makes both endpoint limits unbounded. The offset and variance clipping used in real schedules regularize those extremes.
A geometric view of the cosine schedule
Ignoring the small offset for a moment, a simple cosine construction is
It automatically satisfies
Let
Then traces a quarter of the unit circle as moves from to . Its SNR is
At the equal-power point,
For this idealized zero-offset schedule, that happens at
which corresponds to the midpoint .
This geometric picture is useful because it makes the schedule design tangible: a cosine schedule spaces the angle evenly, rather than increasing a local noise variance linearly. The practical offset version slightly modifies this ideal geometry, but preserves the same broad behavior.
Why the original linear schedule can waste late timesteps
With a standard linear schedule, the later per-step noise variances are the largest. Their effects compound after many earlier corruptions have already reduced . Consequently, the process can reach extremely low SNR well before the nominal terminal time.
At very low SNR, a sample may be so close to isotropic Gaussian noise that additional forward steps change little that is relevant to image content. The improved-DDPM paper found that, for by and by images, this behavior made the end of the linear forward trajectory overly noisy. Their evidence included the observation that skipping a substantial late fraction of reverse steps did not materially worsen FID for a model trained with that schedule.
The key claim is not that every low-SNR timestep is useless. A generative model must learn to begin from noisy inputs. Rather, the concern is allocation: a fixed budget of discrete timesteps should cover meaningful changes in corruption level instead of repeatedly representing nearly indistinguishable noise-dominated states.
The cosine schedule reallocates that budget:
| Schedule property | Linear schedule | Cosine schedule |
|---|---|---|
| Quantity designed directly | Per-step noise variance | Cumulative signal retention |
| Middle of trajectory | Signal may decay relatively quickly | Signal is retained longer |
| Late trajectory | Can spend many steps at very low SNR | Terminal loss of signal is concentrated later |
| Historical status | Original DDPM baseline | Common default in many later DDPM-style systems |
“Common default” should not be read as a universal optimum. The best schedule depends on data resolution, model capacity, objective weighting, parameterization, and the sampler. But cosine scheduling is often a better baseline because it avoids an obvious mismatch between uniform timestep indexing and the information content of the noisy inputs.
Comparing schedules in code
The following code constructs both schedules in a form suitable for plotting. It recomputes the cosine cumulative product after clipping, so the displayed matches the actual discrete transition variances used by the model.
import math
import torch
T = 1000
eps = 1e-12
# Original DDPM-style linear beta schedule
betas_linear = torch.linspace(1e-4, 2e-2, T)
alpha_bar_linear = torch.cat(
[
torch.ones(1),
torch.cumprod(1.0 - betas_linear, dim=0),
]
)
# Improved-DDPM cosine schedule
s = 0.008
t = torch.arange(T + 1, dtype=torch.float64) / T
f_t = torch.cos(((t + s) / (1.0 + s)) * math.pi / 2.0) ** 2
alpha_bar_target = f_t / f_t[0]
betas_cosine = 1.0 - alpha_bar_target[1:] / alpha_bar_target[:-1]
betas_cosine = betas_cosine.clamp(max=0.999)
alpha_bar_cosine = torch.cat(
[
torch.ones(1, dtype=torch.float64),
torch.cumprod(1.0 - betas_cosine, dim=0),
]
)
def log_snr(alpha_bar):
alpha_bar = alpha_bar.clamp(min=eps, max=1.0 - eps)
return torch.log(alpha_bar) - torch.log1p(-alpha_bar)
log_snr_linear = log_snr(alpha_bar_linear)
log_snr_cosine = log_snr(alpha_bar_cosine)
When you plot log_snr_linear and log_snr_cosine against normalized time , focus on three questions:
- At which normalized times does each curve cross zero?
- How much of the trajectory lies at strongly negative log SNR?
- Does a fixed increment in timestep correspond to a comparably sized change in log SNR throughout the trajectory?
Those questions are more informative than asking only which schedule “adds noise faster.”
A disciplined interpretation
When comparing schedules, avoid four misleading shortcuts.
-
Do not equate timestep with noise level.
Timestep is a label whose meaning depends entirely on the schedule. -
Do not call the DDPM schedule linear in SNR.
It is linear in , while SNR depends nonlinearly on the product of all previous . -
Do not infer image recognizability solely from SNR.
SNR gives an exact variance-based description of the corruption, but perceived structure also depends on the data distribution and image resolution. -
Do not treat cosine as a magical functional form.
The original authors explicitly describe the cosine squared choice as a convenient smooth shape. Its central contribution is a more sensible distribution of noise levels, not a uniquely privileged trigonometric formula.
Key takeaways
A linear DDPM schedule specifies linearly increasing per-step variances:
Its cumulative signal retention,
and therefore its SNR profile are nonlinear.
The cosine schedule specifies cumulative signal retention more directly:
Compared at a common timestep index, cosine generally retains higher SNR through much of the trajectory, while bringing the sample to near-pure noise only near the end. This can prevent the late diffusion trajectory from being dominated by many nearly redundant, extremely low-SNR states.
Next, you will make these profiles concrete by implementing and visualizing forward diffusion on image data.