Part of the generative visual computing notes.
Sampling cost
The denoising network usually accounts for much of the generation cost. Count network evaluations as well as integration steps. A method that uses two evaluations per step may be more expensive than another method with more steps.
DDIM starts from an estimate of the clean sample:
For a deterministic update to an earlier time , one form is
The same denoiser can be used with different time grids. Fewer evaluations reduce cost but can increase numerical error. Deterministic sampling still produces varied outputs when starting seeds vary.
In high dimensions, averaging Gaussian seeds changes their distribution. If two independent standard-normal vectors are averaged, the covariance becomes . Their average lies closer to the origin on average and is not another standard-normal draw.
Flow matching
Use for noise and for data. A straight conditional path is
Flow matching regresses a velocity field on the known conditional velocity. Squared error selects . Individual paths can be straight while the learned marginal field produces curved trajectories. The pairing of noise and data affects the conditional training problem.
Distillation takes a different approach to reducing cost. It trains a student to approximate a longer teacher computation. It requires training work rather than merely changing the inference-time grid.
Conditioning and guidance
Conditional training supplies a label, text description, or other observation to the denoiser. Classifier guidance uses
The classifier must be meaningful at the current noise level. A clean-image classifier is not automatically suitable for highly corrupted inputs.
Classifier-free guidance trains conditional and null-condition predictions, then combines them. Using a convention where is the ordinary conditional prediction,
For , the null prediction has a negative coefficient. This is extrapolation, not a convex average. Stronger guidance can change both prompt agreement and sample diversity.
Architecture
Latent diffusion performs denoising in a compressed representation. This saves computation, but the decoder limits what can be reconstructed. If fine text is already lost in an autoencoder reconstruction, improving the denoiser alone will not restore that missing representation capacity.
Transformer denoisers turn spatial regions into tokens. With a latent grid of height , width , and square patch size , the token count is when the dimensions divide evenly. Changing patch size therefore changes attention cost as well as spatial detail.
Text describes content, while spatial conditions such as depth or pose constrain layout. Showing that a model responds to a condition is weaker than showing that it follows that condition accurately.
Evaluation
The exact denoiser of a finite empirical distribution need not equal the population denoiser. For data points under additive Gaussian noise, the empirical posterior weights are proportional to
The corresponding clean estimate is the weighted average of the training points. At small noise levels, nearby examples can dominate. Architectural biases and regularization may instead favor reusable local structure, but that claim needs independent evidence.
A small denoising generalization gap is insufficient if both training and held-out losses are poor. Report the absolute losses too. Separate model error from numerical sampling error by comparing samplers with the learned model held fixed.
FID compares the first two moments of image features. It is a set-level statistic, not a complete description of visual quality or replication. A nearest-neighbor audit depends on its search dataset, representation, and threshold. Calibrate it on known transformed copies and unrelated controls before interpreting matches.
For controlled comparisons, keep prompts, seeds, datasets, and evaluation settings aligned. Change one factor at a time when attributing an improvement to a mechanism.
Worked examples: guidance and patch size
Suppose the unconditional noise prediction is and the conditional prediction is . Using with gives . Guidance extrapolates beyond the conditional estimate. It is not a weighted average with weights restricted to zero through one, which helps explain why very strong guidance can distort samples.
For a latent grid, patches of width two produce 1,024 tokens. Patches of width four produce 256. The dense attention matrix then has one sixteenth as many entries. This comparison concerns attention cost; it does not imply that the entire model becomes sixteen times faster.
Further reading
Denoising Diffusion Implicit Models explains an alternative sampling process. Flow Matching for Generative Modeling develops velocity-field training along probability paths. Compare what each model predicts and how the numerical solver uses that prediction.