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

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

14 Jun 2024arXiv:2406.10209archive 2025-07-28

Abhimanyu Hans, Yuxin Wen, Neel Jain, John Kirchenbauer, Hamid Kazemi, Prajwal Singhania, Siddharth Singh, Gowthami Somepalli, Jonas Geiping, Abhinav Bhatele, Tom Goldstein

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2406.10209")

Code

Syntology Ran 13 of 18 code samples harvested from 1 repository linked to this paper; 5 have no recorded run. Of those that ran: 2 ran · violated contract; 11 ran with no contract checked.

By repository: official repository: 18 samples from 1 repository, 13 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

ahans30/goldfish-loss officialmentioned in papermentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

18 samples harvested; 13 ran; 0 honoured the contract we drafted; 5 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · violated contract
11ran
5unverified

Licence: 0 of the 18 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from ahans30/goldfish-loss. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

apply_rope ahans30/goldfish-loss/lit_gpt/model.py official repository ran · violated contract fingerprinted Apache-2.0 (permissive) · aa32c6faaa562b69 · report
build_mask_cache ahans30/goldfish-loss/lit_gpt/model.py official repository ran · violated contract fingerprinted Apache-2.0 (permissive) · 7ee1c3ba71156110 · report
cos_sim ahans30/goldfish-loss/lit_gpt/multiple_negative_ranking_loss.py official repository ran fingerprinted Apache-2.0 (permissive) · a8052087ba311802 · report
count_tokenizes_and_get_metrics ahans30/goldfish-loss/data_checks/count_token_lengths.py official repository ran Apache-2.0 (permissive) · d88b4cf25c69af3e · report
cumulative_mean_pooling ahans30/goldfish-loss/lit_gpt/retrieval_model.py official repository ran fingerprinted Apache-2.0 (permissive) · 53c8bb69ab68da37 · report
divide ahans30/goldfish-loss/axonn_fabric/fabric.py official repository ran fingerprinted Apache-2.0 (permissive) · b38ee8cd162d2d61 · report
get_batch ahans30/goldfish-loss/eval/eval_retrieval_anticausal.py official repository ran Apache-2.0 (permissive) · 41418f480eb09bbc · report
get_tflops ahans30/goldfish-loss/axonn_fabric/megatron_logging.py official repository ran Apache-2.0 (permissive) · 3b42fb8763cf8824 · report
init_normal ahans30/goldfish-loss/lit_gpt/model_axonn.py official repository ran Apache-2.0 (permissive) · 660a177a11d8a4cb · report
process_raw_data ahans30/goldfish-loss/eval/data_extraction.py official repository ran Apache-2.0 (permissive) · ff1deefe8ebfa94d · report
rank_prefixed_message ahans30/goldfish-loss/axonn_fabric/fabric.py official repository ran fingerprinted Apache-2.0 (permissive) · 386654d652c835ee · report
scaled_init_normal ahans30/goldfish-loss/lit_gpt/model_axonn.py official repository ran Apache-2.0 (permissive) · 4915f91d695a9b8e · report
str2bool ahans30/goldfish-loss/eval/data_extraction.py official repository ran Apache-2.0 (permissive) · 1eabe88f26a677a1 · report
build_rope_cache ahans30/goldfish-loss/lit_gpt/model.py official repository unverified Apache-2.0 (permissive) · c0cabd60c81402a5 · report
generate_responses_batched ahans30/goldfish-loss/eval/alpaca_eval_generate.py official repository unverified Apache-2.0 (permissive) · 55c7e661e08b2d2e · report
get_conv_template ahans30/goldfish-loss/eval/conversation.py official repository unverified Apache-2.0 (permissive) · 6db38b4d818a2c2e · report
modified_mlp_forward ahans30/goldfish-loss/axonn_fabric/hf_llama_tensor_parallel.py official repository unverified Apache-2.0 (permissive) · beb178be96641037 · report
pretty_log ahans30/goldfish-loss/axonn_fabric/megatron_logging.py official repository unverified Apache-2.0 (permissive) · 87ebed951203ba54 · report

Tasks

Memorization

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections