TL;DR
This paper demonstrates that Large Language Models (LLMs) like GPT-4 have effectively "memorized" many popular tabular datasets used in machine learning benchmarks. By introducing a suite of statistical and prompting tests, the authors show that LLMs often contain verbatim or compressed representations of these datasets, leading to inflated and invalid performance evaluations on downstream tasks.
What Problem Does This Paper Address?
In the rush to apply LLMs to everything from healthcare to finance, researchers often overlook data contamination. Because LLMs are trained on massive crawls of the public internet, they have likely encountered the CSV files, Kaggle notebooks, and GitHub repositories that house common research datasets.
If a model has already seen the "test set" during its pre-training, its high performance on a task isn't a sign of reasoning or generalization—it's just a sign of a good memory. This paper tackles the challenge of detecting this contamination in tabular data, where the structured nature of the data allows for more precise testing than free-form text.
Methods
The authors propose a hierarchy of tests to distinguish between three types of contamination:
- Knowledge: Does the model know metadata (feature names, value ranges, delimiters)?
- Learning: Can the model reproduce the joint probability distribution (e.g., correlations between features) without necessarily knowing specific rows?
- Memorization: Can the model recite specific rows verbatim, especially those with high entropy or unique values?
To test these without "leaking" the data in the prompt, they use zero-knowledge prompting. They provide the model with few-shot examples from different datasets to establish the desired output format, then ask the model to generate samples from the target dataset using only its internal parametric memory.
They also introduce four specific memorization tests:
- Header Test: Completing the first few rows of a canonical CSV.
- Row Completion: Completing a random row given a prefix.
- Feature Completion: Predicting a unique feature (like a Name or ID) given all other features in a row.
- First Token Test: Predicting the very first value of a random row.
Datasets
The study evaluates GPT-3.5 and GPT-4 across a diverse set of 10 datasets:
- Publicly Available (Likely Contaminated): Iris, Wine, Kaggle Titanic, OpenML Diabetes, Adult Income, California Housing, and Scikit-learn Diabetes.
- Guarded/Private (Likely Clean): FICO HELIOCv1 (requires a usage agreement), Kaggle Spaceship Titanic (released in 2022, after the models' training cutoffs), and Pneumonia (a private healthcare dataset).
Key Insights and Ideas
- The "Elephant" in the Room: GPT-4 is a much larger "elephant" than GPT-3.5. It consistently exhibits higher rates of verbatim memorization across almost all public datasets.
- The
head()Effect: Models are significantly better at remembering the first few rows of a dataset than random rows from the middle. The authors hypothesize this is because Python tutorials and Kaggle notebooks frequently calldf.head(), making those specific rows appear much more often in the training corpus. - Learning vs. Memorization: Interestingly, for datasets like California Housing, the models can perfectly replicate the complex Pearson correlation coefficients of the features (Learning) even when they fail to reproduce specific rows verbatim (Memorization).
Key Results
- Verbatim Recitation: For the Kaggle Titanic dataset, GPT-4 achieved a staggering 98% accuracy on a few-shot classification task. The authors' tests confirmed this was almost entirely due to memorization; the model could perfectly complete names and IDs for specific rows.
- Distributional Accuracy: In zero-knowledge sampling, the models produced data that closely matched the Pearson correlations of the original datasets for California Housing and Titanic, but failed to do so for the "clean" FICO and Pneumonia datasets.
- Contamination Confirmation: Table 1 in the paper shows that nearly all popular public datasets (Iris, Wine, Titanic, etc.) triggered positive results for both "Knowledge" and "Memorization" tests. Conversely, the Spaceship Titanic and Pneumonia datasets showed no evidence of contamination.
Limitations and Future Work
The authors acknowledge that their tests rely on black-box API access. Because they cannot see the model's internal probability distributions (logprobs), they must rely on sampling, which might underrepresent the true extent of memorization.
Furthermore, the "power" of these tests is tied to prompting. It is possible a model has memorized a dataset but requires a very specific, "magic" prompt to reveal it. The authors have released an open-source tool to help the community continue testing for contamination in new models and datasets.
Summary updated