Code Fingerprints: Disentangled Attribution of LLM-Generated Code

📅 2026-03-04
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenge of code provenance in the era of large language models (LLMs), where the widespread use of LLM-generated code complicates critical software governance tasks such as vulnerability tracking, incident investigation, and license compliance. To tackle this issue, we propose a model-level code attribution method that leverages distinctive stylistic “fingerprints” left by different LLMs due to variations in training data, architecture, and decoding strategies. We introduce the first comprehensive benchmark dataset encompassing multiple LLMs—including DeepSeek, Claude, Qwen, and ChatGPT—and multiple programming languages—Python, Java, C, and Go. Furthermore, we present the Disentangled Code Attribution Network (DCAN), a contrastive learning–based approach that separates source-agnostic semantic features from source-specific stylistic features. Our method significantly improves multi-class attribution accuracy across models and languages, demonstrating the feasibility and effectiveness of LLM code provenance.

Technology Category

Application Category

📝 Abstract
The rapid adoption of Large Language Models (LLMs) has transformed modern software development by enabling automated code generation at scale. While these systems improve productivity, they introduce new challenges for software governance, accountability, and compliance. Existing research primarily focuses on distinguishing machine-generated code from human-written code; however, many practical scenarios--such as vulnerability triage, incident investigation, and licensing audits--require identifying which LLM produced a given code snippet. In this paper, we study the problem of model-level code attribution, which aims to determine the source LLM responsible for generated code. Although attribution is challenging, differences in training data, architectures, alignment strategies, and decoding mechanisms introduce model-dependent stylistic and structural variations that serve as generative fingerprints. Leveraging this observation, we propose the Disentangled Code Attribution Network (DCAN), which separates Source-Agnostic semantic information from Source-Specific stylistic representations. Through a contrastive learning objective, DCAN isolates discriminative model-dependent signals while preserving task semantics, enabling multi-class attribution across models and programming languages. To support systematic evaluation, we construct the first large-scale benchmark dataset comprising code generated by four widely used LLMs (DeepSeek, Claude, Qwen, and ChatGPT) across four programming languages (Python, Java, C, and Go). Experimental results demonstrate that DCAN achieves reliable attribution performance across diverse settings, highlighting the feasibility of model-level provenance analysis in software engineering contexts. The dataset and implementation are publicly available at https://github.com/mtt500/DCAN.
Problem

Research questions and friction points this paper is trying to address.

code attribution
large language models
software provenance
model fingerprinting
LLM-generated code
Innovation

Methods, ideas, or system contributions that make the work stand out.

code attribution
disentangled representation
large language models
contrastive learning
software provenance
🔎 Similar Papers
No similar papers found.
J
Jiaxun Guo
School of Cyber Science and Engineering, Sichuan University, Chengdu, China
Ziyuan Yang
Ziyuan Yang
The Chinese University of Hong Kong
CVMedical ImagingSecurity & PrivacyEfficient Learning
Mengyu Sun
Mengyu Sun
Sichuan University
H
Hui Wang
School of Cyber Science and Engineering, Sichuan University, Chengdu, China
Jingfeng Lu
Jingfeng Lu
Sichuan University
Yi Zhang
Yi Zhang
Sichuan University
Medical Imaging