Abstract
This paper investigates the phenomenon of "data leakage" in popular NLP benchmarks, where test instances significantly overlap with training data. By quantifying n-gram similarity across various datasets and tasks, we demonstrate that state-of-the-art models often rely on memorization rather than true generalization. Our findings reveal inflated performance scores that diminish significantly when evaluated on truly unique data, highlighting a critical need for more rigorous evaluation standards in the field.
Introduction
The primary goal of machine learning is generalization—the ability of a model to apply learned patterns to unseen data. However, the integrity of "held-out" test sets in NLP is often compromised. If a test sentence is nearly identical to one in the training set, a model can achieve high scores through simple memorization. This "data leakage" creates a false sense of progress, where models appear to understand language but are actually utilizing a "cheat sheet" of memorized answers. This study quantifies the extent of this overlap and its impact on performance metrics.
Methods
The researchers developed a framework to measure train-test overlap using three main approaches:
- Similarity Measurement: A bag-of-words approach calculated cosine similarity between test and training instances across unigrams, bigrams, and trigrams to capture different levels of textual overlap.
- Stratified Evaluation: Test sets were partitioned into intervals based on their similarity to training data to observe how performance varies with data familiarity.
- Controlled Splitting: Using the AIMed dataset, the authors compared "Random" splits (which often allow cross-contamination within documents) against "Unique" splits (where document-level isolation is maintained) to isolate the effect of document-level leakage.
Results
The analysis revealed staggering levels of overlap in common benchmarks. For instance, the AIMed (Random) split exhibited a 96.95% unigram similarity between the training and test sets.
A clear "memorization bonus" was observed: performance consistently correlated with similarity. Models performed significantly better on test instances that closely resembled their training data. In the AIMed dataset, moving from a Random split (high leakage) to a Unique document split (low leakage) caused the F1-score of a BioBERT model to drop from 77.9 to 64.4.
Named Entity Recognition (NER) proved particularly vulnerable. In the BC2GM dataset, over 70% of gene mentions in the test set had exact matches in the training set. Even in text classification tasks like SST2 sentiment analysis, accuracy rose from 85.0% for low-similarity instances to 96.8% for high-similarity ones, confirming that models lean heavily on familiar phrasing even for semantic tasks.
Discussion and Conclusion
While the bag-of-words similarity metric effectively identifies literal overlap, it may overlook "semantic leakage" where meaning is preserved through paraphrasing. Future research should explore more sophisticated Semantic Textual Similarity (STS) measures and establish new dataset splitting standards that explicitly control for similarity. Ensuring that benchmarks measure true generalization rather than sophisticated lookup is essential for the continued advancement of robust NLP systems.
Summary updated