Introduction
As Large Language Models (LLMs) become increasingly integrated into commercial applications, the unauthorized use of copyrighted or private data for training has emerged as a significant legal and ethical concern. Detecting such "dataset misuse" is challenging, particularly when model owners provide only "black-box" access—returning text responses without revealing internal metrics like token probabilities or loss values. This paper presents a novel black-box method for dataset inference that identifies "tainted samples" to prove training set membership with high accuracy.
Methodology: The Tainted Sample Pipeline
The proposed approach moves beyond traditional Membership Inference Attacks (MIAs) by leveraging semantic fingerprints left in a model's output. The process involves three primary stages:
- Reference Model Construction: Researchers establish a baseline by using open-source models (e.g., Llama, Mistral) known to be excluded from the target dataset ($D$). These models serve as "non-members" ($R$). A "member" version ($R^t$) is then created by fine-tuning these same models on $D$.
- Identification of Tainted Samples: The core innovation lies in identifying "tainted samples"—data points that elicit significantly different responses from member vs. non-member models. These samples act as natural canaries; models trained on them tend to reproduce the original text more faithfully than those that haven't seen the data.
- Black-box Inference: To evaluate a suspect model $M$, it is prompted with the identified tainted samples. The similarity of $M$'s output to the original data is measured using BERTScore, which focuses on semantic meaning rather than exact word matches. If $M$ consistently aligns with the "member" reference models ($R^t$), it is statistically flagged as having been trained on the dataset.
Experimental Evaluation
The method was evaluated across four diverse instruction-tuning datasets: Databricks-dolly-15k, Alpaca, SlimOrca, and OpenHermes-2.5. These range from small, high-quality human-curated sets to massive datasets exceeding one million samples. The researchers tested the pipeline against 30 models per dataset (10 members, 20 non-members) sourced from Hugging Face to simulate real-world detection scenarios.
Key Results and Discussion
The experimental results demonstrate the robustness and precision of the tainted sample approach.
As shown in Figure 2, the method achieves a distinct separation between member and non-member models across all tested datasets. In "Non-IID" settings, where the suspect model is either a clear member or a complete outsider, the detection accuracy reached 100%. Even in more challenging "IID" settings—where non-member models are trained on data very similar to the victim set—the method maintained an accuracy of over 95%.
Robustness to Evasion
A critical finding is the method's resilience against common evasion tactics. The detection signal remained stable even when model outputs were rephrased using advanced models like GPT-4o, or when the model's "temperature" (creativity) was adjusted. This stability suggests that the "memory" of training data is deeply embedded in the model's semantic output and difficult to mask.
Conclusion
This research proves that internal model weights and probabilities are not required to audit LLM training data. By focusing on the statistical strength of a collection of "tainted samples" rather than individual sentences, researchers can achieve near-perfect detection accuracy. While the initial "offline" phase of training reference models requires computational resources, the "online" inference phase is highly efficient, taking less than 30 minutes to verify a suspect model. Future work will explore the scalability of these fingerprints in models exceeding 100 billion parameters.
Summary updated