tl;dr My graduate student (Tue Do) has developed DIME, an efficient membership test based on the theory of the exact optimal denoiser for diffusion models. DIME gives some impressive results: across a range of datasets, DIME consistently outperforms prior attacks at comparable or substantially lower query cost, improving certain metrics by up to 3×; remarkably, its two-query variant can outperform existing 30-query baselines. Check it out!
Diffusion models have become one of the dominant approaches to generative modeling because they can produce remarkably high-quality outputs while remaining relatively stable to train. They underpin many modern image generation and editing systems (e.g., Stable Diffusion, Midjourney, DALL-E, etc.), and related diffusion techniques have also been applied to video, audio, scientific data, inverse problems, and other modalities. Their success comes from a simple but powerful training objective: a model learns to reverse a gradual noising process, transforming corrupted data back toward samples that resemble the training distribution. This denoising formulation scales well to high-dimensional data and gives practitioners considerable control over generation, including conditioning on text, class labels, or other signals.
The widespread use of diffusion models also makes it important to understand what they learn about their training data, not just how good their generated samples look. State-of-the-art models are often trained on enormous collections of images gathered from the web or from sensitive domains such as medicine, biometrics, and personal photography. A model that behaves well at generation may nevertheless retain information about particular training examples. This raises questions about privacy, memorization, copyright, data provenance, and whether a person’s data has actually been removed after a deletion or machine-unlearning request. Membership inference, the problem of determining whether a particular record was used during training, is therefore a useful way to probe the boundary between learning general statistical structure and retaining example-specific information.
Diffusion models are especially interesting from a privacy perspective because their core denoising task is closely related to reconstruction. Given a corrupted input, the model repeatedly estimates information needed to move that input back toward likely clean data. If the model has learned unusually detailed information about a particular training example, its denoising behavior near that example may differ from its behavior near unseen data. Studying these differences helps us understand where memorization lives inside a diffusion model and how it can be detected. This is valuable both offensively, for developing stronger privacy audits, and defensively, for evaluating whether techniques such as differential privacy, deduplication, or regularization actually prevent training examples from leaving detectable traces.
There’s the diffusion model training question: Given a noisy version of an image, what noise was added, or equivalently, what clean image should the model reconstruct? And the membership inference question: Given a candidate image, was this image part of the model’s training set?
In DIME, we exploit the fact that these two questions are, in fact, tightly connected. A perfectly trained diffusion denoiser does not merely learn a generic rule for “what noise looks like.” On a finite training set, its optimal prediction can be written exactly as a posterior-weighted combination of the training examples. The model is therefore carrying out a kind of soft retrieval: given a noisy input, it asks which training points could plausibly have generated it and blends those points according to their posterior responsibilities.
That observation turns membership inference from a search for ad hoc statistics into a derivation. The model’s implicit reconstruction of a candidate has an exact squared error, and that error splits into two terms:
- Reconstruction bias: how far the local posterior mean is from the candidate; and
- Local crowding: how dispersed the plausible training points are around that mean.
The first signal resembles what earlier norm and reconstruction-based attacks measure. The second is the new ingredient: a non-member can be reconstructed surprisingly well simply because it lies near the center of several training points. Bias alone can therefore be fooled by local geometry, while crowding exposes the ambiguity.
Both signals can be estimated from forward queries to the denoising network. They share the same randomly perturbed queries, so the attack needs only model evaluations and its cheapest setting uses just two total queries. In experiments on CIFAR-10, CIFAR-100, STL10-U, CelebA, and ImageNet, DIME improves the low-false-positive detection rate substantially, sometimes beating 30-query baselines with only two queries. We also test the attack against differentially private mechanisms and finds that differentially private training drives DIME and the evaluated baselines back toward chance.
A minimal diffusion refresher
Let the finite training set be
At timestep , the forward process forms
The noise-prediction network is trained by mean squared error:
For squared loss, the population-optimal prediction is a conditional expectation. Here, because the data distribution is the empirical distribution over a finite training set, that conditional expectation can be calculated explicitly.
The first main result: the exact finite-set optimal denoiser
For a query , define the unnormalized compatibility of training point
by
and normalize these scores into responsibilities
We prove that the MSE-optimal denoiser is
This formula has a simple Bayesian derivation. If training point generated
, the corresponding noise would be
Conditioned on seeing , the posterior probability that the latent training index was
is precisely
. The optimal squared-loss estimate is therefore
which expands to the boxed expression.
The denoiser is a soft decoder over the training set
The weighted point
is the model’s implicit reconstruction of the clean training example that could have produced . Training examples close to
receive exponentially larger responsibility. The noise scale
acts like a temperature:
- at high noise, many records can plausibly explain the query, so responsibilities are diffuse;
- at low noise, the posterior sharpens around the closest training record.
As , the soft responsibilities converge almost everywhere to the indicator of the nearest training point’s Voronoi cell. In other words, the ideal denoiser approaches a hard nearest-neighbor decoder.
This explains why membership leakage is strongest in the low-noise regime. For a member , the nearest point is the record itself, so the posterior can concentrate on
. For a non-member, the best the empirical model can do is retrieve or blend nearby training points.
Why reconstruction bias alone is not enough
The obvious attack would compare the model’s implicit reconstruction with the candidate. A member should reconstruct accurately; a non-member should not. This intuition is useful but incomplete.

