research29 min studyLesson 780 in Engineering

Diffusion evaluation: freeze the data and sampling protocol before comparing models

Control source-group splits, preprocessing, held-out denoising, sampling settings, feature metrics, and paired evaluations.

On this page

What you’ll understand

  • Define data and evaluation manifests preventing source-group leakage.
  • Interpret distribution-level feature metrics within their preprocessing and sample-count assumptions.
  • Separate training improvements from sampler, guidance, EMA, and selection changes.

A diffusion model can appear better because its validation set overlaps training data, its sampler takes more steps, or its evaluator resizes images differently. A convincing comparison records the full data and sampling protocol, keeps a held-out decision boundary, and reports several relevant outcomes. Training loss, visual preference, conditional alignment, and feature-distribution distance are related evidence rather than interchangeable definitions of quality.

Split source groups and preserve preprocessing identity

Deduplicate and group near-related examples before assigning training, validation, and test splits. Frames from one video, alternate crops of one image, or repeated captions can leak information across an image-level random split. Record source-group IDs, content digests, filtering, caption transformations, crop and resize rules, and dataset revisions. Split design should match the intended generalization question, such as new sources or new compositions. A split with different content difficulty is another experimental condition rather than a neutral bookkeeping change.

Keep model selection and hyperparameter tuning on the declared validation protocol, then evaluate the final comparison on a held-out test set. Preserve the autoencoder, tokenizer, condition encoder, latent scaling, and augmentation configuration. A cached latent or condition representation can accidentally carry preprocessing from another split or revision. For denoising validation, use a fixed reference target, timestep distribution, and noise policy so a changed training proposal does not redefine the reported measure. Compare raw parameter and EMA artifacts explicitly rather than silently choosing whichever looks better.

Δ^=1N∑i=1N(si(A)−si(B))\widehat\Delta=\frac1N\sum_{i=1}^{N}\left(s_i^{(A)}-s_i^{(B)}\right)
This paired mean uses N>0 aligned evaluation cases and a declared score where larger is better. Common prompts/seeds support a controlled pairing but do not guarantee variance reduction or independence. Feature-distribution metrics such as FID are different, non-per-example statistics.↔ Scroll wide equations horizontally.

Feature metrics depend on the evaluation pipeline

FID compares Gaussian moment approximations in a chosen feature representation. It is affected by feature extractor, preprocessing, image resizing, sample count, and the reference dataset. Clean-FID studies evaluation discrepancies caused by implementation and resizing choices. Do not compare numbers produced by undocumented pipelines as if they were identical measurements. A finite-sample score has estimation error and bias, and a lower feature distance does not prove caption alignment, absence of memorization, diversity on every data slice, or fidelity to an individual source.

Report complementary measures and human review relevant to the task, including conditional adherence, diversity, reconstruction quality when applicable, and representative failures. Freeze prompt sets, random inputs, sampler algorithm, step count, guidance formula and scale, precision, and output postprocessing. Selecting attractive samples or changing guidance only for one model confounds the comparison. A sampling improvement and a training improvement can both be useful, but distinguish them with a factorial or otherwise controlled experiment rather than attributing the full result to the loss function.

DFID=∥μr−μg∥22+tr⁡ ⁣(Σr+Σg−2(Σr1/2ΣgΣr1/2)1/2)D_{\rm FID}=\|\mu_r-\mu_g\|_2^2+\operatorname{tr}\!\left(\Sigma_r+\Sigma_g-2(\Sigma_r^{1/2}\Sigma_g\Sigma_r^{1/2})^{1/2}\right)
μ and positive-semidefinite Σ are means and covariances of the specified real/generated feature distributions. Matrix square roots use the positive-semidefinite construction. Practical estimators and numerical handling must be documented; the formula is not a universal perceptual, conditional, or memorization guarantee.↔ Scroll wide equations horizontally.

Make uncertainty and selection visible

Use repeated runs or an appropriate uncertainty analysis for the measured statistic, keeping dependence and finite sample size in view. Paired seeds can help isolate a change, but generated outputs remain dependent on checkpoint and sampler choices. Report failed runs, skipped updates, compute budget, and the checkpoint-selection rule. Slice evaluation by rare content, resolution, and conditioning complexity. When several weights or guidance scales are swept, reserve fresh validation or account for the selection procedure rather than reporting only the best noisy result.

