The Adverse Effects of Code Duplication in Machine Learning Models of Code
Not on the map. Why?
Abstract (arXiv)
The field of big code relies on mining large corpora of code to perform some learning task. A significant threat to this approach has been recently identified by Lopes et al. (2017) who found a large amount of near-duplicate code on GitHub. However, the impact of code duplication has not been noticed by researchers devising machine learning models for source code. In this work, we explore the effects of code duplication on machine learning models showing that reported performance metrics are sometimes inflated by up to 100% when testing on duplicated code corpora compared to the performance on de-duplicated corpora which more accurately represent how machine learning models of code are used by software engineers. We present a duplication index for widely used datasets, list best practices for collecting code corpora and evaluating machine learning models on them. Finally, we release tools to help the community avoid this problem in future research.
Key facts. Cited by 123 papers in the map (data through 7 Oct 2026). First posted on arXiv 16 Dec 2018.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2020: 1; 2021: 16; 2022: 28; 2023: 40; 2024: 23; 2025: 10; 2026: 5.
123 papers.
Sort:
By area:
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2023The RefinedWeb Dataset for Falcon LLM: Outperforming Curated Corpora with Web Data, and Web Data Onlycited by 755
- 2021Deduplicating Training Data Makes Language Models Bettercited by 705
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2022A Systematic Evaluation of Large Language Models of Codecited by 360
- 2022The Stack: 3 TB of permissively licensed source codecited by 354
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 199
- 2023CulturaX: A Cleaned, Enormous, and Multilingual Dataset for Large Language Models in 167 Languagescited by 172
- 2023The BigScience ROOTS Corpus: A 1.6TB Composite Multilingual Datasetcited by 148
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 133
38 more
- 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 110
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2020Retrieval-Augmented Generation for Code Summarization via Hybrid GNNcited by 89
- 2023Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization)cited by 72
- 2021DOBF: A Deobfuscation Pre-Training Objective for Programming Languagescited by 68
- 2023MathPile: A Billion-Token-Scale Pretraining Corpus for Mathcited by 67
- 2024Quantifying Contamination in Evaluating Code Generation Capabilities of Language Modelscited by 62
- 2021Self-Supervised Bug Detection and Repaircited by 59
- 2022NatGen: Generative pre-training by "Naturalizing" source codecited by 53
- 2022CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequencescited by 49
- 2021On the Evaluation of Neural Code Summarizationcited by 47
- 2023Large Language Models and Simple, Stupid Bugscited by 45
- 2021Multilingual training for Software Engineeringcited by 43
- 2023Training Data Extraction From Pre-trained Language Models: A Surveycited by 43
- 2024Language Models for Code Completion: A Practical Evaluationcited by 38
- 2021Neural Transfer Learning for Repairing Security Vulnerabilities in C Codecited by 36
- 2023Measuring The Impact Of Programming Language Distributioncited by 32
- 2024Source Code Summarization in the Era of Large Language Modelscited by 30
- 2021Code Structure Guided Transformer for Source Code Summarizationcited by 29
- 2023CAT-LM: Training Language Models on Aligned Code And Testscited by 28
- 2025CARES: Comprehensive Evaluation of Safety and Adversarial Robustness in Medical LLMscited by 26
- 2023Extending Source Code Pre-Trained Language Models to Summarise Decompiled Binariescited by 25
- 2021Project-Level Encoding for Neural Source Code Summarization of Subroutinescited by 24
- 2021Learning to Complete Code with Sketchescited by 23
- 2024IRCoder: Intermediate Representations Make Language Models Robust Multilingual Code Generatorscited by 21
- 2021Type4Py: Practical Deep Similarity Learning-Based Type Inference for Pythoncited by 19
- 2022Dataflow Analysis-Inspired Deep Learning for Efficient Vulnerability Detectioncited by 18
- 2024LLM4SecHW: Leveraging Domain Specific Large Language Model for Hardware Debuggingcited by 18
- 2021Memorization and Generalization in Neural Code Intelligence Modelscited by 17
- 2022Noise-Robust De-Duplication at Scalecited by 17
- 2023CrossCodeBench: Benchmarking Cross-Task Generalization of Source Code Modelscited by 16
- 2023GrACE: Generation using Associated Code Editscited by 16
- 2023TpuGraphs: A Performance Prediction Dataset on Large Tensor Computational Graphscited by 16
- 2022On Distribution Shift in Learning-based Bug Detectorscited by 15
- 2023FLAME: A small language model for spreadsheet formulascited by 15
- 2022Aligning Offline Metrics and Human Judgments of Value for Code Generation Modelscited by 14
- 2022Codex Hacks HackerRank: Memorization Issues and a Framework for Code Synthesis Evaluationcited by 14
- 2023Benchmarking Causal Study to Interpret Large Language Models for Source Codecited by 14
50 most cited of 123 All 123 (JSON)
- 2026Activation Probes Surface Code-Security Signals that the Model's Output Misses10 Aug 2026
- 2026Revising RVL-CDIP: Quantifying Errors and Test-Train Overlap30 Jun 2026
- 2026Beyond Retrieval: A Multitask Benchmark and Model for Code Search6 May 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
- 2025Code2Doc: A Quality-First Curated Dataset for Code Documentation21 Dec 2025
- 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Bias24 Aug 2025
- 2025Smart-LLaMA-DPO: Reinforced Large Language Model for Explainable Smart Contract Vulnerability Detection23 Jun 2025
- 2025Improving Continual Pre-training Through Seamless Data Packing28 May 2025
- 2025CARES: Comprehensive Evaluation of Safety and Adversarial Robustness in Medical LLMs16 May 2025
- 2025AI-Mediated Code Comment Improvement13 May 2025
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Grounding27 Mar 2025
38 more
- 2025SnipGen: A Mining Repository Framework for Evaluating LLMs for Code10 Feb 2025
- 2025The Heap: A Contamination-Free Multilingual Code Dataset for Evaluating Large Language Models16 Jan 2025
- 2025SEDD: Scalable and Efficient Dataset Deduplication with GPUs2 Jan 2025
- 2024Direction for Detection: A Survey of Automated Vulnerability Detection and all of its Pain Points15 Dec 2024
- 2024Smart-LLaMA: Two-Stage Post-Training of Large Language Models for Smart Contract Vulnerability Detection and Explanation9 Nov 2024
- 2024Towards Trustworthy Machine Learning in Production: An Overview of the Robustness in MLOps Approach28 Oct 2024
- 2024RealVul: Can We Detect Vulnerabilities in Web Applications with LLM?10 Oct 2024
- 2024Selection of LLM Fine-Tuning Data based on Orthogonal Rules7 Oct 2024
- 2024Source Code Summarization in the Era of Large Language Models9 Jul 2024
- 2024SoftDedup: an Efficient Data Reweighting Method for Speeding Up Language Model Pre-training9 Jul 2024
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization1 Jul 2024
- 2024SimClone: Detecting Tabular Data Clones using Value Similarity24 Jun 2024
- 2024Morescient GAI for Software Engineering (Extended Version)7 Jun 2024
- 2024The Mosaic Memory of Large Language Models24 May 2024
- 2024Automated Program Repair: Emerging trends pose and expose problems for benchmarks8 May 2024
- 2024Quantifying Memorization and Detecting Training Data of Pre-trained Language Models using Japanese Newspaper26 Apr 2024
- 2024Multi-modal Learning for WebAssembly Reverse Engineering4 Apr 2024
- 2024Vulnerability Detection with Code Language Models: How Far Are We?27 Mar 2024
- 2024DISL: Fueling Research with A Large Dataset of Solidity Smart Contracts25 Mar 2024
- 2024Investigating the Performance of Language Models for Completing Code in Functional Programming Languages: a Haskell Case Study22 Mar 2024
- 2024CommitBench: A Benchmark for Commit Message Generation8 Mar 2024
- 2024Quantifying Contamination in Evaluating Code Generation Capabilities of Language Models6 Mar 2024
- 2024IRCoder: Intermediate Representations Make Language Models Robust Multilingual Code Generators6 Mar 2024
- 2024Language Models for Code Completion: A Practical Evaluation25 Feb 2024
- 2024SpanSeq: Similarity-based sequence data splitting method for improved development and assessment of deep learning projects22 Feb 2024
- 2024LLM4SecHW: Leveraging Domain Specific Large Language Model for Hardware Debugging28 Jan 2024
- 2023MathPile: A Billion-Token-Scale Pretraining Corpus for Math28 Dec 2023
- 2023SoUnD Framework: Analyzing (So)cial Representation in (Un)structured (D)ata28 Nov 2023
- 2023Learning Defect Prediction from Unrealistic Data2 Nov 2023
- 2023Rethinking Negative Pairs in Code Search12 Oct 2023
- 2023Test Case Recommendations with Distributed Representation of Code Syntactic Features4 Oct 2023
- 2023CAT-LM: Training Language Models on Aligned Code And Tests2 Oct 2023
- 2023Efficient Avoidance of Vulnerabilities in Auto-completed Smart Contract Code Using Vulnerability-constrained Decoding18 Sep 2023
- 2023CulturaX: A Cleaned, Enormous, and Multilingual Dataset for Large Language Models in 167 Languages17 Sep 2023
- 2023Revisiting File Context for Source Code Summarization5 Sep 2023
- 2023TpuGraphs: A Performance Prediction Dataset on Large Tensor Computational Graphs25 Aug 2023
- 2023Code Llama: Open Foundation Models for Code24 Aug 2023
- 2023Benchmarking Causal Study to Interpret Large Language Models for Source Code23 Aug 2023
50 newest of 123 All 123 (JSON)
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2023Code Llama: Open Foundation Models for Code24 Aug 2023
- 2022Competition-Level Code Generation with AlphaCode8 Feb 2022
- 2022Learning Graph Search Heuristicscited by 7
- 2022Learning Graph Search Heuristics7 Dec 2022
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2023The RefinedWeb Dataset for Falcon LLM: Outperforming Curated Corpora with Web Data, and Web Data Onlycited by 755
- 2021Deduplicating Training Data Makes Language Models Bettercited by 705
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2022A Systematic Evaluation of Large Language Models of Codecited by 360
- 2022The Stack: 3 TB of permissively licensed source codecited by 354
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 199
- 2023CulturaX: A Cleaned, Enormous, and Multilingual Dataset for Large Language Models in 167 Languagescited by 172
- 2023The BigScience ROOTS Corpus: A 1.6TB Composite Multilingual Datasetcited by 148
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 133
- 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 110
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
12 most cited of 116 All 116 (JSON)
- 2026Revising RVL-CDIP: Quantifying Errors and Test-Train Overlap30 Jun 2026
- 2026Beyond Retrieval: A Multitask Benchmark and Model for Code Search6 May 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
- 2025Code2Doc: A Quality-First Curated Dataset for Code Documentation21 Dec 2025
- 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Bias24 Aug 2025
- 2025Improving Continual Pre-training Through Seamless Data Packing28 May 2025
- 2025AI-Mediated Code Comment Improvement13 May 2025
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Grounding27 Mar 2025
- 2025SnipGen: A Mining Repository Framework for Evaluating LLMs for Code10 Feb 2025
- 2025The Heap: A Contamination-Free Multilingual Code Dataset for Evaluating Large Language Models16 Jan 2025
- 2025SEDD: Scalable and Efficient Dataset Deduplication with GPUs2 Jan 2025
12 newest of 116 All 116 (JSON)