An Exploratory Investigation into Code License Infringements in Large Language Model Training Datasets
Not on the map. Why?
Abstract (arXiv)
Does the training of large language models potentially infringe upon code licenses? Furthermore, are there any datasets available that can be safely used for training these models without violating such licenses? In our study, we assess the current trends in the field and the importance of incorporating code into the training of large language models. Additionally, we examine publicly available datasets to see whether these models can be trained on them without the risk of legal issues in the future. To accomplish this, we compiled a list of 53 large language models trained on file-level code. We then extracted their datasets and analyzed how much they overlap with a dataset we created, consisting exclusively of strong copyleft code. Our analysis revealed that every dataset we examined contained license inconsistencies, despite being selected based on their associated repository licenses. We analyzed a total of 514 million code files, discovering 38 million exact duplicates present in our strong copyleft dataset. Additionally, we examined 171 million file-leading comments, identifying 16 million with strong copyleft licenses and another 11 million comments that discouraged copying without explicitly mentioning a license. Based on the findings of our study, which highlights the pervasive issue of license inconsistencies in large language models trained on code, our recommendation for both researchers and the community is to prioritize the development and adoption of best practices for dataset creation and management.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). Builds on 18 of its 40 references that are in the map. First posted on arXiv 22 Mar 2024.
Builds on
18 of 40 references.
References · 18
- 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,694
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2022The Stack: 3 TB of permissively licensed source codecited by 354
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
- 2021Membership Inference Attacks on Machine Learning: A Surveycited by 306
- 2023Software Testing with Large Language Models: Survey, Landscape, and Visioncited by 163
- 2022Large Language Models Meet NL2Code: A Surveycited by 135
- 2022Preventing Verbatim Memorization in Language Models Gives a False Sense of Privacycited by 97
- 2023At Which Training Stage Does Code Data Help LLMs Reasoning?cited by 82
6 more
- 2023DEPN: Detecting and Editing Privacy Neurons in Pretrained Language Modelscited by 75
- 2023A Bibliometric Review of Large Language Models Research from 2017 to 2023cited by 56
- 2023Traces of Memorisation in Large Language Models for Codecited by 26
- 2023Gotcha! This Model Uses My Code! Evaluating Membership Leakage Risks in Code Modelscited by 11
- 2023The (ab)use of Open Source Code to Train Large Language Modelscited by 9
- 2023Targeted Attack on GPT-Neo for the SATML Language Model Data Extraction Challengecited by 7
Built on by
Citing papers per year: 2025: 6; 2026: 2.
8 papers.
- 2025The Heap: A Contamination-Free Multilingual Code Dataset for Evaluating Large Language Modelscited by 4
- 2025Do Not Trust Licenses You See: Dataset Compliance Requires Massive-Scale AI-Powered Lifecycle Tracingcited by 3
- 2026Model See, Model Do? Exposure-Aware Evaluation of Bug-vs-Fix Preference in Code LLMscited by 1
- 2025Malicious and Unintentional Disclosure Risks in Large Language Models for Code Generationcited by 0
- 2025DevLicOps: A Framework for Mitigating Licensing Risks in AI-Generated Codecited by 0
- 2025CodeGenLink: A Tool to Find the Likely Origin and License of Automatically Generated Codecited by 0
- 2025How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?cited by 0
- 2026AST-PAC: AST-guided Membership Inference for Codecited by 0
- 2026AST-PAC: AST-guided Membership Inference for Code30 Jan 2026
- 2026Model See, Model Do? Exposure-Aware Evaluation of Bug-vs-Fix Preference in Code LLMs15 Jan 2026
- 2025How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?17 Dec 2025
- 2025CodeGenLink: A Tool to Find the Likely Origin and License of Automatically Generated Code1 Oct 2025
- 2025DevLicOps: A Framework for Mitigating Licensing Risks in AI-Generated Code23 Aug 2025
- 2025Malicious and Unintentional Disclosure Risks in Large Language Models for Code Generation27 Mar 2025
- 2025Do Not Trust Licenses You See: Dataset Compliance Requires Massive-Scale AI-Powered Lifecycle Tracing4 Mar 2025
- 2025The Heap: A Contamination-Free Multilingual Code Dataset for Evaluating Large Language Models16 Jan 2025