The sampling lab models a binary evaluation rate under independent identical cases. Reset, set p=0.80 and n=20, predict mean sample proportion 0.80 and variance 0.008, then Play or Step. Separately Reset, set p=0.80 and n=100, predict the same mean and variance 0.0016, then Play or Step. Playback tours exact outcome probabilities rather than generating images. It has no FID estimator, paired model scores, or human judgment; use it to see why a finite test count has uncertainty under assumptions, then analyze the actual evaluation statistic.

Check a one-dimensional Gaussian feature distance

For a teaching one-dimensional analogue of the FID formula, reference features have mean zero and variance four, while generated features have mean one and variance nine. Treat these as exact population moments.

  1. Squared mean difference is (0−1)²=1.

  2. The covariance contribution is 4+9−2×sqrt(4×9)=13−12=1.

  3. The total Gaussian feature distance is two. It is not an image-quality guarantee or a measured benchmark FID; actual feature extraction, sample estimation, and preprocessing introduce additional conditions.

The result

The hand calculation validates the stated moment formula in one dimension while keeping its interpretation separate from full generative evaluation.

Explore the model

Interactive lab

Interactive lab · sampling

A finite evaluation rate has uncertainty

Reset, set p=0.80 and n=20, predict sample-mean expectation 0.80 and variance 0.008, then Play or Step. Separately Reset, set p=0.80 and n=100, predict variance 0.0016, then Play or Step. The exact iid binomial has no images, FID, paired checkpoints, or human evaluator.

A finite evaluation rate has uncertaintyExact binomial masses for the mean of n independent Bernoulli trials, compared with normal mass between adjacent half-count boundaries; normal tails outside the finite support remain outside the bars. Playback highlights outcomes, not random samples. The Berry–Esseen bound applies to standardized CDFs, not individual bars or continuity-corrected errors. At p = 0 or 1, normal comparison and that bound are disabled. Normal-CDF evaluation uses a numerical approximation with absolute error below 7.5×10⁻⁸ (at most 1.5×10⁻⁷ per interval, before rounding). Current readings: Mean sample proportion: 0.5; Sample-mean variance: 0.0125; Uniform CDF error bound: ≤ 0.1062. All parameters are adjustable with the labeled controls below.Exact distribution of the mean of 20 independent Bernoulli variables with success probability 0.5; playback highlights outcome 0.00.250.50.75100.0580.1150.1730.23Sample mean · k / nProbability massNormal bin masses are an approximationk = 0 · exact probability = 9.54e-7
Exact binomial massNormal interval massHighlighted outcome / mean
Mean sample proportion
0.5
Sample-mean variance
0.0125
Uniform CDF error bound
≤ 0.1062
t = 0 s

Exact binomial masses for the mean of n independent Bernoulli trials, compared with normal mass between adjacent half-count boundaries; normal tails outside the finite support remain outside the bars. Playback highlights outcomes, not random samples. The Berry–Esseen bound applies to standardized CDFs, not individual bars or continuity-corrected errors. At p = 0 or 1, normal comparison and that bound are disabled. Normal-CDF evaluation uses a numerical approximation with absolute error below 7.5×10⁻⁸ (at most 1.5×10⁻⁷ per interval, before rounding). Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forState the metric, sample count, dependence, preprocessing, and selection protocol behind a reported improvement.

Check your understanding

Why can two reported FID values be incomparable even for similarly named datasets?

Try it yourself

On twenty aligned cases with one declared binary quality criterion, model A passes sixteen and B passes eighteen; fifteen pass under both. Count B's gains, losses relative to A, and net pass-rate improvement.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Use the shared fifteen successes to construct the paired table.

Compare with the solution

B gains three cases that A fails and loses one case that A passes. One case fails under both. Net improvement is (3−1)/20=0.10, or ten percentage points. This paired binary criterion is not FID and still needs a fixed evaluation and uncertainty protocol.

Take it with you

  • Source-group splits and preprocessing revisions define the generalization test.
  • FID and other metrics require a matched complete evaluation pipeline.
  • Freeze sampling and selection protocols before attributing gains to training.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.