Papers › Pandora's White-Box: Precise Training Data Detection and Extraction in Large Language Models

Pandora's White-Box: Precise Training Data Detection and Extraction in Large Language Models

26 Feb 2024arXiv:2402.17012archive 2025-07-28

Jeffrey G. Wang, Jason Wang, Marvin Li, Seth Neel

In this paper we develop state-of-the-art privacy attacks against Large Language Models (LLMs), where an adversary with some access to the model tries to learn something about the underlying training data. Our headline results are new membership inference attacks (MIAs) against pretrained LLMs that perform hundreds of times better than baseline attacks, and a pipeline showing that over 50% (!) of the fine-tuning dataset can be extracted from a fine-tuned LLM in natural settings. We consider varying degrees of access to the underlying model, pretraining and fine-tuning data, and both MIAs and training data extraction. For pretraining data, we propose two new MIAs: a supervised neural network classifier that predicts training data membership on the basis of (dimensionality-reduced) model gradients, as well as a variant of this attack that only requires logit access to the model by leveraging recent model-stealing work on LLMs. To our knowledge this is the first MIA that explicitly incorporates model-stealing information. Both attacks outperform existing black-box baselines, and our supervised attack closes the gap between MIA attack success against LLMs and the strongest known attacks for other machine learning models. In fine-tuning, we find that a simple attack based on the ratio of the loss between the base and fine-tuned models is able to achieve near-perfect MIA performance; we then leverage our MIA to extract a large fraction of the fine-tuning dataset from fine-tuned Pythia and Llama models. Our code is available at github.com/safr-ai-lab/pandora-llm.

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="2402.17012")

Code

Syntology Ran 7 of 9 code samples harvested from 1 repository linked to this paper; 2 have no recorded run. Of those that ran: 7 ran with no contract checked.

By repository: community (archive-listed): 9 samples from 1 repository, 7 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

iamgroot42/mimir mentioned on GitHubpytorchMIT 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

9 samples harvested; 7 ran; 0 honoured the contract we drafted; 2 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.

7ran
2unverified

Licence: 0 of the 9 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 iamgroot42/mimir. “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_extracted_fills iamgroot42/mimir/mimir/attacks/attack_utils.py community (archive-listed) ran MIT (permissive) · 868910516dfd4988 · report
f1_score iamgroot42/mimir/mimir/attacks/attack_utils.py community (archive-listed) ran fingerprinted MIT (permissive) · 2ef8c3a1db651c55 · report
load_cached iamgroot42/mimir/mimir/custom_datasets.py community (archive-listed) ran MIT (permissive) · 86d5495abf320c9c · report
load_data iamgroot42/mimir/mimir/custom_datasets.py community (archive-listed) ran MIT (permissive) · 82284f68e873a568 · report
strip_newlines iamgroot42/mimir/mimir/data_utils.py community (archive-listed) ran fingerprinted MIT (permissive) · fe613f0a1c05e77f · report
trim_to_shorter_length iamgroot42/mimir/mimir/data_utils.py community (archive-listed) ran MIT (permissive) · c73adb71ca005d02 · report
truncate_to_substring iamgroot42/mimir/mimir/data_utils.py community (archive-listed) ran MIT (permissive) · 5c9235530bc055e0 · report
count_masks iamgroot42/mimir/mimir/attacks/attack_utils.py community (archive-listed) unverified MIT (permissive) · 23c3416429f69fee · report
load_pubmed iamgroot42/mimir/mimir/custom_datasets.py community (archive-listed) unverified MIT (permissive) · 14beed14f0519675 · report

Tasks

Language Modelling

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

BASELLaMAPythia

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