TL;DR
This paper introduces a novel method to detect data contamination in language model evaluations without needing access to the model's training data. By comparing a model's perplexity on benchmark data to "memorized" and "clean" baselines, they can quantify how much a model might be "cheating" by memorizing training examples. This is crucial for ensuring reliable model evaluations as data contamination becomes more prevalent.
What Problem Does This Paper Address?
Large language models (LLMs) are trained on massive datasets scraped from the web. Many popular evaluation benchmarks are also derived from similar web sources, leading to a significant problem: data contamination. This means that examples from the test sets of these benchmarks might have inadvertently been included in the LLMs' training data. When this happens, models can achieve high scores not by genuinely understanding and generalizing, but by simply memorizing the answers. This creates an illusion of progress, distorts model comparisons, and undermines the trustworthiness of benchmark results.
The core challenge is that existing methods for detecting contamination, like n-gram overlap analysis, require access to the LLM's entire training corpus. This is often impossible for proprietary models (like GPT-4) or even many open-source models where training data details are not fully disclosed. This lack of transparency prevents the research community from rigorously auditing models and assessing their true capabilities.
Methods
The paper proposes a new approach to quantify data contamination based on perplexity. The core idea is that if a model has memorized a piece of text from its training data, it will likely have a significantly lower perplexity (i.e., be more confident and predict it more accurately) on that text compared to unseen text.
Here's how it works:
- Perplexity Computing: For a given benchmark dataset and language model, each sample from the benchmark is first "verbalized" into a prompt that the model can process. The model then computes the perplexity of this verbalized sample. The average perplexity across all samples in the benchmark is then calculated.
- Baseline Preparation: Two baselines are created to contextualize the benchmark perplexity:
- Memorized Baseline: This consists of texts that are likely to have been part of the model's training corpus. For example, if a model was trained on Common Crawl data up to 2019, this baseline would use Wikipedia articles from that period.
- Clean Baseline: This consists of texts that are definitely not in the model's training corpus. This is typically achieved by using data created after the model was released.
- Crucially, these baselines are matched to the benchmark in terms of source, format, and length to ensure a fair comparison.
- Analysis: The perplexity of the benchmark dataset is compared to the memorized and clean baselines.
- If the benchmark perplexity is closer to the memorized baseline, it suggests significant contamination and memorization.
- If the benchmark perplexity is closer to the clean baseline, it indicates low or negligible contamination.
This method bypasses the need for direct access to training data by observing the model's behavior on benchmark samples.
Datasets
The paper uses several popular NLP benchmarks for evaluation:
- Reading Comprehension: QuAC, BoolQ, and SQuAD_v2. These benchmarks primarily use Wikipedia articles as their source material.
- Summarization: XSum. This benchmark uses BBC news articles.
- Multi-Choice Questions: MMLU. The authors analyze a subset of quizzes from MMLU, which cover a wide range of academic subjects.
The baselines are constructed using historical and recent versions of Wikipedia articles and BBC news articles, respectively, to represent "memorized" and "clean" data.
Key Insights and Ideas
- Perplexity as a Contamination Signal: The paper demonstrates that perplexity can serve as a powerful, indirect indicator of data contamination. A model's unusual confidence on benchmark data, compared to curated "memorized" and "clean" texts, is a strong signal.
- Evaluating Models Without Training Data: This is the most significant contribution. It democratizes contamination analysis, allowing researchers to audit models even when their training data is proprietary or undisclosed.
- Differential Contamination Across Task Types: The study reveals that contamination levels can vary significantly by task. Reading comprehension and summarization benchmarks show clear signs of memorization, while multi-choice questions appear less affected.
- Foundation Models Show Significant Memorization: Across the board, the tested foundation models (GPT-3, LLaMA series) exhibit substantial memorization on reading comprehension and summarization tasks, suggesting that these benchmarks might not be as reliable as previously thought.
Key Results
- Reading Comprehension: All four foundation models tested (GPT-3, LLaMA-7B, 13B, 30B) showed significant memorization behavior on QuAC, BoolQ, and SQuAD_v2. Larger models like GPT-3 and LLaMA-13B/30B were largely memorized, exhibiting lower perplexity than the clean baseline.
- Summarization: Similar to reading comprehension, significant memorization was found for all models on the XSum benchmark. For LLaMA-30B, the perplexity on XSum was even lower than the memorized baseline.
- Multi-Choice Questions: For the MMLU quizzes analyzed, the paper found no clear evidence of contamination. Perplexities showed no observable correlation with the time distribution of the quizzes, suggesting these might be less susceptible to contamination, possibly because they are often derived from PDF files not readily included in web scrapes.
Limitations and Future Work
- Approximation of Training Data: The "memorized baseline" is an approximation. While efforts are made to align it with the likely training data period, it's not a perfect replica.
- Verbalization Prompt Sensitivity: The effectiveness of the method might depend on the chosen verbalization prompt.
- Future Work: The authors suggest this method can be applied to a wider range of benchmarks and models. Further research could explore more sophisticated ways to construct the "memorized" baseline or investigate the specific characteristics of benchmarks that make them more or less prone to contamination. The paper also highlights the need for continued efforts to mitigate data contamination in benchmark design and LLM training.
Summary updated