PreprintCited by 727Adversarial Robustness in Machine LearningPrivacy-Preserving Technologies in DataTopic Modeling

Extracting Training Data from Large Language Models

Open access
Carlini, Nicholas, Tramer, Florian, Wallace, Eric, Jagielski, Matthew, Herbert-Voss, Ariel, Lee, Katherine, Roberts, Adam, Brown, Tom +4 more·2020·arXiv

Abstract

It has become common to publish large (billion parameter) language models that have been trained on private datasets. This paper demonstrates that in such settings, an adversary can perform a training data extraction attack to recover individual training examples by querying the language model. We demonstrate our attack on GPT-2, a language model trained on scrapes of the public Internet, and are able to extract hundreds of verbatim text sequences from the model's training data. These extracted examples include (public) personally identifiable information (names, phone numbers, and email addresses), IRC conversations, code, and 128-bit UUIDs. Our attack is possible even though each of the above sequences are included in just one document in the training data. We comprehensively evaluate our extraction attack to understand the factors that contribute to its success. Worryingly, we find that larger models are more vulnerable than smaller models. We conclude by drawing lessons and discussing possible safeguards for training large language models.

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

DataCite · 10.48550/arxiv.2012.07805

Cites

15 of 15 references verified0 citation errors · 0 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • Hallucination can lead to potential privacy violations.

    “Hallucination can also lead to potential privacy violations.”

    From Survey of Hallucination in Natural Language Generation (2023) · cites this paper as [26]

    Section 3.3 (pp. 4–5) says language models can disclose memorized training data in inappropriate contexts, creating privacy risks. It does not identify hallucination as the cause; the privacy mechanism it describes is memorization and extraction. (LLM, conf=0.82)

    Experimental — accuracy not yet measured
  • Client-level differential privacy has been proposed for FL.

    “In order to prevent any client from trying to reconstruct the private data of another client by exploiting the global model, client-level differential privacy [338] has been proposed for FL.”

    From Advances and Open Problems in Federated Learning (2021) · cites this paper as [338]

    Section 8 (p. 12) discusses differential privacy as a defense against training-data leakage and reports privacy benefits from user-level DP models for language modeling. It does not say that client-level DP has been proposed for federated learning or that it prevents one client from reconstructing another’s data through a global model. (LLM, conf=0.82)

    Experimental — accuracy not yet measured
  • User-level differential privacy can be used in FL's iterative training process.

    “user-level differential privacy can be used in FL's iterative training process [3, 338, 336, 68]”

    From Advances and Open Problems in Federated Learning (2021) · cites this paper as [338]

    Section 8 (p. 12) says user-level differential privacy has shown privacy benefits for language models and describes differentially private training. It does not address federated learning (FL) or its iterative training process, so it supports only the differential-privacy training part of the claim. (LLM, conf=0.86)

    Experimental — accuracy not yet measured
  • The probabilistic nature of LLMs and diffusion models limits their utility due to inherent instabilities and potential biases in training data.

    “The probabilistic nature of LLMs and diffusion models further limits their utility due to inherent instabilities and potential biases in their training data [71].”

    From Promises and challenges of generative artificial intelligence for human learning (2024) · cites this paper as [71]

    Section 4.2 (p. 5) describes language models as probabilistic generative models, supporting that limited part of the claim. The paper discusses privacy leakage from training data (Section 8, p. 12), but does not say that probabilistic behavior limits utility through inherent instability or training-data bias, and it does not address diffusion models. (LLM, conf=0.78)

    Experimental — accuracy not yet measured
  • Neural networks possess an intrinsic tendency to memorize training data.

    “Neural networks possess an intrinsic tendency to memorize training data [35]”

    From A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questions (2025) · cites this paper as [35]

    Section 3.1 (p. 3) says memorization is in many ways an essential component of language models, and the Introduction (p. 1) demonstrates that large language models memorize individual training examples. The claim extends that finding to neural networks generally; the cited passages do not establish an intrinsic tendency across all neural networks. (LLM, conf=0.83)

    Experimental — accuracy not yet measured

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

Flagged first, then by citations

