未经我同意即被训练:检测在代码上训练的语言模型中的代码纳入情况
Trained Without My Consent: Detecting Code Inclusion In Language Models Trained on Code
AI总结:
针对大语言模型训练数据集不公开导致代码版权侵权难判定的问题,提出基于成员推理的模型无关可解释方法TraWiC,检测准确率达83.87%,远超传统工具且资源开销更低。
摘要:
代码审计通过验证开发的代码不包含受保护来源的代码,确保其符合标准、法规及版权保护要求。近期,大语言模型(LLMs)作为编码助手进入软件开发流程,给代码审计带来了新挑战。训练这些模型的数据集主要从公开来源收集,这引发了知识产权侵权问题,因为开发者的代码已被纳入数据集之中。因此,使用LLM开发的代码的审计工作颇具难度——由于我们无法获取这些模型的训练数据集,很难可靠地断定开发过程中所用的LLM是否曾在特定受版权保护的代码上训练。鉴于训练数据集不公开,代码克隆检测等传统方法不足以判定版权侵权。为应对这一挑战,我们提出了一种新方法TraWiC:这是一种基于成员推理的模型无关且可解释的方法,用于检测LLM训练数据集中的代码纳入情况。我们提取每个程序独有的句法和语义标识符,以训练一个用于检测代码纳入的分类器。在实验中我们观察到,TraWiC能够检测出83.87%曾用于训练LLM的代码;相比之下,主流的克隆检测工具NiCad仅能检测出47.64%。除了出色的性能外,与CodeWhisperer参考跟踪器等工具在审计过程中对数千个代码片段执行的成对克隆检测相比,TraWiC的资源开销更低。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。