On Inter-dataset Code Duplication and Data Leakage in Large Language Models
Not on the map. Why?
Abstract (arXiv)
Motivation. Large language models (LLMs) have exhibited remarkable proficiency in diverse software engineering (SE) tasks. Handling such tasks typically involves acquiring foundational coding knowledge on large, general-purpose datasets during a pre-training phase, and subsequently refining on smaller, task-specific datasets as part of a fine-tuning phase. Problem statement. While intra-dataset code duplication examines the intersection between the training and test splits within a given dataset and has been addressed in prior research, inter-dataset code duplication, which gauges the overlap between different datasets, remains largely unexplored. If this phenomenon exists, it could compromise the integrity of LLM evaluations because of the inclusion of fine-tuning test samples that were already encountered during pre-training, resulting in inflated performance metrics. Contribution. This paper explores the phenomenon of inter-dataset code duplication and its impact on evaluating LLMs across diverse SE tasks. Study design. We conduct an empirical study using the CodeSearchNet dataset (CSN), a widely adopted pre-training dataset, and five fine-tuning datasets used for various se tasks. We first identify the intersection between the pre-training and fine-tuning datasets using a deduplication process. Next, we pre-train two versions of LLMs using a subset of CSN: one leaky LLM and one non-leaky LLM. Finally, we fine-tune both models and compare their performances using leaky fine-tuning test samples. Results. Our findings reveal a potential threat to the evaluation of LLMs across multiple SE tasks, stemming from the inter-dataset code duplication phenomenon. We also demonstrate that this threat is accentuated by the chosen fine-tuning technique. Furthermore, we provide evidence that open-source models could be affected by inter-dataset duplication.
Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). First posted on arXiv 15 Jan 2024.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2024: 1; 2025: 5; 2026: 4.
10 papers.
- 2024Cofca: A Step-Wise Counterfactual Multi-hop QA benchmarkcited by 26
- 2025Evaluating the Generalizability of LLMs in Automated Program Repaircited by 3
- 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Biascited by 3
- 2025CGP-Tuning: Structure-Aware Soft Prompt Tuning for Code Vulnerability Detectioncited by 2
- 2025The Ever-Evolving Science Examcited by 2
- 2026Beyond Retrieval: A Multitask Benchmark and Model for Code Searchcited by 1
- 2025Are AI Coders Snitches? An Empirical Study of Pretraining Data Detection on Code Large Language Modelscited by 0
- 2026From Data Leak to Secret Misses: The Impact of Data Leakage on Secret Detection Modelscited by 0
- 2026Enhancing Continual Learning for Software Vulnerability Prediction: Addressing Catastrophic Forgetting via Hybrid-Confidence-Aware Selective Replay for Temporal LLM Fine-Tuningcited by 0
- 2026A Metamorphic Testing Approach to Diagnosing Memorization in LLM-Based Program Repaircited by 0
- 2026Beyond Retrieval: A Multitask Benchmark and Model for Code Search6 May 2026
- 2026A Metamorphic Testing Approach to Diagnosing Memorization in LLM-Based Program Repair23 Apr 2026
- 2026Enhancing Continual Learning for Software Vulnerability Prediction: Addressing Catastrophic Forgetting via Hybrid-Confidence-Aware Selective Replay for Temporal LLM Fine-Tuning27 Feb 2026
- 2026From Data Leak to Secret Misses: The Impact of Data Leakage on Secret Detection Models30 Jan 2026
- 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Bias24 Aug 2025
- 2025Are AI Coders Snitches? An Empirical Study of Pretraining Data Detection on Code Large Language Models23 Jul 2025
- 2025The Ever-Evolving Science Exam22 Jul 2025
- 2025Evaluating the Generalizability of LLMs in Automated Program Repair12 Mar 2025
- 2025CGP-Tuning: Structure-Aware Soft Prompt Tuning for Code Vulnerability Detection8 Jan 2025
- 2024Cofca: A Step-Wise Counterfactual Multi-hop QA benchmark19 Feb 2024