Paper commentary
Diffusion Posterior Sampling is Computationally Intractable
Posterior sampling for diffusion models cannot be done efficiently in general
- Problem Diffusion models sample well unconditionally, but posterior sampling for tasks like inpainting has no known fast method that converges to the correct distribution. Rejection sampling is correct but takes time exponential in the number of measurements.
- Method The authors hide a one-way function's output in the phases of discretized Gaussians. A posterior sampler then has to invert that function, so a fast sampler would give a fast inverter.
- Results Under the assumption that one-way functions exist, posterior sampling takes superpolynomial time on some well-modeled distributions. Rejection sampling is close to optimal if some one-way function needs exponential time to invert.
Why posterior sampling is harder than prior sampling
Diffusion models represent a data distribution through its smoothed scores and sample from it with an SDE or an ODE. Those samplers run in polynomial time and tolerate L2 error in the estimated smoothed score, so unconditional sampling is cheap. Empirical risk minimization of the score matching objective gives bounded L2 error with polynomial training samples, which leads to accurate samples.
The practical use is different: given a noisy linear measurement y = Ax + η, one wants samples from the posterior p(x | y). Here A is an m by d matrix with m < d, and the noise η is Gaussian with scale β.
Several recent methods approximate this posterior, but each one fails on some inputs. An exact route exists: rejection sampling from the unconditional samples is very accurate under fairly minimal assumptions. Its catch is that every measurement must match, which takes time exponential in m. So the authors ask whether a fast and robust posterior sampler exists when only approximate smoothed scores are available.
The authors call a distribution well-modeled when a polynomial-size neural network approximates its smoothed scores to polynomial precision. Two distributions are (τ, δ) close when they can be coupled so that Pr[∥x − x̂∥ > τ] < δ. An unconditional sampler is one whose samples are (τ, δ) close to the true distribution. For an O(C)-well-modeled distribution, the discretized reverse diffusion process gives a (1/d^C, 1/d^C) unconditional sampler in poly(d) time.
Rejection sampling over these unconditional samples gives a (1/d^C, δ) posterior sampler, but its running time is exponential in m.
Hiding f(s) in the phase of a Gaussian
The first idea is to draw a seed s uniformly and output the pair (s, f(s)), treating f(s) as the observation. Unconditional sampling is easy, but conditioning on f(s) forces a posterior sampler to find a preimage, which is hard for a one-way function. The catch is that for smoothing levels between 1 and the square root of d, the smoothed score can draw contributions from many different pairs (s, f(s)).
So it may not be clear that the smoothed scores can be computed efficiently at these levels. At very small smoothing levels, the scores stay easy, because the mixture components barely overlap.
To fix this, the authors move f(s) out of the Gaussian positions and into the phase of a discretized Gaussian. At large smoothing levels, a discretized Gaussian looks like an undiscretized one, so the phase disappears. Thus the distribution behaves like a product distribution at large smoothing, and its scores are easy to compute. For a bit b in {-1, 1}, the density ψ_b is a standard Gaussian restricted to multiples of a width ε, with phase 0 or ε/2 chosen by b.

