Probing Language Models for Pre-training Data Detection

Zhenhua Liu, Tong Zhu, Chuanyuan Tan, Bing Liu, Haonan Lu, Wenliang Chen

Abstract

Detecting whether specific text was used during the pre-training of Large Language Models (LLMs) is crucial for mitigating data contamination and privacy risks. Traditional detection methods rely on superficial metrics like perplexity, which are often unreliable. We present a novel probing-based approach that identifies "seen" data by analyzing internal model activations. By training a simple linear classifier on hidden states, our method achieves state-of-the-art performance across multiple benchmarks, including the newly introduced ArxivMIA. Our results demonstrate that internal activations provide a more robust "memory signature" than external outputs, with performance improving as model size increases.

Introduction

As Large Language Models (LLMs) scale, the lack of transparency regarding their training data poses significant challenges. Data contamination occurs when evaluation benchmarks are inadvertently included in training sets, leading to over-optimistic performance metrics. Furthermore, privacy concerns arise when models memorize and potentially leak sensitive or copyrighted information. Existing detection techniques typically utilize "black-box" signals, such as model loss or generation patterns. However, these metrics are noisy and often fail to distinguish between high-likelihood text and actual training members. This work proposes a "white-box" alternative: probing the model's internal activations to detect pre-training data.

Methods

The core of our approach is the hypothesis that LLMs represent "seen" information differently within their hidden states compared to "unseen" information. We implement a three-step pipeline to capture this signal:

  1. Proxy Model Training: We fine-tune the target LLM on a small, known "member" dataset to create a proxy model that explicitly "remembers" this data.
  2. Probe Training: We extract internal activations from the proxy model for both member and non-member data. A simple linear probe (logistic regression) is trained to classify these activation patterns based on the final token of a specific layer.
  3. Detection: To evaluate a new text sample, we extract its activations from the original target model and apply the trained probe to determine its membership status.
Overview of the three-step probing pipeline for pre-training data detection.

Results

Our probing method consistently outperforms traditional baselines across various benchmarks. On the WikiMIA benchmark, the probe achieved an AUC of 69.8, significantly surpassing the "Neighbor Attack" (62.1) and "Min-K% Prob" (62.7). On the more challenging ArxivMIA-CS dataset, which features complex academic text, the probe reached an AUC of 67.3, while baseline methods often performed near random chance.

Performance comparison of the probing method against reference-free and reference-based baselines.

Key insights from our experiments include:

  • Activation Robustness: Internal signals are more reliable indicators of membership than external perplexity or loss.
  • Synthetic Data Utility: Probes can be effectively trained using synthetic data generated by models like ChatGPT, alleviating the need for real "unseen" data in specific domains.
  • Scaling and Efficiency: Detection performance improves with model size (as seen in experiments with OpenLLaMA 3B to 13B) and is highly data-efficient, with optimal results achieved using only 200 training samples.

Discussion and Limitations

While the probing method offers a significant leap in detection accuracy, it requires "white-box" access to model weights and activations, limiting its applicability to open-source models. Additionally, the probe's effectiveness is somewhat tied to the domain of its training data; a probe trained on Wikipedia may struggle with medical data. Future research will explore extending this methodology to multi-modal architectures and further investigating the scaling laws of internal memory signatures.

Summary updated

BibTeX
@inproceedings{liu2024probing,
  author = {Zhenhua Liu and Tong Zhu and Chuanyuan Tan and Bing Liu and Haonan Lu and Wenliang Chen},
  title = {{Probing Language Models for Pre-training Data Detection}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.86},
}
Figure