Trained Without My Consent: Detecting Code Inclusion In Language Models Trained on Code
Not on the map. Why?
Abstract (arXiv)
Code auditing ensures that the developed code adheres to standards, regulations, and copyright protection by verifying that it does not contain code from protected sources. The recent advent of Large Language Models (LLMs) as coding assistants in the software development process poses new challenges for code auditing. The dataset for training these models is mainly collected from publicly available sources. This raises the issue of intellectual property infringement as developers' codes are already included in the dataset. Therefore, auditing code developed using LLMs is challenging, as it is difficult to reliably assert if an LLM used during development has been trained on specific copyrighted codes, given that we do not have access to the training datasets of these models. Given the non-disclosure of the training datasets, traditional approaches such as code clone detection are insufficient for asserting copyright infringement. To address this challenge, we propose a new approach, TraWiC; a model-agnostic and interpretable method based on membership inference for detecting code inclusion in an LLM's training dataset. We extract syntactic and semantic identifiers unique to each program to train a classifier for detecting code inclusion. In our experiments, we observe that TraWiC is capable of detecting 83.87% of codes that were used to train an LLM. In comparison, the prevalent clone detection tool NiCad is only capable of detecting 47.64%. In addition to its remarkable performance, TraWiC has low resource overhead in contrast to pair-wise clone detection that is conducted during the auditing process of tools like CodeWhisperer reference tracker, across thousands of code snippets.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). Builds on 38 of its 89 references that are in the map. First posted on arXiv 14 Feb 2024.
Builds on
38 of 89 references.
References · 38
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,355
- 2023Mistral 7Bcited by 3,065
- 2018Deep contextualized word representationscited by 2,285
- 2016Membership Inference Attacks against Machine Learning Modelscited by 2,221
- 2020Extracting Training Data from Large Language Modelscited by 2,144
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2019Language Models as Knowledge Bases?cited by 1,922
26 more
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,311
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
- 2018Exploiting Unintended Feature Leakage in Collaborative Learningcited by 509
- 2020Pre-trained Models for Natural Language Processing: A Surveycited by 504
- 2018ML-Leaks: Model and Data Independent Membership Inference Attacks and Defenses on Machine Learning Modelscited by 475
- 2022The Stack: 3 TB of permissively licensed source codecited by 354
- 2021Membership Inference Attacks on Machine Learning: A Surveycited by 306
- 2022Efficient Training of Language Models to Fill in the Middlecited by 248
- 2022Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language Modelscited by 218
- 2019Commonsense Knowledge Mining from Pretrained Modelscited by 189
- 2019MemGuard: Defending against Black-Box Membership Inference Attacks via Adversarial Examplescited by 183
- 2023SantaCoder: don't reach for the stars!cited by 169
- 2019Stolen Memories: Leveraging Model Memorization for Calibrated White-Box Membership Inferencecited by 168
- 2021Counterfactual Memorization in Neural Language Modelscited by 155
- 2023Speak, Memory: An Archaeology of Books Known to ChatGPT/GPT-4cited by 123
- 2018Understanding Membership Inferences on Well-Generalized Learning Modelscited by 83
- 2021Node-Level Membership Inference Attacks Against Graph Neural Networkscited by 80
- 2021Practical Blind Membership Inference Attack via Differential Comparisonscited by 73
- 2015SourcererCC: Scaling Code Clone Detection to Big Codecited by 40
- 2020Differentially Private Synthetic Data: Applied Evaluations and Enhancementscited by 36
- 2023Tools for Verifying Neural Models' Training Datacited by 21
- 2022To What Extent do Deep Learning-based Code Recommenders Generate Predictions by Cloning Code from the Training Set?cited by 11
- 2023Gotcha! This Model Uses My Code! Evaluating Membership Leakage Risks in Code Modelscited by 11
- 2013Double Ramp Loss Based Reject Option Classifiercited by 9
- 2021How Developers Choose Namescited by 3
- 2023Khaos: The Impact of Inter-procedural Code Obfuscation on Binary Diffing Techniquescited by 1
Built on by
Citing papers per year: 2024: 2; 2025: 5; 2026: 1.
8 papers.
- 2024Benchmark Data Contamination of Large Language Models: A Surveycited by 138
- 2025A Study of LLMs' Preferences for Libraries and Programming Languagescited by 20
- 2024Developer Perspectives on Licensing and Copyright Issues Arising from Generative AI for Software Developmentcited by 2
- 2026Pretraining Data Exposure in Large Language Models: A Survey of Membership Inference, Data Contamination, and Security Implicationscited by 1
- 2025CodeGenLink: A Tool to Find the Likely Origin and License of Automatically Generated Codecited by 0
- 2025Effective Code Membership Inference for Code Completion Models via Adversarial Promptscited by 0
- 2025Towards Privacy-Preserving Code Generation: Differentially Private Code Language Modelscited by 0
- 2025How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?cited by 0
- 2026Pretraining Data Exposure in Large Language Models: A Survey of Membership Inference, Data Contamination, and Security Implications21 May 2026
- 2025How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?17 Dec 2025
- 2025Towards Privacy-Preserving Code Generation: Differentially Private Code Language Models12 Dec 2025
- 2025Effective Code Membership Inference for Code Completion Models via Adversarial Prompts19 Nov 2025
- 2025CodeGenLink: A Tool to Find the Likely Origin and License of Automatically Generated Code1 Oct 2025
- 2025A Study of LLMs' Preferences for Libraries and Programming Languages21 Mar 2025
- 2024Developer Perspectives on Licensing and Copyright Issues Arising from Generative AI for Software Development16 Nov 2024
- 2024Benchmark Data Contamination of Large Language Models: A Survey6 Jun 2024