arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2502.15740cs.SEcs.AIcs.CLcs.LG
收藏

检测使用离散化嵌套二元组生成的 LLM Java 代码

Detection of LLM-Generated Java Code Using Discretized Nested Bigrams

Timothy Paek, Chilukuri Mohan

AI总结:

提出离散化嵌套二元组频率特征,用于检测 LLM 生成的 Java 代码,在多个数据集上显著优于现有方法,准确率高达 99%。

摘要:

大型语言模型(LLMs)目前被专业人士和学生广泛用于生成代码,这推动了开发用于检测 LLM 生成代码的工具,以应用于学术诚信和网络安全等领域。我们将这一作者归属问题视为一个二分类任务,并同时进行特征识别与提取。我们提出了新的离散化嵌套二元组频率特征,应用于不同大小的源代码组。与先前工作相比,通过将稀疏信息表示为密集的成员区间,我们获得了改进。实验评估表明,我们的方法显著优于常用的 GPT 代码检测 API 和基线特征,在检测 976 个文件(使用 GPT 3.5 和 GPT4 生成的 GPT 重写 Java 代码片段)时,使用 12 个特征,准确率超过 96%,而对比方法的准确率分别为 72% 和 79%。在包含 40 位作者的数据集上,我们在代码作者识别方面也优于三项先前工作。我们的方法能很好地扩展到更大的数据集,在使用 227 个特征对 76,089 个文件和超过 1,000 位作者(使用 GPT 4o)的实验中,我们达到了 99% 的准确率和 0.999 的 AUC。

英文摘要:

Large Language Models (LLMs) are currently used extensively to generate code by professionals and students, motivating the development of tools to detect LLM-generated code for applications such as academic integrity and cybersecurity. We address this authorship attribution problem as a binary classification task along with feature identification and extraction. We propose new Discretized Nested Bigram Frequency features on source code groups of various sizes. Compared to prior work, improvements are obtained by representing sparse information in dense membership bins. Experimental evaluation demonstrated that our approach significantly outperformed a commonly used GPT code-detection API and baseline features, with accuracy exceeding 96% compared to 72% and 79% respectively in detecting GPT-rewritten Java code fragments for 976 files with GPT 3.5 and GPT4 using 12 features. We also outperformed three prior works on code author identification in a 40-author dataset. Our approach scales well to larger data sets, and we achieved 99% accuracy and 0.999 AUC for 76,089 files and over 1,000 authors with GPT 4o using 227 features.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