Be like a Goldfish, Don't Memorize! Mitigating Memorization in Generative LLMs
Abhimanyu Hans, John Kirchenbauer, Yuxin Wen, Neel Jain, Hamid Kazemi, Prajwal Singhania, Siddharth Singh, Gowthami Somepalli, Jonas Geiping, Abhinav Bhatele, Tom Goldstein
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.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext ebf098db-87e9-48d7-850a-d1c7c2e61675Cited by top-tier papers19
- Apertus: Democratizing Open and Compliant LLMs for Global Language EnvironmentsAlejandro Hernández-Cano, Alexander Hägele, Allen Hao Huang, Angelika Romanou et al.ACL 2026 · 51 citations
- Redirection for Erasing Memory (REM): Towards a universal unlearning method for corrupted dataStefan Schoepf, Michael Mozer, Nicole Mitchell, Alexandra Brintrup et al.ICLR 2026 · 7 citations
- SHIELD: Evaluation and Defense Strategies for Copyright Compliance in LLM Text GenerationXiaoze Liu, Ting Sun, Tianyang Xu, Feijie Wu et al.EMNLP 2024 · 4 citations
- Positional Fragility in LLMs: How Offset Effects Reshape Our Understanding of Memorization RisksYixuan Even Xu, Antoine Bosselut, Imanol SchlagNeurIPS 2025 · 2 citations
- TokenSwap: A Lightweight Method to Disrupt Memorized Sequences in LLMsParjanya Prajakta Prashant, Kaustubh Ponkshe, Babak SalimiNeurIPS 2025 · 2 citations
Builds on22
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- BERTScore: Evaluating Text Generation with BERTTianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger et al.ICLR 2020 · 8,443 citations
- Deep Learning with Differential PrivacyMartín Abadi, Andy Chu, Ian J. Goodfellow, H. Brendan McMahan et al.CCS 2016 · 7,620 citations
- The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural NetworksNicholas Carlini, Chang Liu, Úlfar Erlingsson, Jernej Kos et al.USENIX Security 2019 · 1,386 citations
- GLaM: Efficient Scaling of Language Models with Mixture-of-ExpertsNan Du, Yanping Huang, Andrew M. Dai, Simon Tong et al.ICML 2022 · 1,173 citations
Related papers
- Memorization Sinks: Isolating Memorization during LLM TrainingGaurav Rohit Ghosal, Pratyush Maini, Aditi RaghunathanICML 2025
- Quantifying Memorization Across Neural Language ModelsNicholas Carlini, Daphne Ippolito, Matthew Jagielski, Katherine Lee et al.ICLR 2023 · 158 citations
- Private Memorization Editing: Turning Memorization into a Defense to Strengthen Data Privacy in Large Language ModelsElena Sofia Ruzzetti, Giancarlo A. Xompero, Davide Venditti, Fabio Massimo ZanzottoACL 2025 · 9 citations
- Counterfactual Memorization in Neural Language ModelsChiyuan Zhang, Daphne Ippolito, Katherine Lee, Matthew Jagielski et al.NeurIPS 2023 · 184 citations
- Near-Duplicate Sequence Search at Scale for Large Language Model Memorization EvaluationZhencan Peng, Zhizhi Wang, Dong DengSIGMOD 2023 · 11 citations
