Analyzing and Guiding Zero-Shot Posterior Sampling in Diffusion Models

Roi Benita, Michael Elad, Joseph KeshetNeurIPS 2026

TL;DR

When using pretrained diffusion models to reconstruct clean images from blurry or incomplete measurements—without any task-specific retraining—researchers usually rely on trial-and-error guesswork to balance what the model knows with what the sensor actually measured. By temporarily assuming the world is Gaussian and looking at the problem in the frequency domain, the authors turn this black-box guessing game into exact, closed-form equations. The result is a principled recipe for tuning diffusion guidance weights that works remarkably well on real-world photos and medical scans.

What Problem Does This Paper Address?

Recovering a clean signal from noisy, incomplete measurements—known as a linear inverse problem—is everywhere, from deblurring astrophotography to speeding up MRI scans. Recently, diffusion models have offered a clever "zero-shot" solution: take a model trained purely to generate clean images (the prior), and gently nudge its step-by-step denoising trajectory so the output matches your degraded observation (the likelihood).

The catch? Knowing how hard to nudge at each step. Push too softly, and the model hallucinates a gorgeous image that ignores your actual data (or takes thousands of steps to converge). Push too hard, and the generation becomes unstable and derails. Until now, existing algorithms like Diffusion Posterior Sampling (DPS), $\Pi$GDM, and DiffPIR have chosen these step-by-step guidance weights manually or via ad-hoc rules of thumb. There has been no unified mathematical framework to design these schedules optimally.

Methods

To crack open the black box of iterative diffusion sampling, the authors make two strategic simplifying assumptions:

  1. The clean data follows a Gaussian prior distribution.
  2. Both the data's covariance and the degradation operator (like a blur kernel) are shift-invariant.

Why? Because shift-invariant operations become simple diagonal matrices in the Fourier (spectral) domain. Instead of tracking millions of entangled pixel interactions across dozens of neural network steps, the entire multi-step reverse diffusion process decouples into $d$ independent scalar equations—essentially acting like classical signal-processing transfer functions!

Under this lens, the authors do two novel things:

  • Closed-Form Samplers & Ideal Reference: They derive exact output distributions for popular training-free methods (DPS, $\Pi$GDM, DiffPIR) and compare them against a newly derived exact posterior optimal denoiser (which acts as a theoretical gold standard).
  • Optimal Weight Design: They formulate an optimization problem that finds the exact guidance weights minimizing the averaged Wasserstein-2 distance between the algorithm's output distribution and the true mathematical posterior. Even when moving back to real-world datasets with deep neural denoisers, you can simply fit a Gaussian to the dataset's spectrum once, solve for the optimal weights offline, and plug them directly into inference.

Datasets

The authors evaluate their framework across both synthetic and real-world regimes (no new benchmarks are introduced):

  • Synthetic Gaussian Data: 50-dimensional signals with circulant covariance, degraded by low-pass filtering and additive noise.
  • FFHQ ($256\times256$) & ImageNet ($256\times256$): Standard natural image datasets used to test deblurring/low-pass filtering and non-shift-invariant tasks like random and box inpainting.
  • fastMRI ($320\times320$): Single-coil knee MRI scans used to test both low-pass filtering and accelerated MRI acquisition (horizontal frequency subsampling).

Key Insights and Ideas

  • Standard heuristics can be completely backwards: In DPS, the standard heuristic scales guidance inversely with measurement error—meaning weights stay tiny early on and grow slightly at the end. When optimized spectrally on real images (FFHQ), the math demands a totally different structure: much larger weights that peak early in the reverse trajectory (around the first 5–10% of steps) to lock in observation fidelity, before tapering off so the prior can refine details.
Figure 2: Comparison of spectral recommendations on the FFHQ dataset, with a magnified y-axis view of the DPS heuristics. Results are shown for diffusion steps S ∈{30, 70, 100, 150}.
  • Single-step optimality $\neq$ finite-step optimality: Surprisingly, in synthetic experiments with very few diffusion steps, spectrally tuned DiffPIR slightly outperforms sampling with the exact single-step posterior optimal denoiser. Why? Because an ideal denoiser is only locally optimal for a single step, whereas the authors' optimization looks ahead across the entire discretized finite-step trajectory.
  • Gaussian math generalizes to non-Gaussian reality: Even though natural faces and knee MRIs are decidedly not Gaussian—and tasks like box inpainting violate shift-invariance—weights derived from simple spectral statistics transfer seamlessly to deep U-Net denoisers.

Key Results

Across the board, spectral guidance weights outperform hand-tuned heuristics, achieving better signal fidelity and perceptual quality in fewer steps:

Wasserstein-2 distance to the true posterior on synthetic data, showing spectral methods consistently beating heuristic DPS choices across step counts.
  • FFHQ Reconstruction: Under low-pass degradation (retaining 10% of frequencies), spectral DPS at just 50 steps achieves 25.55 dB PSNR and 50.86 FID, decisively beating the best-tuned heuristic DPS even when heuristic DPS is given 200 steps (20.76 dB PSNR, 55.88 FID). At 200 steps, spectral DPS reaches 28.31 dB PSNR and 35.27 FID.
  • Accelerated MRI (fastMRI): Across 4x, 8x, and 12x acceleration factors, spectral recommendations consistently beat heuristic DPS. For instance, at 4x acceleration (200 steps), PSNR jumps from 20.57 dB (heuristic) to 24.44 dB (spectral).
  • Inpainting: Even when shift-invariance is broken (70% random pixel removal and $128\times128$ box masks), the spectral weights consistently beat heuristic DPS and frequently outperform recent methods like DAPS and DiffPIR.

Limitations and Future Work

The theoretical derivations lean heavily on two simplifying pillars: a Gaussian prior and shift-invariance (which allows the prior covariance and degradation operator to share the Fourier basis for joint diagonalization). While empirical tests show the resulting weights still work well on real images and spatially varying masks (like box inpainting), severe departures from shift-invariance can degrade the underlying approximation. For future work, the authors suggest extending this tractable analytical lens to richer priors—such as Gaussian mixture models—and finding new representations that remain mathematically solvable without requiring joint diagonalization in the Fourier domain.

Summary updated

Abstract

Recovering a signal from its degraded measurements is a long standing challenge in science and engineering. Recently, zero-shot diffusion based methods have been proposed for such inverse problems, offering a posterior sampling based solution that leverages prior knowledge. Such algorithms incorporate the observations through inference, often leaning on manual tuning and heuristics. In this work we propose a rigorous analysis of these approximate posterior samplers, relying on a Gaussianity assumption of the prior. Under this regime, we show that both sampling with the ideal posterior denoiser and diffusion-based reconstruction algorithms can be expressed in closed-form, enabling their thorough analysis and comparisons in the spectral domain. Building on these representations, we introduce a principled framework for parameter design, replacing heuristic selection strategies used to date. The proposed approach is method-agnostic and yields tailored parameter choices that jointly account for the characteristics of the prior, the degraded signal, and the diffusion dynamics. We show that our spectral recommendations differ structurally from standard heuristics and vary with the diffusion step size, resulting in a consistent balance between perceptual quality and signal fidelity.
BibTeX
@inproceedings{benita2026analyzing,
  author = {Roi Benita and Michael Elad and Joseph Keshet},
  title = {{Analyzing and Guiding Zero-Shot Posterior Sampling in Diffusion Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=uujn530GnO},
}
Figure