NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Generative Uncertainty in Diffusion Models

Metod Jazbec, Eliot Wong-Toi, Guoxuan Xia, Dan Zhang, Eric Nalisnick, Stephan Mandt

TL;DR

Even state-of-the-art diffusion models occasionally produce distorted or artifact-heavy images. This paper introduces a practical Bayesian framework to compute generative uncertainty for individual samples by combining a post-hoc last-layer Laplace approximation with a new semantic likelihood evaluated in CLIP feature space. Filtering out high-uncertainty samples significantly improves image generation metrics (e.g., FID) and outclasses prior pixel-space uncertainty methods with minimal sampling overhead.

What Problem Does This Paper Address?

While modern diffusion and flow-matching models generate remarkably realistic images on average, individual generations can still suffer from glaring artifacts or fail to match conditional prompts. Manually inspecting and filtering synthetic outputs is expensive and impractical for automated pipelines.

In predictive modeling (like classification or regression), Bayesian neural networks provide well-defined predictive uncertainty to flag unreliable predictions. However, extending these principles to high-dimensional generative models has been difficult:

  1. Computational cost: Running Bayesian inference or deep ensembles on billion-parameter diffusion backbones is prohibitively slow.
  2. The "pixel trap": Evaluating uncertainty directly in pixel space makes methods overly sensitive to trivial background noise and textures rather than actual semantic defects.

Methods

The authors formalize generative uncertainty as the entropy of the posterior predictive distribution over an initial noise vector $z$:

  1. Last-Layer Laplace Approximation: Rather than retraining models or tracking variance step-by-step during reverse diffusion, the authors apply a diagonal Laplace approximation post-hoc to just the final layer ($<1\%$ of parameters). This allows them to sample alternative model parameters $\theta_m \sim q(\theta | \mathcal{D})$ cheaply without changing the standard sampling loop.
  2. Semantic Likelihood: Instead of evaluating output variance in high-dimensional pixel space $\mathcal{X}$, generated images are mapped to a latent semantic representation using a frozen encoder $c_\phi$ (such as CLIP): $$p(x \mid g_\theta(z); \phi) = \mathcal{N}\left(e(x) \mid c_\phi(g_\theta(z)), \sigma^2 I\right)$$ Generative uncertainty $u(z)$ is then defined as the entropy of this moment-matched Gaussian distribution across $M$ Monte Carlo parameter draws.

  3. Sampling Acceleration: To avoid multiplying generation time by $M$, the authors demonstrate that evaluating uncertainty with $M = 1$ and a reduced number of diffusion steps (e.g., $T = 25$ instead of $50$) preserves filtering performance while adding as few as 25 additional network function evaluations (NFEs).

Datasets

  • 2D Synthetic Gaussian Modes: A 25-mode toy dataset used to visually demonstrate that uncertainty filtering removes "hallucinated" samples occurring between true data clusters.
  • ImageNet ($128 \times 128$ and $256 \times 256$): Used for primary benchmarking with class-conditional models (Ablated Diffusion Model / ADM, and UViT).
  • Existing vs. New Benchmarks: No new datasets were introduced. The paper uses established ImageNet generation benchmarks to evaluate Fréchet Inception Distance (FID), Precision, and Recall.

Key Insights and Ideas

  • Pixels lie, semantic latents don't: Prior Bayesian methods (e.g., BayesDiff) track pixel-level variance, flagging clean images with complex, high-frequency backgrounds as "uncertain." Evaluating variance in CLIP latent space isolates structural and semantic coherence from benign pixel noise.
  • Simplicity beats complex variance propagation: Unlike prior work that resamples weights at every denoising timestep and propagates variance through ODE/SDE solvers, simply sampling $M$ model weight configurations and generating parallel runs is both truer to classic Bayesian principles and empirically superior.
  • Uncertainty complements distance-to-manifold metrics: Non-Bayesian sample-selection metrics (such as realism and rarity scores) measure distance to reference training data, whereas generative uncertainty captures epistemic model doubt. Because their correlation is weak (Spearman $\rho < 0.4$), ensembling generative uncertainty with realism scores yields better sample filtering than either alone.

Key Results

  • Image Filtering Performance:
  • On ImageNet $256 \times 256$ with UViT, selecting the top 10K least uncertain samples (out of 12K) achieves an FID of 7.89, clearly outperforming random subset selection (9.45), BayesDiff (9.16), and pixel-wise aleatoric uncertainty (9.20).
  • Filtering similarly improves precision (sample quality/fidelity) across both UViT and ADM architectures.
  • Sampling Efficiency:
  • On ADM ($128 \times 128$), using just $M = 1$ and $T = 25$ diffusion steps for the uncertainty probe achieves an FID of 10.36 (vs. 11.31 random baseline), reducing the computational overhead by $10\times$ compared to the unoptimized setting.
  • Generality:
  • Applying the method to a latent flow matching model with a DiT backbone improved filtered FID from 11.80 (random baseline) to 10.48.

Limitations and Future Work

  • Reliance on Pretrained Vision Encoders: The framework depends on a pretrained feature extractor (e.g., CLIP) to compute the semantic likelihood, making it difficult to apply off-the-shelf to non-visual modalities like molecular or genomic diffusion.
  • Recall Trade-off: Uncertainty filtering inherently drops recall (diversity), as harder or under-represented ImageNet classes naturally carry higher model uncertainty.
  • Approximation Quality: The framework currently relies on a diagonal last-layer Laplace approximation. Exploring multi-layer Laplace approximations or structured covariance could further refine uncertainty calibration.

Summary updated

BibTeX
@inproceedings{jazbec2025generative,
  author = {Metod Jazbec and Eliot Wong-Toi and Guoxuan Xia and Dan Zhang and Eric Nalisnick and Stephan Mandt},
  title = {{Generative Uncertainty in Diffusion Models}},
  booktitle = {AABI Workshop Track},
  year = {2025},
  url = {https://openreview.net/forum?id=9pSllpDvFO},
}

Loading related content...

Figure