Figure 1 : The distribution of each coordinate in gs, has independent coordinates. For any seed s ∈ {±1} d , the first d bits are normal distributions whose mean is specified by si , and the last d ′ bits are a discretized standard normal where the discretization is specified by f(s)j . The full distribution g is a mixture over all seeds s of gs.
Original paper · CC BY 4.0 · Shivam Gupta, Ajil Jalal, Aditya Parulekar, Eric Price, Zhiyang Xun · Diffusion Posterior Sampling is Computationally Intractable · Original paper figure · Extracted the figure area from page 8 of the original PDF.Given a seed s, the product distribution g_s has first d coordinates that are Gaussians with unit scale and means R·s_i. Its last d′ coordinates are discretized Gaussians whose phase is set by f(s)_i. The unconditional distribution g is the uniform mixture of g_s over all seeds, with d′ = O(d). For the measurement, the authors rescale g by R so that the covariance norm stays bounded, giving the scaled distribution g̃.
The measurement keeps only the last d′ coordinates, each with Gaussian noise of variance β², so A stacks zeros on top of an identity.
Why a posterior sampler would invert f
The reduction starts from a target z in {±1}^d′ and tries to recover f^{-1}(z) using the posterior sampler for the scaled distribution. Each z_i is drawn from the phase-encoded distribution ψ_{z_i} convolved with N(0, β²), and the vector is fed into the sampler as the observation. The sampler outputs x̂, and the inverter keeps the first d coordinates of x̂, rounding each entry to the nearest ±1.
Over a random seed s, this inverter fails with probability at most 3/4, which is the guarantee the lemma states. The runtime is the sampler's runtime T plus O(d), so a slow sampler directly gives a slow inverter.
The argument rests on β being much smaller than ε, so the two phase encodings stay distinguishable after the β² noise is added. Hence, with high probability, each observed coordinate of z lands within ε/4 of the correct discretization. A posterior sample then encodes some pair (s, f(s)) with s = f^{-1}(z), with high probability. The first d coordinates of that encoding are the bits of f^{-1}(z) smoothed by a Gaussian of variance 1/R².
Because R is much larger than 1, rounding those coordinates to ±1 recovers f^{-1}(z) with high probability.
Under the assumption that one-way functions exist, posterior sampling on this instance then takes superpolynomial time. The one-way function maps {0,1}^n to {0,1}^n′ for an unconstrained n′, while the reduction needs a map from {0,1}^(d−m) to {0,1}^m. Standard arguments close that gap, and Section G gives the details.
Is the hard instance still easy to model?
The question here is whether a small ReLU network can represent the smoothed scores of the lower bound distribution, so the hardness isn't just a representation problem. The paper notes that for smoothing levels 1 much less than sigma much less than the square root of d, the smoothed score can draw contributions from many different (s, f(s)) pairs.
For smoothing levels sigma much less than 1 over the square root of log d, the smoothed scores are efficiently computable with high accuracy.
The argument splits by smoothing level and handles each regime separately. For large sigma, the distribution is close to a mixture of Gaussians on the vertices of a hypercube, which is a product distribution. For small sigma, the score at a point is close to the score of the product distribution for the orthant that point lies in. The building block is a piecewise-linear approximation of the one-dimensional smoothed score in L2.
Because the score varies little over windows of size sigma, a piecewise-constant approximation works, and linear interpolation makes it piecewise linear. The approximation can be unbounded and have too many pieces, so the authors fix both using the tails of the smoothed distribution. Such piecewise-linear functions can be represented by ReLU networks with poly(m2/(gamma sigma)) parameters.
For large smoothing, the two phases look alike once convolved with a Gaussian. A Fourier argument shows that the smoothed versions of psi_1 and psi_-1 are polynomially close to each other for sigma much greater than epsilon times the square root of log d. This means the hardness doesn't come only from representing the scores. For small smoothing, the authors approximate the density by the component whose orthant matches the point, since the other components are negligible there.
A small gadget identifies the orthant, which completes the ReLU construction for the score.
Rejection sampling: correct, but exponential in m
Rejection sampling draws x from the unconditional sampler and keeps it with probability q, which is exp(-||Ax - y||^2 / (2β^2)). With a perfect unconditional sampler, the accepted x follows p(x | y), because p(x | y) is proportional to p(y | Ax) p(x). The authors use this argument to show that each round outputs x with the right density, and that the rounds are independent.
The cost depends on the acceptance probability per round, which the authors bound for linear measurements y = Ax + η. For well-modeled distributions, with arbitrarily high probability over y, the probability that ||Ax - y|| is at most O(β√m) is at least Θ(β)^m. The authors cover the m-dimensional ball of radius C√m with N = (O(1)/β)^m balls of radius β, so the algorithm needs about (O(1)/β)^m rounds.
Theorem 1.7 adds a poly(d) factor and states the running time as poly(d)(O(1)/(β√δ))^m, under β > 1/d^C and δ > 1/d^C.
In practice, the sampler is the diffusion process, which returns approximate samples x̂ rather than exact samples of x. When that distance is at most o(β/√m), the log ratio of p(y | x̂) and p(y | x) is at most o(1), so acceptance barely changes. The returned sample x̂ is also within 1/d^{2C} of x, so the output stays close to the exact posterior.
If some one-way function needs exponential time to invert, the lower bound instance takes 2^{Ω(m)} time for posterior sampling. Rejection sampling takes 2^{O(m log log d)} poly(d) time on that instance, so it is close to optimal. Rejection sampling is accurate with fairly minimal assumptions, but it's slow because it must match every measurement.
Where the results stop
The lower bound instance is built from a one-way function, and the authors don't describe it as a nice distribution. Because of that, it doesn't explain why practical posterior sampling succeeds on natural images. The authors argue that a positive theory of posterior sampling must invoke distributional assumptions on the data. They leave open which distributional properties would make posterior sampling possible.
The superpolynomial lower bound needs only that one-way functions exist, as stated in Theorem 1.8. The 2^{Ω(m)} bound needs one-way functions that require 2^{Ω(m)} time to invert, which is a stronger assumption. The shallow-network variant requires that f itself be computable by a shallow depth network. The upper bound in Theorem 1.7 covers well-modeled distributions with β > 1/d^C and δ > 1/d^C.
Its running time is poly(d)(O(1)/(β√δ))^m, so it grows exponentially in m. Under the exponential assumption, rejection sampling takes 2^{O(m log log d)} poly(d) time, so the authors call it nearly optimal up to the log log d factor.
The authors read the same lower bound as applying to particle filtering methods. Those methods guarantee correct sampling only as the number of particles goes to ∞. Under the exponential assumption, particle filtering requires exponentially many particles for convergence.
Paper info
- Authors
- Shivam Gupta, Ajil Jalal, Aditya Parulekar, Eric Price, Zhiyang Xun
- Venue
- arXiv · Preprint
- First published
- 2024-2-20
- Added
- 2026-10-30
- Updated
- 2025-11-9
- Version
- v2
- arXiv
- 2402.12727
- Category
- cs.LG · cs.AI · math.ST · stat.ML
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Diffusion models are a remarkably effective way of learning and sampling from a distribution $p(x)$. In posterior sampling, one is also given a measurement model $p(y \mid x)$ and a measurement $y$, and would like to sample from $p(x \mid y)$. Posterior sampling is useful for tasks such as inpainting, super-resolution, and MRI reconstruction, so a number of recent works have given algorithms to heuristically approximate it; but none are known to converge to the correct distribution in polynomial time. In this paper we show that posterior sampling is computationally intractable: under the most basic assumption in cryptography -- that one-way functions exist -- there are instances for which every algorithm takes superpolynomial time, even though unconditional sampling is provably fast. We also show that the exponential-time rejection sampling algorithm is essentially optimal under the stronger plausible assumption that there are one-way functions that take exponential time to invert.
Quote from the paper
Shivam Gupta, Ajil Jalal, Aditya Parulekar, Eric Price, Zhiyang Xun (2024). Diffusion Posterior Sampling is Computationally Intractable. arXiv:2402.12727v2. https://arxiv.org/abs/2402.12727v2
BibTeX
@misc{gupta2024diffusion,
title = {{Diffusion Posterior Sampling is Computationally Intractable}},
author = {Shivam Gupta and Ajil Jalal and Aditya Parulekar and Eric Price and Zhiyang Xun},
year = {2024},
eprint = {2402.12727},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2402.12727v2}
}