Does Data Contamination Make a Difference? Insights from Intentionally Contaminating Pre-training Data For Language Models

Minhao Jiang, Ken Liu, Ming Zhong, Rylan Schaeffer, Siru Ouyang, Jiawei Han, Sanmi Koyejo

TL;DR

This paper investigates the impact of data contamination (evaluation data leaking into pre-training data) on language models. They find that "ground-truth contamination" (including prompts and answers) significantly boosts performance, more so than just text contamination. Crucially, they demonstrate that common n-gram-based methods for detecting contamination are insufficient, highlighting the need for more robust assessment strategies.

What Problem Does This Paper Address?

Large language models (LLMs) have shown remarkable capabilities, but a persistent concern is whether these impressive results are partly due to "data contamination." This happens when data from evaluation datasets inadvertently gets included in the massive pre-training corpora. While this can artificially inflate performance, there's been limited understanding of how different types of contamination affect LLMs and whether current detection methods are adequate. This paper aims to systematically explore these effects by intentionally contaminating pre-training data and evaluating the models.

Methods

The core of this research involves pre-training GPT-2 models from scratch with intentionally contaminated datasets. The authors differentiate between two main types of contamination:

  • Text Contamination: Only the input text from evaluation samples is added to the pre-training corpus.
  • Ground-Truth Contamination: This includes the input text, the associated prompts, and the correct answers/labels from the evaluation samples.

They also investigate the impact of repeated contamination (how many times evaluation data appears) and critically analyze existing n-gram-based contamination detection methods by attempting to filter out contaminated data based on these definitions.

Datasets

The study uses the following datasets for evaluation:

  • SST-2: A sentiment analysis dataset.
  • MMLU: A multi-task natural language understanding dataset.
  • CNN And Daily Mail: A text summarization dataset.
  • SQuAD V1: A question-answering dataset.

For pre-training, they use a subsampled portion of "The Pile" dataset (specifically, 1.95M documents for a total of 3.3B tokens for GPT-2-small, and the "pile-uncopyrighted" corpus for GPT-2-large).

Key Insights and Ideas

  • Ground Truth Matters Most: The most significant performance boost comes from "ground-truth contamination," suggesting that models learn not just the text but also how to respond to specific prompts and achieve desired outputs.
  • U-Shaped Performance with Repetition: Repeatedly injecting contaminated data initially improves performance but then leads to a decline, sometimes even falling below the baseline of no contamination. This suggests an optimal level of contamination exists.
  • N-gram Definitions Fall Short: Existing n-gram-based methods for identifying contamination are found to be insufficient. They can lead to many false positives (flagging clean data as contaminated) and false negatives (missing actual contamination), especially with paraphrased data.
  • Prompt Sensitivity: GPT-2 models show significant sensitivity to prompt phrasing during evaluation, highlighting the importance of careful prompt design and evaluation.

Key Results

  • Performance Boost: Ground-truth contamination consistently led to significant performance improvements across most datasets. For example, on the CNN dataset, ground-truth contamination helped the model surpass public checkpoints.
  • Text Contamination Gains: Text contamination also showed improvements, though generally more modest than ground-truth contamination.
  • U-Shape in Action: For SST-2, MMLU, and SQuAD, performance peaked with around 10 repetitions of contaminated data before declining.
  • N-gram Filtering Ineffectiveness: Filtering out data based on n-gram definitions often resulted in performance comparable to or even worse than the original model, indicating these definitions don't accurately identify truly problematic data.

Limitations and Future Work

  • Model Scale: The study primarily uses GPT-2 models, which are smaller than state-of-the-art LLMs. The authors acknowledge that findings might not directly generalize to larger models, which could exhibit different contamination behaviors.
  • Pre-training Focus: The research is limited to the pre-training stage. Future work should explore contamination effects across instruction tuning, fine-tuning, and RLHF stages.
  • Broader Exploration: The authors emphasize the need for future research to investigate a wider range of models, training stages, and more sophisticated contamination detection and assessment methods. They also suggest exploring how contamination impacts different aspects of language model capabilities beyond standard benchmarks.

Summary updated

BibTeX
@inproceedings{jiang2024does,
  author = {Minhao Jiang and Ken Liu and Ming Zhong and Rylan Schaeffer and Siru Ouyang and Jiawei Han and Sanmi Koyejo},
  title = {{Does Data Contamination Make a Difference? Insights from Intentionally Contaminating Pre-training Data For Language Models}},
  booktitle = {DPFM @ ICLR},
  year = {2024},
  url = {https://openreview.net/forum?id=wSpwj7xab9},
}
Figure