Sampling is the computational bottleneck of diffusion models. This chapter covers the full landscape: from the original ancestral sampling of DDPM, through DDIM's deterministic shortcut and DPM-Solver's high-order ODE integration, to distillation and consistency approaches that collapse hundreds of steps into one or a few. We conclude with classifier-free guidance, the dominant technique for steering sample quality during inference.
Training a diffusion model is only half the story. Once we have a learned score function or equivalently a noise predictor , we must sample from the model---starting from pure noise and iteratively denoising until we reach a clean sample . The original DDPM sampler requires sequential neural network evaluations, making generation painfully slow compared to GANs or VAEs that produce samples in a single forward pass.
This has spurred a rich line of research on sampling acceleration. The key insight is that the reverse process defines a probability flow ODE (ordinary differential equation) whose trajectories share the same marginal distributions as the stochastic reverse SDE. We can integrate this ODE with fewer, larger steps using sophisticated numerical methods. Beyond better ODE solvers, distillation methods train a student model to match the teacher's multi-step output in fewer steps, and consistency models learn to map any point on the ODE trajectory directly to its endpoint .
Orthogonal to speed, classifier-free guidance is the standard technique for trading diversity for quality during sampling. By interpolating between conditional and unconditional score estimates, guidance amplifies the influence of the conditioning signal (e.g., a text prompt), producing sharper, more coherent samples at the cost of reduced diversity.
This chapter covers:
Click any topic to jump in
DDPM's original 1000-step sampling — faithful to the learned reverse process.
Skip-step and higher-order methods
Deterministic sampling with stride — skip steps via non-Markovian process.
Higher-order ODE solvers — 10-20 steps matching 1000-step quality.
Distillation and one-step
Student matches 2 teacher steps in 1 — halving down to 4-8 steps.
One-step generation — mapping any noisy input to x₀ directly.
Amplifying conditional signal during sampling — trading diversity for quality.
This chapter is part of PixelBank Premium. Create a free account, then upgrade to read the full lesson — concepts, walkthroughs, and exercises.