4.5.12 · D4Generative Models

Exercises — Noise scheduling

2,764 words13 min readBack to topic

Level 1 — Recognition

Exercise 1.1

You are told . What is ? What does this number mean in plain words?

Recall Solution

What we do: apply the definition . Meaning: at step , a single noising step keeps of the signal amplitude and swaps in worth of noise. It is a per-step survival fraction, not cumulative.

Exercise 1.2

Given the first three survival fractions , compute .

Recall Solution

What we do: is the product of all up to , because signal survival compounds — each step multiplies what is left. So after three steps about of the original signal amplitude remains.

Exercise 1.3

The direct-sampling formula is . If , write the mean coefficient and the variance.

Recall Solution

Recall the symbols: is the shortcut distribution for the noised image at step given the clean ; its mean is and its variance is per pixel (the means "same in every dimension"). Mean coefficient = . The clean image is scaled to half its brightness. Variance = . Why variance = energy: for a zero-mean random pixel, its variance is its average squared value — i.e. its mean power (energy per pixel). So a variance of literally says three-quarters of each pixel's energy is now pure Gaussian fuzz.


Level 2 — Application

Exercise 2.1

For a linear schedule with , , , list all four using

Recall Solution

Why this formula is "linear": we want to rise from to in equal increments as marches — a straight line in — because that is the simplest interpolation that guarantees the noise added grows steadily and reaches near-zero. The factor is just "how far along the line we are," from at to at . What we do: the step size in is .

  • Evenly spaced, exactly as "linear" promises.

Exercise 2.2

Using the from 2.1, compute .

Recall Solution

What we do: turn each into , then multiply (signal survival compounds step by step, hence a product). Only about of the signal survives after aggressive steps.

Exercise 2.3

For , compute and (natural log).

Recall Solution

What we do: apply . Negative log-SNR means noise now dominates signal (ratio below ).


Level 3 — Analysis

Exercise 3.1

Prove that combining two consecutive forward steps gives variance on the noise attached to . Start from (Recall: is the image two steps back, and are two independent fresh noise draws.)

Recall Solution

Why this tool (adding Gaussian variances): and are independent standard normals. For independent Gaussians, variances add — that is the single fact that lets us merge two noise terms into one. What we do: collect the two noise coefficients.

  • Coefficient of is , so its variance contribution is .
  • Coefficient of is , contributing . Add them: The terms cancel, leaving one clean noise term . Iterating this is exactly how the parent note reaches .

Figure below (s01): two black bell curves — the solid one is the noise from step (variance ), the dashed one is the noise from step (variance ). The red curve is their merged single Gaussian, whose variance is the sum — notice the red curve is wider (more spread) than either black one, because adding variances always widens.

Figure — Noise scheduling

Exercise 3.2

The parent note says linear schedules "rush early and collapse the signal." Given linear DDPM values and cosine , compute for each at and explain, in one sentence, what the gap means for the network.

Recall Solution

What we do: apply to each.

  • Linear: ,
  • Cosine: , . Meaning: at the exact midpoint the linear schedule is already deep in noise (log-SNR ), so half of its remaining timesteps denoise near-pure static — wasted effort; cosine sits at the balanced point (log-SNR ), spreading difficulty evenly.

Exercise 3.3

Show algebraically that inverting the log-SNR definition gives where and .

Recall Solution

What we do: start from the definition and solve for . Multiply both sides by : This is why an SNR-parametrised schedule is just "push a straight line for through a sigmoid."


Level 4 — Synthesis

Exercise 4.1

Design a regularised SNR schedule with . Use finite endpoints (start) and (end), linear in : Compute and the corresponding values.

Recall Solution

Why finite : the true start has (empty product — see the definition callout up top), giving and , which is undefined. Capping at makes slightly below , the tiny-noise-at-start behaviour we want. What we do: slope per step, decreasing.

  • Signal fraction glides — smooth and, crucially, finite at both ends.

Figure below (s02): the red curve is , the cumulative signal, gliding smoothly from down through to ; the dashed black line is the straight log-SNR (rescaled to fit the same axes) that we pushed through the sigmoid. Red dots mark the three computed points at — the S-shape of the red curve is precisely the "slow–fast–slow" decay the sigmoid produces from a straight line.

Figure — Noise scheduling

Exercise 4.2

From your values in 4.1, recover the implied per-step for step , using . You'll need .

Recall Solution

What we do: first get . Then So the SNR design implies — you never chose directly; it fell out of the log-SNR line. This is the whole point of SNR-first design.


Level 5 — Mastery

Exercise 5.1

A team reports cosine at gives FID versus linear at giving FID . They want to justify shipping the cosine- model. Compute the speedup factor and the FID change, then state whether the trade is worth it and why, referencing SNR.

Recall Solution

Speedup: fewer sampling steps. FID change: higher FID (lower FID is better, so this is a tiny quality loss). Verdict & why: faster for a FID penalty is an excellent trade. The reason cosine survives step-skipping is that its log-SNR decreases smoothly and near-uniformly across time — each retained step still carries roughly equal information, so dropping of them does not create a "difficulty cliff." A linear schedule dumps most of its useful work into a narrow early band and would degrade far more if thinned. This connects directly to 4.5.18-Fast-sampling.

Exercise 5.2

You must certify a schedule meets both boundary conditions: with , and . Your SNR line is . Find the smallest integer (in nats) that satisfies the start condition, and check whether satisfies the end condition.

Recall Solution

Start condition: need . Solve Smallest integer meeting this is (since , while ). End condition: . ✓ Satisfied. Both boundaries pass, so the certified line is .

Exercise 5.3

Synthesis proof: show that for any valid schedule with all , the cumulative is strictly decreasing in and bounded in . Then state what this guarantees about the forward process reaching the prior .

Recall Solution

Starting point: by the empty-product convention (stated in the definition callout at the top). Strictly decreasing: . Since , multiplying by shrinks a positive number: . So the sequence falls at every step. Bounded in : it is a product of factors each in , so it stays positive and below (from , every later term is strictly below ). Guarantee: a strictly decreasing positive sequence converges. Choosing so the product drives means — the endpoint becomes the fixed prior, independent of . That -independence is exactly what lets sampling start from pure noise, the foundation of 4.5.11-Forward-and-reverse-diffusion-process.


Recall Self-test summary (reveal after finishing all levels)

Products not sums (), and by empty product ::: L1–L2 core skill Independent Gaussian variances add, not std-devs ::: L3 core skill inverts log-SNR ::: L3–L4 bridge Finite keeps the start well-defined ::: L4 boundary insight FID is a distance (lower = better); smooth log-SNR enables step-skipping ::: L5 judgement

Connections