atlas

Research map / Large language models / Language, safety and interpretability

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

NeurIPS 2024 · Large language models › Language, safety and interpretability · approach: LLM pruning and scaling data · 4 citations (OpenAlex)

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.

Proposes the goldfish loss, which excludes a pseudo-random hashed subset of tokens (about 1/k) from the next-token loss to prevent verbatim memorization of training data while keeping utility.

Problem

LLMs memorize and regenerate verbatim training data, creating privacy and copyright risks; post-hoc unlearning and differential privacy have limitations for this.

Approach

Drop a pseudo-random subset of tokens from the training loss (while still conditioning on all tokens in the forward pass), using a local hash of the preceding h tokens so repeated passages are masked identically; the model never learns to predict dropped tokens, so it cannot reproduce full passages verbatim at inference.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Apply goldfish loss with k=3 instead of standard lossLLaMA language model · Wikipedia membership inference using loss criterionTPR @ 0.1% FPR: 97.6% -> 3.45%Helped
Apply goldfish loss with k=3 instead of standard lossLLaMA language model · Wikipedia membership inference using zlib criterionTPR @ 0.1% FPR: 99.75% -> 69.50%Helped
Increase goldfish drop frequency from k=3 to k=4 (ablation)Goldfish loss · Wikipedia membership inference using loss criterionTPR @ 0.1% FPR: 3.45% -> 8.45%Hurt
Increase goldfish drop frequency from k=4 to k=8 (ablation)Goldfish loss · Wikipedia membership inference using loss criterionTPR @ 0.1% FPR: 8.45% -> 54.55%Hurt
Increase goldfish drop frequency from k=3 to k=4 (ablation)Goldfish loss · Wikipedia membership inference using zlib criterionTPR @ 0.1% FPR: 69.50% -> 88.50%Hurt
Increase goldfish drop frequency from k=4 to k=8 (ablation)Goldfish loss · Wikipedia membership inference using zlib criterionTPR @ 0.1% FPR: 88.50% -> 95.75%Hurt
Use random masking rather than hashed masking (ablation)Goldfish loss · Training-data memorization evaluationRougeL memorization scoreHurt
Use different goldfish masking strategies (ablation)Goldfish loss · Downstream benchmarksaccuracyNo clear effect
Train with 4-GL rather than standard lossLLaMA language model · Wikipedia semantic memorizationBERTScore: 5% -> 75%; standard loss 97%Mixed
Train with 4-GL rather than standard lossLLaMA language model · Wikipedia exact-sequence reproductionexact match: 85% -> 0%Helped
Train with goldfish loss with k=3 or k=4 instead of standard loss1B parameter language model · Downstream benchmarksbenchmark performanceNo clear effect
Train with goldfish loss rather than standard loss using the same input-token countLanguage model pretraining · RedPajamaV2 validationvalidation lossHurt

Surprising findings

Limitations

Experimental setup

Datasets: Wikipedia RedPajama-V2 RedPajama SlimPajama Harry Potter and the Sorcerer's Stone

Benchmarks: Hugging Face Open LLM Leaderboard tasks (incl. BoolQ) exact match memorization RougeL MAUVE membership inference (loss and zlib) beam search extraction

Metrics: exact match rate RougeL TPR@0.1% FPR AUC MAUVE validation loss BERTScore

Baselines: standard CLM loss random mask static mask control model without Wikipedia canaries differential privacy (conceptual)

Builds on: causal language modeling TinyLlama LitGPT zlib membership inference

Closest papers by meaning

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.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy