English

Be like a Goldfish, Don't Memorize! Mitigating Memorization in Generative LLMs

Computation and Language 2024-11-05 v2

Abstract

Large language models can memorize and repeat their training data, causing privacy and copyright risks. To mitigate memorization, we introduce a subtle modification to the next-token training objective that we call the goldfish loss. During training, randomly sampled subsets of tokens are excluded from the loss computation. These dropped tokens are not memorized by the model, which prevents verbatim reproduction of a complete chain of tokens from the training set. We run extensive experiments training billion-scale Llama-2 models, both pre-trained and trained from scratch, and demonstrate significant reductions in extractable memorization with little to no impact on downstream benchmarks.

Keywords

Cite

@article{arxiv.2406.10209,
  title  = {Be like a Goldfish, Don't Memorize! Mitigating Memorization in Generative LLMs},
  author = {Abhimanyu Hans and Yuxin Wen and Neel Jain and John Kirchenbauer and Hamid Kazemi and Prajwal Singhania and Siddharth Singh and Gowthami Somepalli and Jonas Geiping and Abhinav Bhatele and Tom Goldstein},
  journal= {arXiv preprint arXiv:2406.10209},
  year   = {2024}
}

Comments

10 pages, 8 figures, and 1 table in the main body. Code available at https://github.com/ahans30/goldfish-loss and checkpoints at https://huggingface.co/collections/tomg-group-umd/goldfish-loss-mitigating-memorization-in-llms-66c175becb6aab07744f7272

R2 v1 2026-06-28T17:06:29.270Z