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 · DOI

Abstract

Membership Inference Attacks (MIAs) are essential for auditing Large Language Models (LLMs) for copyright infringement and data contamination. However, most effective MIAs require internal model probabilities (grey-box access) or intensive human labor for prompt engineering. This paper introduces VeilProbe, a fully automated framework designed to detect pre-training data in black-box LLMs. By analyzing how a target model completes original versus slightly perturbed text prompts, VeilProbe extracts latent "membership features" to identify training data without needing internal weights or manual intervention. Our evaluation demonstrates that VeilProbe significantly outperforms existing baselines, achieving document-level AUCs of up to 99.2% on commercial models like ChatGPT and Claude.

Introduction

As LLMs are increasingly trained on massive, often proprietary datasets, the ability to audit these models for membership inference has become a legal and ethical necessity. Existing techniques generally fall into two categories: grey-box methods, which require access to token probability distributions, and black-box methods, which rely on human-crafted tasks like "name-cloze" tests.

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

Commercial models typically offer only black-box access, returning only the final generated text. This creates a significant barrier for automated, large-scale auditing. VeilProbe bridges this gap by automating the detection process, eliminating the need for hidden information or substantial human effort.

The VeilProbe Framework

VeilProbe operates on the principle that an LLM reacts differently to perturbed input if it has memorized the original text during pre-training. The framework consists of a three-stage pipeline:

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

1. Text-to-Suffix Sampling & Key Token Perturbation

The system first prompts the target black-box LLM with a text prefix and records the generated suffix. To identify which parts of the prefix are most influential, VeilProbe employs small, open-source proxy LLMs (e.g., GPT-2) to estimate token importance. These "key tokens" are then swapped with synonyms to create a perturbed version of the text, for which the target LLM generates a second suffix.

2. Membership Feature Inference

VeilProbe uses a separate sequence-to-sequence Transformer to model the mapping between prefixes and suffixes. By extracting the hidden states of this mapping model, it isolates "perturbation calibration features." These features capture the behavioral shift of the target LLM when its memorized content is altered, providing a much stronger signal than simple text-based metrics.

3. Prototype-based Classifier

Finally, the framework uses a sample-efficient prototype classifier. By training on a small set of known "pre-training" and "non-training" examples (as few as 10–50), the system uses an Information Bottleneck (IB) technique to filter noise and classify new texts based on their proximity to these learned prototypes in latent space.

Experimental Evaluation

VeilProbe was evaluated across three diverse datasets: WikiMIA (Wikipedia snippets), BookTection (165 copyrighted bestsellers), and arXivTection (classic scientific papers).

Key Results

  • Performance Gains: VeilProbe outperformed all baselines, including PPL and Min-K% Prob, improving the Area Under the Curve (AUC) by over 25.1%. It also nearly doubled the True Positive Rate at a strict 5% False Positive Rate (TPR@5%FPR).
  • Document-Level Accuracy: When detecting entire documents rather than individual sentences, VeilProbe achieved an average AUC of 99.2%.
  • Real-World Application: The framework successfully identified training data in commercial APIs, including GPT-3.5-instruct and Claude 2.1, where traditional grey-box methods are inapplicable.

Discussion and Limitations

While VeilProbe represents a major step forward in automated auditing, it does have limitations. The system requires a small amount of ground-truth data to initialize the prototype classifier, which may be difficult to obtain for entirely opaque models. Additionally, performance tends to decrease on shorter text segments (e.g., <128 tokens), as they provide fewer mapping features for analysis. Future work will explore the transferability of proxy models across more diverse architectures to ensure the robustness of feature attribution.

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