Skip to main content
QUICK REVIEW

[Paper Review] Detecting Pretraining Data from Large Language Models

Weijia Shi, Anirudh Ajith|arXiv (Cornell University)|Oct 25, 2023
Topic ModelingComputer Science13 citations
TL;DR

Introduces WikiMIA, a dynamic benchmark to detect whether text was part of an LLM’s pretraining data, and proposes Min-k% Prob, a reference-free MIA method that uses outlier token probabilities to detect membership. Demonstrates improved detection over baselines across several models and real-world scenarios.

ABSTRACT

Although large language models (LLMs) are widely deployed, the data used to train them is rarely disclosed. Given the incredible scale of this data, up to trillions of tokens, it is all but certain that it includes potentially problematic text such as copyrighted materials, personally identifiable information, and test data for widely reported reference benchmarks. However, we currently have no way to know which data of these types is included or in what proportions. In this paper, we study the pretraining data detection problem: given a piece of text and black-box access to an LLM without knowing the pretraining data, can we determine if the model was trained on the provided text? To facilitate this study, we introduce a dynamic benchmark WIKIMIA that uses data created before and after model training to support gold truth detection. We also introduce a new detection method Min-K% Prob based on a simple hypothesis: an unseen example is likely to contain a few outlier words with low probabilities under the LLM, while a seen example is less likely to have words with such low probabilities. Min-K% Prob can be applied without any knowledge about the pretraining corpus or any additional training, departing from previous detection methods that require training a reference model on data that is similar to the pretraining data. Moreover, our experiments demonstrate that Min-K% Prob achieves a 7.4% improvement on WIKIMIA over these previous methods. We apply Min-K% Prob to three real-world scenarios, copyrighted book detection, contaminated downstream example detection and privacy auditing of machine unlearning, and find it a consistently effective solution.

Motivation & Objective

  • Motivate the need to identify potentially copyrighted, private, or benchmark data in pretraining corpora of large language models.
  • Create a dynamic, model-agnostic benchmark (WikiMIA) to evaluate pretraining data detection methods.
  • Propose a lightweight, reference-free detection method (Min-k% Prob) that does not require shadow models or access to the pretraining distribution.
  • Empirically validate Min-k% Prob against baselines using WikiMIA and apply it to copyright, privacy auditing, and dataset contamination scenarios.

Proposed method

  • Define the pretraining data detection problem as a Membership Inference Attack with black-box LM access.
  • Construct WikiMIA by using Wikipedia event data before and after 2023 to create seen (member) and unseen (non-member) sets.
  • Propose Min-k% Prob: compute token probabilities on a text, select the lowest-k% probabilities, and average their log-likelihoods to detect membership without any reference model.
  • Justify Min-k% Prob via the hypothesis that unseen data contains more outlier low-probability tokens than seen data.
  • Evaluate Min-k% Prob against baselines (LOSS/PPL, Zlib, Lowercase, Smaller Ref, Neighbor) across multiple models and text lengths.
  • Examine factors influencing detection: model size and text length.
  • Apply Min-k% Prob to real-world tasks: copyrighted book detection, privacy auditing of machine unlearning, and downstream dataset contamination.
Figure 1: Overview of Min-k% Prob . To determine whether a text $X$ is in the pretraining data of a LLM such as GPT, Min-k% Prob first gets the probability for each token in $X$ , selects the $k$ % tokens with minimum probabilities and calculates their average log likelihood. If the average log like
Figure 1: Overview of Min-k% Prob . To determine whether a text $X$ is in the pretraining data of a LLM such as GPT, Min-k% Prob first gets the probability for each token in $X$ , selects the $k$ % tokens with minimum probabilities and calculates their average log likelihood. If the average log like

Experimental results

Research questions

  • RQ1Can a text be reliably detected as part of a model's pretraining data using only black-box access to the LM?
  • RQ2Does a simple, reference-free detector (Min-k% Prob) outperform baselines that rely on shadow models or calibrated probabilities?
  • RQ3How do model size, text length, and paraphrase affect pretraining data detection performance?
  • RQ4Can the approach be effective in real-world scenarios like copyright detection, privacy auditing, and dataset contamination?

Key findings

  • Min-k% Prob achieves higher AUC than baselines across several models (avg AUC 0.72, 7.4% above best baseline).
  • Detection performance improves with larger model size and longer text length.
  • Paraphrase settings still show strong detection with Min-k% Prob, outperforming baselines.
  • In copyrighted-book detection, Min-k% Prob achieved AUC of 0.88 and revealed substantial contamination in Books3 snippets.
  • Contaminant downstream data detection shows higher AUC when contaminants are outliers and with higher learning rates, corroborating the authors’ theoretical claims.
  • Privacy auditing case shows the method can reveal residual content after machine unlearning.
(a) AUC score vs. model size
(a) AUC score vs. model size

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.