Research works printed but not linked: 44

  1. [1][1] Martín Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In ACM CCS , 2016. -
  2. [4][4] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR , 2015. -
  3. [5][5] Yoshua Bengio, Réjean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic language model. JMLR , 2003. -
  4. [6][6] Gavin Brown, Mark Bun, Vitaly Feldman, Adam Smith, and Kunal Talwar. When is memorization of irrelevant training data necessary for high-accuracy learning? arXiv preprint arXiv:2012.06421 , 2020. - · arXiv
  5. [7][7] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165 , 2020. - · arXiv
  6. [8][8] Nicholas Carlini, Chang Liu, Úlfar Erlingsson, Jernej Kos, and Dawn Song. The secret sharer: Evaluating and testing unintended memorization in neural networks. In USENIX Security Symposium , 2019. -
  7. [9][9] Kamalika Chaudhuri and Claire Monteleoni. Privacypreserving logistic regression. In NIPS , 2009. -
  8. [10][10] Mia Xu Chen, Benjamin N Lee, Gagan Bansal, Yuan Cao, Shuyuan Zhang, Justin Lu, Jackie Tsay, Yinan Wang, Andrew M Dai, Zhifeng Chen, Timothy Sohn, and Yonghui Wu. Gmail smart compose: Real-Time assisted writing. In KDD , 2019. -
  9. [11][11] Andrea Continella, Yanick Fratantonio, Martina Lindorfer, Alessandro Puccetti, Ali Zand, Christopher Kruegel, and Giovanni Vigna. Obfuscation-Resilient Privacy Leak Detection for Mobile Apps Through Differential Analysis. In NDSS , 2017. -
  10. [12][12] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL , 2019. -
  11. [20][20] Vitaly Feldman and Chiyuan Zhang. What neural networks memorize and why: Discovering the long tail via influence estimation. In NeurIPS , 2020. -
  12. [21][21] Matt Fredrikson, Somesh Jha, and Thomas Ristenpart. Model inversion attacks that exploit confidence information and basic countermeasures. In ACM CCS , 2015. -
  13. [22][22] Philip Gage. A new algorithm for data compression. C Users Journal , 12(2):23-38, 1994. -
  14. [26][26] Alex Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850 , 2013. - · arXiv
  15. [27][27] Peter Henderson, Koustuv Sinha, Nicolas AngelardGontier, Nan Rosemary Ke, Genevieve Fried, Ryan Lowe, and Joelle Pineau. Ethical challenges in datadriven dialogue systems. In Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society , pages 123-129, 2018. -
  16. [28][28] Sorami Hisamoto, Matt Post, and Kevin Duh. Membership inference attacks on sequence-to-sequence models: Is my data in your machine translation system? In TACL , 2020. -
  17. [29][29] Andrew Hoang, Antoine Bosselut, Asli Celikyilmaz, and Yejin Choi. Efficient adaptation of pretrained transformers for abstractive summarization. arXiv preprint arXiv:1906.00138 , 2019. - · arXiv
  18. [30][30] Ari Holtzman, Jan Buys, Maxwell Forbes, and Yejin Choi. The curious case of neural text degeneration. In ICLR , 2020. -
  19. [31][31] Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. In ACL , 2018. -
  20. [33][33] Matthew Jagielski, Jonathan Ullman, and Alina Oprea. Auditing differentially private machine learning: How private is private SGD? In NeurIPS , 2020. -
  21. [34][34] Bargav Jayaraman and David Evans. Evaluating differentially private machine learning in practice. In USENIX Security Symposium , 2019. -
  22. [37][37] Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. A diversity-promoting objective function for neural conversation models. In NAACL , 2016. -
  23. [38][38] Zhuohan Li, Eric Wallace, Sheng Shen, Kevin Lin, Kurt Keutzer, Dan Klein, and Joseph E Gonzalez. Train large, then compress: Rethinking model size for efficient training and inference of transformers. In ICML , 2020. -
  24. [40][40] Yunhui Long, Vincent Bindschaedler, Lei Wang, Diyue Bu, Xiaofeng Wang, Haixu Tang, Carl A Gunter, and Kai Chen. Understanding membership inferences on well-generalized learning models. arXiv preprint arXiv:1802.04889 , 2018. - · arXiv
  25. [46][46] Milad Nasr, Reza Shokri, and Amir Houmansadr. Machine learning with membership privacy using adversarial regularization. In ACM SIGSAC , 2018. -
  26. [47][47] Milad Nasr, Reza Shokri, and Amir Houmansadr. Comprehensive privacy analysis of deep learning: Passive and active white-box inference attacks against centralized and federated learning. In IEEE S&P , 2019. -
  27. [48][48] Helen Nissenbaum. Privacy as contextual integrity. Washington Law Review , 2004. -
  28. [51][51] Fabio Petroni, Tim Rocktäschel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, Alexander H Miller, and Sebastian Riedel. Language models as knowledge bases? In EMNLP , 2019. -
  29. [55][55] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. In JMLR , 2020. -
  30. [56][56] Swaroop Ramaswamy, Om Thakkar, Rajiv Mathews, Galen Andrew, H Brendan McMahan, and Françoise Beaufays. Training production language models without memorizing user data. arXiv preprint arXiv:2009.10031 , 2020. - · arXiv
  31. [57][57] Roger Ratcliff. Connectionist models of recognition memory: constraints imposed by learning and forgetting functions. Psychological review , 1990. -
  32. [59][59] Adam Roberts, Colin Raffel, and Noam Shazeer. How much knowledge can you pack into the parameters of a language model? In EMNLP , 2020. -
  33. [61][61] Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In ACL , 2016. -
  34. [62][62] Taylor Shin, Yasaman Razeghi, Robert L Logan IV, Eric Wallace, and Sameer Singh. AutoPrompt: Eliciting knowledge from language models with automatically generated prompts. In EMNLP , 2020. -
  35. [63][63] Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-lm: Training multi-billion parameter language models using model parallelism. arXiv preprint arXiv:1909.08053 , 2019. - · arXiv
  36. [64][64] Reza Shokri and Vitaly Shmatikov. Privacy-preserving deep learning. In ACM CCS , 2015. -
  37. [66][66] Congzheng Song and Ananth Raghunathan. Information leakage in embedding models. In ACM CCS , 2020. -
  38. [67][67] Congzheng Song and Vitaly Shmatikov. Auditing data provenance in text-generation models. In KDD , 2018. -
  39. [68][68] Om Thakkar, Swaroop Ramaswamy, Rajiv Mathews, and Françoise Beaufays. Understanding unintended memorization in federated learning. arXiv preprint arXiv:2006.07490 , 2020. - · arXiv
  40. [70][70] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS , 2017. -
  41. [73][73] Santiago Zanella-Béguelin, Lukas Wutschitz, Shruti Tople, Victor Rühle, Andrew Paverd, Olga Ohrimenko, Boris Köpf, and Marc Brockschmidt. Analyzing information leakage of updates to natural language models. In ACM CCS , 2020. -
  42. [74][74] Rowan Zellers, Ari Holtzman, Hannah Rashkin, Yonatan Bisk, Ali Farhadi, Franziska Roesner, and Yejin Choi. Defending against neural fake news. In NeurIPS , 2019. -
  43. [75][75] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. ICLR , 2017. -
  44. [76][76] Yizhe Zhang, Siqi Sun, Michel Galley, Yen-Chun Chen, Chris Brockett, Xiang Gao, Jianfeng Gao, Jingjing Liu, and Bill Dolan. DialoGPT: Large-scale generative pretraining for conversational response generation. In ACL Demo Track , 2020.

Cited by

Sorted by citations

Authors
Carlini, N., Tramer, F., Wallace, E., Jagielski, M., Herbert-Voss, A., Lee, K., Roberts, A., Brown, T., Song, D., Erlingsson, U., Oprea, A., & Raffel, C.
Affiliations
  • Google (United States) (US)
  • University of California, Berkeley (US)
  • Northeastern University (US)
  • Harvard University (US)
  • OpenAI (United States) (US)
Venue
arXiv
Publisher
arXiv
Published
2020
Pages
2633-2650
ISSN
2331-8422 (ISSN-L)
OpenAlex
W3112689365
Cited by
727
References
15
Citations by year
2026: 17 · 2025: 157 · 2024: 210 · 2023: 208 · 2022: 87 · 2021: 46 · 2020: 2
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
  • USENIX Security Symposium
Funders
National Science Foundation (1804222)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Adversarial Robustness in Machine Learning
  • Physical Sciences › Computer Science › Artificial Intelligence › Privacy-Preserving Technologies in Data
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
Keywords
training data extraction, large language models, GPT-2, data privacy, adversarial attacks, training data leakage, personally identifiable information

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review