Research map / Image generation / Fast diffusion sampling
Finding NeMo: Localizing Neurons Responsible For Memorization in Diffusion Models
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Introduces NeMo, a gradient-free method that localizes memorization of individual training images to a few (often single) neurons in Stable Diffusion's cross-attention value layers and deactivates them to stop verbatim replication while preserving image quality.
Problem
Diffusion models can memorize and reproduce training images verbatim, raising privacy and copyright concerns; existing mitigations act on inputs or require retraining and do not localize where memorization resides in the model.
Approach
Localize memorization down to individual neurons in cross-attention value layers by combining out-of-distribution z-score activation detection (initial candidate set) with a layer-wise and neuron-wise refinement using an SSIM-based memorization score on initial noise predictions; then deactivate the identified neurons to permanently mitigate memorization without retraining.
Key results
- Deactivating a median of 4 neurons for verbatim-memorized prompts cuts SSCD_Gen from 1.0 to 0.10 while keeping CLIP alignment at 0.31.
- Random deactivation of similar neuron counts leaves memorization unchanged (SSCD_Gen 0.999 for verbatim).
- Blocking up to 750 memorization neurons causes no significant FID/KID degradation on COCO; 28 verbatim prompts are memorized by a single neuron.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| deactivate localized memorization neurons | Stable Diffusion v1.4 · Verbatim memorized prompts | SSCD_Gen: 1.0\pm 0.0 -> 0.10\pm 0.07 | Helped |
| deactivate localized memorization neurons | Stable Diffusion v1.4 · Template memorized prompts | SSCD_Gen: 1.0\pm 0.0 -> 0.05\pm 0.04 | Helped |
| deactivate localized memorization neurons | Stable Diffusion v1.4 · Verbatim memorized prompts | A_CLIP: 0.32\pm0.02 -> 0.31\pm0.02 | No clear effect |
| skip refinement (ablation) | NeMo · Verbatim memorized prompts | number of identified neurons: 4\pm 3 -> 26.5 \pm 22.5 | Mixed |
| skip refinement (ablation) | NeMo · Template memorized prompts | number of identified neurons: 21\pm 18 -> 674.5 \pm 624.5 | Mixed |
| remove top-k neuron selection (ablation) | NeMo · Verbatim memorized prompts | SSCD_Gen: 0.10\pm 0.07 -> 0.21\pm0.13 | Hurt |
| remove top-k neuron selection (ablation) | NeMo · Template memorized prompts | SSCD_Gen: 0.05\pm 0.04 -> 0.41\pm0.32 | Hurt |
| use classifier-free guidance during detection (ablation) | NeMo · Verbatim memorized prompts | SSCD_Gen: 0.10\pm 0.07 -> 0.14\pm0.07 | Hurt |
| use classifier-free guidance during detection (ablation) | NeMo · Template memorized prompts | SSCD_Gen: 0.05\pm 0.04 -> 0.12\pm0.07 | Hurt |
| scale neuron activations by 0.75 instead of deactivating (ablation) | NeMo · Verbatim memorized prompts | SSCD_Gen: 0.10\pm 0.07 -> 0.995\pm0.00 | Hurt |
| scale neuron activations by 0.75 instead of deactivating (ablation) | NeMo · Template memorized prompts | SSCD_Gen: 0.05\pm 0.04 -> 0.966\pm0.03 | Hurt |
| scale neuron activations by -0.25 instead of deactivating (ablation) | NeMo · Verbatim memorized prompts | SSCD_Gen: 0.10\pm 0.07 -> 0.12\pm0.06 | No clear effect |
Surprising findings
- Single neurons, e.g. neuron #25 in the first cross-attention value layer, are responsible for verbatim memorization of multiple prompts.
- Positive scaling of memorization neuron activations only slightly reduces memorization, while full deactivation is needed.
Limitations
- Template memorization is harder to mitigate and sometimes requires deactivating over 100 neurons.
- Only evaluated on Stable Diffusion v1.4; newer models trained on deduplicated data showed no detectable memorization.
Experimental setup
Datasets: LAION-2B-en COCO
Benchmarks: COCO
Metrics: SSCD_Orig SSCD_Gen D_SSCD CLIP score alignment FID CLIP-FID KID
Baselines: Prompt embedding adjustment Attention scaling Adding random tokens Random neuron deactivation
Builds on: Stable Diffusion Wen et al. memorization detection SSCD classifier-free guidance
Closest papers by meaning
- On the Edge of Memorization in Diffusion Models (NeurIPS 2025 · similarity 0.90)
- Exploring Local Memorization in Diffusion Models via Bright Ending Attention (ICLR 2025 · similarity 0.89)
- How Diffusion Models Memorize (NeurIPS 2026 · similarity 0.88)
- Classifier-Free Guidance Inside the Attraction Basin May Cause Memorization (CVPR 2025 · similarity 0.88)
- Detecting, Explaining, and Mitigating Memorization in Diffusion Models (ICLR 2024 · similarity 0.87)
- Why Diffusion Models Don’t Memorize: The Role of Implicit Dynamical Regularization in Training (NeurIPS 2025 · similarity 0.87)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
