Detecting and Mitigating Memorization in Diffusion Models through Anisotropy of the Log-Probability
Rohan Asthana, Vasileios Belagiannis
TL;DR
Memorization in diffusion models is addressed by showing norm-based detectors fail in the anisotropic low-noise regime. The authors propose a denoising-free metric that combines isotropic score-norm with anisotropic angular alignment, computed from two forward passes on pure-noise inputs at $t\approx 0$ and $t\approx T$. They provide a theoretical bound on the cosine similarity between unconditional and conditional scores and empirically demonstrate superior detection (AUC and $\mathrm{TPR}_{1\%\mathrm{FPR}}$) on Stable Diffusion $v1.4$ and $v2.0$, with at least a 5x speedup over prior methods; they also validate an inference-time mitigation via prompt augmentation that yields non-memorized, text-aligned outputs. The approach generalizes to Realistic Vision and offers practical benefits for privacy-aware generation and safe deployment of diffusion models.
Abstract
Diffusion-based image generative models produce high-fidelity images through iterative denoising but remain vulnerable to memorization, where they unintentionally reproduce exact copies or parts of training images. Recent memorization detection methods are primarily based on the norm of score difference as indicators of memorization. We prove that such norm-based metrics are mainly effective under the assumption of isotropic log-probability distributions, which generally holds at high or medium noise levels. In contrast, analyzing the anisotropic regime reveals that memorized samples exhibit strong angular alignment between the guidance vector and unconditional scores in the low-noise setting. Through these insights, we develop a memorization detection metric by integrating isotropic norm and anisotropic alignment. Our detection metric can be computed directly on pure noise inputs via two conditional and unconditional forward passes, eliminating the need for costly denoising steps. Detection experiments on Stable Diffusion v1.4 and v2 show that our metric outperforms existing denoising-free detection methods while being at least approximately 5x faster than the previous best approach. Finally, we demonstrate the effectiveness of our approach by utilizing a mitigation strategy that adapts memorized prompts based on our developed metric.
