NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Automated Detection of Pre-training Text in Black-box LLMs

Ruihan Hu, Yu-Ming Shang, Jiankun Peng, Wei Luo, Yazhe Wang, Xi Zhang

Introduction

Researchers have developed VeilProbe, the first fully automated framework to detect if a specific text was used to pre-train a "black-box" Large Language Model (LLM). Unlike previous methods that require internal model data (like token probabilities) or tedious manual prompt engineering, VeilProbe uses a sequence-to-sequence mapping model and clever token perturbations to identify membership signals using only the model's text outputs.

The Challenge of Black-box Membership Inference

As LLMs become central to technology, concerns regarding data privacy and copyright have exploded—highlighted by high-profile lawsuits like The New York Times vs. OpenAI. To prove a model was trained on copyrighted or sensitive data, we need "membership inference" tools.

However, most existing detection tools are "white-box" or "grey-box," meaning they require access to the model’s internal math (log-probabilities or gradients). In the real world, many state-of-the-art models (like GPT-4 or Claude) are "black-boxes" accessible only via text APIs. Existing black-box methods often rely on "name-cloze" tasks—manually designing fill-in-the-blank questions—which is expensive, slow, and doesn't scale.

Comparison of VeilProbe with existing white-box and black-box detection methods.

VeilProbe aims to bridge this gap by automating detection using only input-output text pairs, eliminating the need for hidden information or substantial human effort.

The VeilProbe Framework

VeilProbe operates through a three-stage pipeline designed to extract and classify membership features from black-box responses.

The three-stage detection pipeline of VeilProbe: (a) Text-to-Suffix Pairs Sampling, (b) Membership Feature Inference, and (c) Prototype-based Classifier.

1. Text-to-Suffix Sampling

The system takes a candidate text $s$ and asks the target LLM to complete it, generating a suffix $s^{out}$. It then identifies "key tokens" in the input—words that heavily influence the output—using smaller open-source "proxy" models. By perturbing these key tokens (replacing them with synonyms) to create a perturbed text $r$, the system generates a second "perturbed" suffix $r^{out}$.

2. Membership Feature Inference

A separate, small sequence-to-sequence (seq2seq) model is trained to learn the mapping between the input text and the LLM's generated suffix. By extracting the hidden states of this mapping model, VeilProbe captures latent features of how the LLM "remembers" text. A "Perturbation Calibration Feature Extractor" then uses statistical significance tests to filter out noisy features, keeping only those that strongly distinguish between training and non-training data.

3. Prototype-based Classifier

Since confirmed examples of an LLM's training data are scarce, VeilProbe employs Prototypical Networks. This allows for "few-shot" classification, identifying membership by comparing a new text's features to a small set of known "prototypes" (confirmed training vs. non-training samples). An Information Bottleneck (IB) layer is incorporated to further denoise the features before final classification.

Evaluation and Results

The authors evaluated VeilProbe on three diverse benchmarks: WikiMIA (Wikipedia events), BookTection (copyrighted bestselling books), and arXivTection (scientific papers).

Key Insights

  • Robustness Gap: LLMs are more "robust" when completing text they have seen during pre-training. Changing key words in familiar sentences results in predictable, distinguishable changes in completion behavior compared to unseen text.
  • Proxy Model Effectiveness: Smaller models from the same family (e.g., GPT-2 for ChatGPT) effectively identify influential "key tokens" for the target black-box model.
  • Latent Mapping: By analyzing the features of the mapping process rather than direct text output, VeilProbe captures intricate patterns that simple string matching misses.

Performance Highlights

VeilProbe significantly outperformed state-of-the-art methods across models like Pythia, LLaMA, Mistral, ChatGPT, and Claude:

  • Accuracy: On WikiMIA, VeilProbe achieved an AUC of 0.913, far exceeding existing black-box methods like DE-COP (0.512).
  • Precision: It nearly doubled the True Positive Rate (TPR) at a strict 5% False Positive Rate, crucial for copyright enforcement.
  • Document-Level Detection: For entire books or papers, VeilProbe reached an average AUC of 99.2%.

Limitations and Future Work

While automated, VeilProbe requires a small set (approx. 50 samples) of ground-truth data to anchor its prototypes. Its efficiency also depends on the availability of a suitable proxy model. Future research may focus on reducing ground-truth requirements and testing against "unlearning" techniques designed to hide training signatures.

Summary updated

BibTeX
@inproceedings{hu2025automated,
  author = {Ruihan Hu and Yu-Ming Shang and Jiankun Peng and Wei Luo and Yazhe Wang and Xi Zhang},
  title = {{Automated Detection of Pre-training Text in Black-box LLMs}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.24963/ijcai.2025/44},
}
Figure