[Paper Review] Proving Test Set Contamination in Black Box Language Models
This paper presents a statistical test to provably detect test set contamination in black-box language models without access to training data or model weights. By exploiting dataset exchangeability, the method compares log probabilities of canonical vs. shuffled example orderings, demonstrating high sensitivity even for small datasets (1,000 examples) and low duplication counts (as few as 2 occurrences), with strong false positive rate control.
Large language models are trained on vast amounts of internet data, prompting concerns and speculation that they have memorized public benchmarks. Going from speculation to proof of contamination is challenging, as the pretraining data used by proprietary models are often not publicly accessible. We show that it is possible to provide provable guarantees of test set contamination in language models without access to pretraining data or model weights. Our approach leverages the fact that when there is no data contamination, all orderings of an exchangeable benchmark should be equally likely. In contrast, the tendency for language models to memorize example order means that a contaminated language model will find certain canonical orderings to be much more likely than others. Our test flags potential contamination whenever the likelihood of a canonically ordered benchmark dataset is significantly higher than the likelihood after shuffling the examples. We demonstrate that our procedure is sensitive enough to reliably prove test set contamination in challenging situations, including models as small as 1.4 billion parameters, on small test sets of only 1000 examples, and datasets that appear only a few times in the pretraining corpus. Using our test, we audit five popular publicly accessible language models for test set contamination and find little evidence for pervasive contamination.
Motivation & Objective
- To provide provable, third-party detection of test set contamination in proprietary language models without access to training data or model weights.
- To address the lack of rigorous, statistical guarantees in existing heuristic membership inference methods for contamination detection.
- To develop a computationally efficient and powerful test that works even when benchmark datasets appear only a few times in pretraining.
- To enable auditability of widely deployed language models by providing a method that can be applied independently of model providers.
Proposed method
- Leverage the property of exchangeability in benchmark datasets: under no contamination, all orderings of a dataset should be equally likely.
- Compare the language model’s log probability on the canonical dataset ordering (from public repositories) to that on a randomly shuffled version of the same dataset.
- Use a statistical hypothesis test to flag significant differences in log probabilities as evidence of contamination.
- Implement a sharded test that divides the dataset into smaller segments, enabling parallel computation and improving statistical power for small p-values.
- Construct an exact null distribution based on exchangeability, enabling provable false positive rate control.
- Aggregate test statistics across shards to improve sensitivity and detect contamination even with low duplication counts (e.g., 2–10 occurrences).

Experimental results
Research questions
- RQ1Can we detect test set contamination in black-box language models without access to pretraining data or model weights?
- RQ2Does the exchangeability of benchmark datasets provide a reliable statistical basis for detecting memorization of specific example orderings?
- RQ3Can the proposed method detect contamination when benchmark datasets appear only a few times (e.g., 2–10 times) in the pretraining corpus?
- RQ4How does the sharded testing approach improve statistical power and computational efficiency compared to monolithic testing?
- RQ5To what extent can this method be applied to real-world, publicly available language models to detect contamination in practice?
Key findings
- The proposed method successfully detects test set contamination in a 1.4B parameter language model trained on Wikipedia and curated canary datasets, even when the test set appears as few as two times in the pretraining data.
- For datasets with 10 or more duplications, the method achieves vanishingly small p-values, indicating strong statistical evidence of contamination.
- The test is sensitive enough to detect contamination on small test sets of only 1,000 examples, demonstrating high power in low-duplication regimes.
- When applied to four publicly available language models, the method found little evidence of pervasive or strong test set contamination.
- The sharded testing approach significantly improves statistical power and enables efficient, parallelizable computation, making the method scalable and practical for real-world deployment.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.