A non-member can have small reconstruction bias when it lies near the mean of several training points; the dispersion of those points (the crowding term) distinguishes it from an isolated member.
We separate three cases.
Case A: isolated member
The candidate is itself a training point and has no close competitors. Responsibility concentrates on the candidate. The posterior mean is close to , and the responsible neighborhood has almost no spread. Both bias and crowding are small.
Case B: isolated non-member
The closest training point or cluster lies away from the candidate. The posterior mean is displaced from . Bias is large, even if the nearby training points are tightly grouped.
Case C: crowded non-member
The candidate lies near the center of several training points. Their weighted mean can accidentally be close to , producing small bias. But responsibility is divided among separated records, so the local variance is large.
The one-dimensional example and
makes the blind spot exact. If the two records have equal responsibility, the posterior mean is zero, so reconstruction bias is zero even though zero is not in the training set. The variance is one, correctly signaling ambiguity.
What the score distributions and timestep plots show

Member and held-out DIME score distributions are visibly separated across the five checkpoints; dashed lines show calibrated thresholds.
The distribution plots make the aggregate metrics easier to interpret. DIME is not succeeding because of a handful of extreme outliers; the member and non-member score distributions shift relative to one another across every tested checkpoint. The amount of overlap explains why STL10-U permits near-total detection while CelebA remains harder.

The four smaller DDPM checkpoints remain effective across a broad timestep range, whereas ImageNet Guided Diffusion is most vulnerable at early timesteps.
The ideal denoiser theory predicts stronger concentration at lower noise. Guided Diffusion follows that prediction clearly: attack performance is highest at early timesteps and declines as noise increases. The smaller DDPM checkpoints exhibit a broad plateau instead. This suggests that the roughly 550M-parameter Guided Diffusion model may approximate the ideal denoiser more faithfully than the roughly 35M-parameter DDPM models. This is a plausible interpretation of the observed scale difference, not a formal proof that parameter count is the cause.
An additional practical lesson is that exact timestep selection may not be fragile for the smaller checkpoints. A broad plateau gives an attacker or auditor some tolerance to imperfect calibration.
Synthetic experiments isolate the role of crowding
The real-network experiments inevitably mix two phenomena:
- properties of the exact finite-set optimal denoiser; and
- approximation and optimization behavior of the trained neural network.
The synthetic appendix removes the second factor by evaluating the closed-form denoiser directly on small, known training sets.

The crowded non-member can have relatively small bias, but its variance rises much earlier and separates it from the member.
The left panel shows why a bias-only attack can fail: the crowded non-member’s posterior mean can remain close to the candidate. The middle panel shows the missing signal: responsibility spread creates a nonzero variance well before the member’s variance grows. Their sum in the right panel recovers the intended reconstruction error.
Further synthetic experiments compare DIME with SimA-MC while varying dataset size, noise level, and query count. They show that the extra crowding signal makes DIME’s membership performance decay more slowly as noise increases. These experiments are diagnostic rather than a substitute for the neural-network results, but they confirm that the claimed effect exists in the exact theoretical object itself.
Conclusion
DIME’s central insight can be stated as follows:
A finite-set diffusion denoiser implicitly performs soft retrieval over its training examples, and the error of that retrieval contains both a reconstruction signal and a geometric crowding signal.
We turn this insight into an exact formula, decompose the corresponding error, link hidden local covariance to the denoiser’s Jacobian, and estimate both terms with forward queries. The resulting attack is not merely more accurate in aggregate; its largest gains occur at the low-false-positive operating point that matters most for credible membership decisions. It also survives a dramatic jump from small unconditional DDPMs to a large class-conditional ImageNet model.
Moreover, the defenses we apply are reassuring: differential privacy suppresses not only earlier heuristic attacks but also the stronger signal produced by the ideal denoiser derivation. The broader message is therefore balanced: Diffusion models can leak membership through richer local geometry than prior attacks measured, but formal stability remains a meaningful line of defense.
DIME provides both a practical attack and a new lens for future work: privacy leakage in diffusion models can be studied as the geometry of a soft decoder over a finite codebook.
References
Tue Do and Daniel Alabi, “DIME: Query-Efficient Framework for Membership Inference on Diffusion Models”, arXiv:2608.22824, 2026.
