Finding NeMo: Localizing Neurons Responsible For Memorization in Diffusion Models

Dominik Hintersdorf, Lukas Struppek, Kristian Kersting, Adam Dziedzic, Franziska Boenisch
6/4/2024
cs.LGcs.AI

No official code found. Best implementation: ml-research/localizing_memorization_in_diffusion_models (13 stars, MIT, last commit 2025-07-18).

Abstract

Diffusion models (DMs) produce very detailed and high-quality images. Their power results from extensive training on large amounts of data, usually scraped from the internet without proper attribution or consent from content creators. Unfortunately, this practice raises privacy and intellectual property concerns, as DMs can memorize and later reproduce their potentially sensitive or copyrighted training images at inference time. Prior efforts prevent this issue by either changing the input to the diffusion process, thereby preventing the DM from generating memorized samples during inference, or removing the memorized data from training altogether. While those are viable solutions when the DM is developed and deployed in a secure and constantly monitored environment, they hold the risk of adversaries circumventing the safeguards and are not effective when the DM itself is publicly released. To solve the problem, we introduce NeMo, the first method to localize memorization of individual data samples down to the level of neurons in DMs' cross-attention layers. Through our experiments, we make the intriguing finding that in many cases, single neurons are responsible for memorizing particular training samples. By deactivating these memorization neurons, we can avoid the replication of training data at inference time, increase the diversity in the generated outputs, and mitigate the leakage of private and copyrighted data. In this way, our NeMo contributes to a more responsible deployment of DMs.

View on arXivView PDF

Code Implementations(1)

MIT

[NeurIPS 2024] Source code for our paper "Finding NeMo: Localizing Neurons Responsible For Memorization in Diffusion Models".

131Python, DockerfileJun 3, 20241 years agoMIT
artificial-intelligencedeep-learningdiffusion-modelsmachine-learningmemorization+2 more

Similar Papers

Cite this paper

@article{hintersdorf2024finding,
  title  = {Finding NeMo: Localizing Neurons Responsible For Memorization in Diffusion Models},
  author = {Dominik Hintersdorf and Lukas Struppek and Kristian Kersting and Adam Dziedzic and Franziska Boenisch},
  year   = {2024},
  eprint = {2406.02366},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2406.02366},
  url    = {http://arxiv.org/abs/2406.02366v3},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.02366.svg)](https://codeofpaper.com/paper/2406.02366)

Discussion