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

Detecting and Mitigating Memorization in Diffusion Models through Anisotropy of the Log-Probability

Rohan Asthana, Vasileios Belagiannis

Diffusion models like Stable Diffusion are renowned for their generative capabilities, but they suffer from a "copy-paste" problem known as memorization. Instead of generating novel content, they sometimes reproduce exact or near-exact replicas of training images, raising significant privacy, copyright, and evaluation concerns. Researchers have discovered that current methods for detecting this memorization are only looking at half the picture. By analyzing the anisotropy (directionality) of the model's internal probability landscape, the authors developed a new metric that is more accurate and 5x to 7x faster than previous state-of-the-art methods.

The Flaw in Existing Detection Methods

Existing detection methods typically evaluate the "norm" (magnitude) of the difference between a conditional score (with a prompt) and an unconditional score. The underlying assumption is that memorized samples create a sharp peak in the probability landscape.

However, this assumes the landscape is isotropic (uniform in all directions). As the noise level drops during the diffusion process, the landscape actually becomes anisotropic (stretched out). In these stretched regions, simple magnitude-based metrics fail to distinguish between memorized and legitimate samples because a high score in one direction can be mathematically canceled out by a low score in another.

Comparison of norm-based metrics in isotropic vs. anisotropic regimes.

A Dual-Regime Approach

To address this limitation, the authors propose a "denoising-free" detection metric that evaluates two distinct noise regimes:

  1. The Isotropic Regime (High Noise): At high noise levels, the probability distribution is roughly spherical. Here, the standard norm-based metric remains a strong signal for memorization.
  2. The Anisotropic Regime (Low Noise): In the low-noise setting, memorization manifests as angular alignment. For a memorized image, the text prompt's guidance doesn't provide new directional information; it simply points in the same direction the model was already heading. This is measured using the cosine similarity between the guidance vector and the unconditional score.
Visualizing score alignment and cosine similarity for memorized vs. non-memorized images.

The final metric, $\mathcal{M}(x_T, c)$, is a weighted sum of these two components. Crucially, it only requires two forward passes through the model on pure noise, completely skipping the expensive iterative denoising process.

Key Insights and Results

  • The Geometry of Memory: Memorization is characterized not just by the "sharpness" of a probability peak, but by the "alignment" of the model's trajectory. In the low-noise regime, a memorized prompt's internal compass aligns almost perfectly with its unconditional compass.
  • Probing at $t \approx 0$: Memorization can be detected by probing the model at the very end of the denoising process using pure noise inputs. The signatures of memorization are baked into the model's weights, regardless of whether the input latent is a clean image or noise.
  • Superior Detection & Speed: Evaluated on Stable Diffusion v1.4 and v2.0 against a control group of diverse prompts, the proposed method achieved an AUC of 0.999, outperforming all existing denoising-free baselines. By avoiding the denoising loop, it is 4.9x to 7.7x faster than previous approaches, processing 10 prompts in just 1.1 to 3.4 seconds.
  • Effective Mitigation: The metric can also be used as a loss function to "nudge" text embeddings during initialization, successfully generating images that are visually distinct from training data while maintaining high aesthetic quality and prompt alignment.

Limitations and Future Work

While highly effective for global memorization (copying a whole image), the alignment component is less reliable for "local" memorization, where only a small object or watermark is copied. Additionally, the weights for the isotropic and anisotropic components currently require tuning for different model versions. Future work aims to develop a unified metric capable of handling both local and global memorization across larger architectures like SDXL or SD3.

Summary updated

BibTeX
@inproceedings{asthana2026detecting,
  author = {Rohan Asthana and Vasileios Belagiannis},
  title = {{Detecting and Mitigating Memorization in Diffusion Models through Anisotropy of the Log-Probability}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=HTPGy5ydAY},
}
Figure