Home Knowledge Base Ancestral Sampling

Ancestral Sampling is the standard stochastic sampling procedure for diffusion probabilistic models that generates samples by iteratively applying the learned reverse transition kernel p_θ(x_{t-1}|x_t) from pure noise x_T to clean data x_0, faithfully following the Markov chain defined by the trained reverse diffusion process with noise injection at each step. This is the original DDPM sampling method that directly implements the learned generative Markov chain.

Why Ancestral Sampling Matters in AI/ML: Ancestral sampling is the most faithful implementation of the diffusion model's learned distribution, providing the highest sample diversity and most accurate representation of the model's learned probability distribution at the cost of requiring many sampling steps.

Reverse Markov chain — Each step samples x_{t-1} ~ N(μ_θ(x_t, t), σ_t²I) where μ_θ is the learned mean and σ_t is the noise schedule-dependent variance; the noise injection at each step ensures the sampling process matches the trained reverse process • Stochastic diversity — Unlike deterministic DDIM (which maps each noise to a unique output), ancestral sampling produces different outputs from the same initial noise due to independent noise injection at each step, providing maximum sample diversity • Full step requirement — Ancestral sampling typically requires all T steps (e.g., 1000) for high-quality results because skipping steps in the Markov chain violates the trained transition assumptions, leading to quality degradation • Variance schedule — The noise σ_t² injected at each step can be set to σ_t² = β_t (posterior variance, original DDPM) or σ_t² = β̃_t = (1-ᾱ_{t-1})/(1-ᾱ_t)·β_t (posterior mean variance); the choice affects sample quality and diversity • Connection to SDE — Ancestral sampling corresponds to numerically solving the reverse-time SDE with the Euler-Maruyama method, where the noise injection term σ_t·z represents the diffusion coefficient of the reverse SDE

PropertyAncestral (DDPM)DDIM (Deterministic)DDIM (Stochastic)
Noise InjectionYes (each step)No (σ=0)Partial (0<σ<σ_max)
Steps Required~100010-5010-50
DiversityMaximumDeterministicIntermediate
ReproducibilityStochasticExact (given z_T)Stochastic
Quality (full steps)BestEqualEqual
Quality (few steps)PoorGoodVariable
Latent InversionNot possibleExactApproximate

Ancestral sampling is the canonical inference procedure for diffusion probabilistic models, faithfully implementing the learned reverse Markov chain with full stochastic noise injection to produce maximum-diversity samples from the model's trained distribution, serving as the theoretical gold standard against which all accelerated and deterministic sampling methods are evaluated.

ancestral samplinggenerative models

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.