Bag of Tricks for Training Data Extraction from Language Models
Weichen Yu, Tianyu Pang, Qian Liu, Chao Du, Bingyi Kang, Yan Huang, Min Lin, Shuicheng Yan
Abstract
With the advance of language models, privacy protection is receiving more attention. Training data extraction is therefore of great importance, as it can serve as a potential tool to assess privacy leakage. However, due to the difficulty of this task, most of the existing methods are proof-of-concept and still not effective enough. In this paper, we investigate and benchmark tricks for improving training data extraction using a publicly available dataset. Because most existing extraction methods use a pipeline of generating-then-ranking, i.e., generating text candidates as potential training data and then ranking them based on specific criteria, our research focuses on the tricks for both text generation (e.g., sampling strategy) and text ranking (e.g., token-level criteria). The experimental results show that several previously overlooked tricks can be crucial to the success of training data extraction. Based on the GPT-Neo 1.3B evaluation results, our proposed tricks outperform the baseline by a large margin in most cases, providing a much stronger baseline for future research. The code is available at https://github.com/weichen-yu/LM-Extraction.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
18 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Membership Inference Attacks Against Machine Learning Models cites Stealing Machine Learning Models via Prediction APIs
- DNA-GPT: Divergent N-Gram Analysis for Training-Free Detection of GPT-Generated Text cites Language Models are Few-Shot Learners
- DNA-GPT: Divergent N-Gram Analysis for Training-Free Detection of GPT-Generated Text cites Extracting Training Data from Large Language Models
- DNA-GPT: Divergent N-Gram Analysis for Training-Free Detection of GPT-Generated Text cites The Curious Case of Neural Text Degeneration
- Promise and Peril of Collaborative Code Generation Models: Balancing Effectiveness and Memorization cites Extracting Training Data from Large Language Models
- Language Models are Few-Shot Learners cites The Curious Case of Neural Text Degeneration
- LLM-PBE: Assessing Data Privacy in Large Language Models cites Membership Inference Attacks Against Machine Learning Models
- MoPe: Model Perturbation based Privacy Attacks on Language Models cites Membership Inference Attacks Against Machine Learning Models
- MoPe: Model Perturbation based Privacy Attacks on Language Models cites Language Models are Few-Shot Learners
- Extracting Training Data from Large Language Models cites Membership Inference Attacks Against Machine Learning Models
- Extracting Training Data from Large Language Models cites Language Models are Few-Shot Learners
- Extracting Training Data from Large Language Models cites The Curious Case of Neural Text Degeneration
Cited by top-tier papers18
- DNA-GPT: Divergent N-Gram Analysis for Training-Free Detection of GPT-Generated TextXianjun Yang, Wei Cheng, Yue Wu, Linda Ruth Petzold et al.ICLR 2024 · 173 citations
- LLM-PBE: Assessing Data Privacy in Large Language ModelsQinbin Li, Junyuan Hong, Chulin Xie, Jeffrey Tan et al.VLDB 2024 · 66 citations
- Large Language Models Can Be Contextual Privacy Protection LearnersYijia Xiao, Yiqiao Jin, Yushi Bai, Yue Wu et al.EMNLP 2024 · 18 citations
- MoPe: Model Perturbation based Privacy Attacks on Language ModelsMarvin Li, Jason Wang, Jeffrey G. Wang, Seth NeelEMNLP 2023 · 8 citations
- Promise and Peril of Collaborative Code Generation Models: Balancing Effectiveness and MemorizationZhi Chen, Lingxiao JiangASE 2024 · 4 citations
Builds on20
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Membership Inference Attacks Against Machine Learning ModelsReza Shokri, Marco Stronati, Congzheng Song, Vitaly ShmatikovS&P 2017 · 5,137 citations
- The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
- Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski et al.USENIX Security 2021 · 2,866 citations
- Stealing Machine Learning Models via Prediction APIsFlorian Tramèr, Fan Zhang, Ari Juels, Michael K. Reiter et al.USENIX Security 2016 · 2,088 citations
Related papers
- Private Investigator: Extracting Personally Identifiable Information from Large Language Models Using Optimized PromptsSeongho Keum, Dongwon Shin, Leo Marchyok, Sanghyun Hong et al.USENIX Security 2025
- Adaptive Backtracking for Privacy Protection in Large Language ModelsZhihao Yao, Yuxuan Gu, Xiachong Feng, Weitao Ma et al.ACL Findings 2026
- Investigating How Pre-training Data Leakage Affects Models' Reproduction and Detection CapabilitiesMasahiro Kaneko, Timothy BaldwinEMNLP 2025 · 2 citations
- R.R.: Unveiling LLM Training Privacy through Recollection and RankingWenlong Meng, Zhenyuan Guo, Lenan Wu, Chen Gong et al.ACL Findings 2025 · 2 citations
- The Good and The Bad: Exploring Privacy Issues in Retrieval-Augmented Generation (RAG)Shenglai Zeng, Jiankun Zhang, Pengfei He, Yiding Liu et al.ACL Findings 2024 · 104 citations
