Broken Memories: Detecting and Mitigating Memorization in Diffusion Models with Degraded Generations

Yuanmin Huang, Mi Zhang, Chen Chen, Feifei Li, Geng Hong, Xiaoyu You, Min YangarXiv 2026 · DOI

TL;DR

This paper reveals that data memorization in diffusion models triggers internal numerical instability during sampling, often causing generated images to exhibit visually "broken" artifacts. By establishing "empirical stability regions" based on latent update norms, the authors develop a real-time, on-the-fly framework that detects and adaptively mitigates memorization step-by-step, eliminating duplicated outputs with virtually zero computational overhead.

What Problem Does This Paper Address?

Diffusion models excel at creating high-quality imagery, but they suffer from a major vulnerability: they occasionally memorize and replicate exact images from their training data. This behavior poses severe privacy risks and copyright infringements.

Current inference-time solutions typically operate on a "detect-then-retry" basis. If a system flags a generation as a potential duplicate, it aborts the process and restarts from scratch using modified prompts, initial latents, or guidance scales. This approach is computationally expensive, introduces significant latency, and often relies on static, heuristic rules that inadvertently degrade the final image quality and semantic diversity. The authors tackle this challenge by asking: Can we detect and fix memorization dynamically on the fly, without altering the prompt or restarting the generation loop?

Methods

The key insight of this paper is that memorization manifests as numerical instability within the model's latent dynamics. During the generation of a memorized image, the classifier-free guidance (CFG) gradients explode, causing the latent variables to make abnormally large, erratic jumps.

To address this, the authors introduce a principled framework based on Empirical Stability Regions:

  1. Calibration: By running a small set of normal (non-memorized) prompts, they map out the typical mean ($\mu_t$) and standard deviation ($\sigma_t$) of both the latent norms ($\|z_t\|$) and latent updates ($\|\delta_t\| = \|z_t - z_{t+1}\|$) at each denoising step.
  2. Step-wise Detection: During inference, the system monitors the Z-score of the latent updates at each step. A high Z-score flags an anomalous trajectory indicative of memorization.
  3. Adaptive Mitigation: Instead of aborting, the framework acts as a streaming filter. Depending on the severity of the deviation (tracked via a proxy of the reconstructed initial latent $\hat{z}_0^{(t)}$), it applies instantaneous mathematical projections to pull the latent state back into the empirical stability region.
Overview of the on-the-fly detection and mitigation framework showing how trajectories are constrained within stability regions.

Datasets

The authors evaluated their approach using three distinct prompt categories on Stable Diffusion (v1.4, v1.5, and v2.1):

  • Memorized Prompts: A benchmark of 500 prompts (219 for SD 2.1) known to trigger duplicate image generation, corresponding to duplicated images in the LAION dataset.
  • Non-Memorized Prompts: An evaluation set of 500 prompts sampled from Lexica.art, the COCO-2017 validation captions, and GPT-4 generations to test false positive rates and image quality.
  • Reference Prompts: A tiny subset of 50 random prompts from LAION-400M, used exclusively to calibrate the empirical stability regions.

Key Insights and Ideas

  • Memorization as Mode Collapse: The authors demonstrate that memorization is essentially a form of mode collapse that forces the sampling trajectory off its natural manifold.
  • The Solver Matters: In multi-step numerical solvers like PNDM, this internal instability propagates and physically "breaks" the final image, creating visible artifacts. Conversely, deterministic samplers like DDIM can visually conceal this instability in the final output, yet the underlying latent trajectory remains completely broken internally.
  • Surgical Trajectory Correction: Rather than blindly dampening guidance forces upfront (which harms image detail), the framework allows guidance to remain strong, intervening only when the latent state breaches the stability boundary.

Key Results

  • Complete Elimination of Memorization: The proposed method achieved a 0.0% memorization rate (measured via Self-Supervised Copy Detection) on Stable Diffusion 1.4, outperforming optimization-based and heuristic baselines.
  • Near-Perfect Detection: The step-wise Z-score metric achieved an Area Under the Curve (AUC) > 0.999 in identifying memorized trajectories.
  • Negligible Overhead: Because the mitigation relies on direct vector rescaling rather than backpropagation or iterative prompt optimization, it adds a mere ~0.01 seconds of latency per image.
  • Preserved Fidelity: It successfully eliminates copied content while maintaining excellent image quality (low FID) and strict semantic alignment with the prompt (CLIP score).
Qualitative results showing how the proposed method successfully alters memorized targets while preserving high quality and semantic fidelity compared to baselines.

Limitations and Future Work

The paper does not include a dedicated limitations section. However, a practical consideration is that the framework relies on a pre-calibrated reference set of normal prompts to define the stability boundaries. While the authors demonstrate that the method is highly robust to the size and distribution of this reference set, future work could explore entirely self-calibrating or analytical boundaries that remove the reference step altogether.

Summary updated

BibTeX
@misc{huang2026broken,
  author = {Yuanmin Huang and Mi Zhang and Chen Chen and Feifei Li and Geng Hong and Xiaoyu You and Min Yang},
  title = {{Broken Memories: Detecting and Mitigating Memorization in Diffusion Models with Degraded Generations}},
  year = {2026},
  eprint = {2605.22050},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.22050},
}
Figure