Abstract
This paper demonstrates that large language models (LLMs) like GPT-2 memorize and leak specific, verbatim sequences from their training data, including personally identifiable information (PII). Using only black-box query access, the authors show that "eidetic memorization" occurs even in models that do not appear to be overfitting. Crucially, larger models are found to be significantly more vulnerable to these extraction attacks, challenging the assumption that massive, de-duplicated datasets prevent individual data leakage.
Introduction
The machine learning community has traditionally associated privacy leakage with overfitting—where a model performs significantly better on training data than on unseen test data. Because state-of-the-art LLMs are typically trained on massive datasets for only a few epochs, they show minimal gap between training and test loss, leading to a belief that they do not significantly memorize individual examples.
This research challenges that assumption by investigating whether an adversary can perform a training data extraction attack. By simply prompting the model and analyzing its outputs, the authors recovered individual, sensitive training examples such as physical addresses and unique identifiers.
Methodology
The authors developed a two-step extraction pipeline consisting of text generation and membership inference filtering.
1. Text Generation
A pool of 200,000 candidate sequences was generated by sampling from GPT-2. To maximize diversity and the likelihood of hitting memorized content, the authors employed techniques like decaying temperature sampling and conditioning the model on snippets of Internet text from Common Crawl.
2. Membership Inference (Filtering)
To distinguish memorized "needles" from fluent "haystack" prose, the authors ranked samples using likelihood ratios. Instead of simple high-probability metrics, they compared the target model’s perplexity against reference benchmarks:
- Zlib compression: Comparing model likelihood to text entropy.
- Reference Models: Comparing GPT-2 XL likelihood against GPT-2 Small. A significantly higher confidence in the larger model often indicates memorization.
- Casing: Comparing likelihoods of original vs. lowercased text.
Evaluation
The primary target was the GPT-2 family trained on WebText. Extracted snippets were verified through public internet searches and direct collaboration with OpenAI to confirm exact matches in the private training set.
Key Results
The attack successfully identified 604 unique memorized examples from GPT-2. In the most effective configuration, 67% of candidate samples were verbatim training examples. The extracted data was diverse, including:
- Personally Identifiable Information (PII): Names, physical addresses, email addresses, and phone numbers.
- Technical and Copyrighted Data: Source code, log files, 128-bit UUIDs, and entire pages of news articles or licenses.
A critical finding was that memorization scales with model size. GPT-2 XL (1.5B parameters) was significantly more "leaky" than smaller versions. Furthermore, complete memorization of a string could occur after appearing just 33 times in a 40GB dataset.
Discussion and Limitations
The study establishes that memorization is not synonymous with overfitting. Models can memorize rare sequences even when aggregate losses suggest generalizability. However, the results represent a "loose lower bound" because the authors only utilized black-box access and manual inspection.
Mitigating these risks remains a challenge. While Differential Privacy (DP) offers theoretical protection, its application to massive web-scraped datasets often degrades utility. Simple document-level de-duplication is also insufficient if sensitive snippets appear across different documents. As models scale toward trillions of parameters, the authors argue that privacy risks will intensify, necessitating more robust auditing and data curation strategies.
Summary updated