arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2405.15512cs.LGcs.AI
收藏

ChatGPT 代码检测:揭示代码来源的技术

ChatGPT Code Detection: Techniques for Uncovering the Source of Code

Cologne Institute of Computer Science, Faculty of Computer Science(科隆计算机科学学院计算机科学研究所);Faculty of Computer Science and Engineering Science, TH Köln(科隆工业大学计算机科学与工程学院);Faculty of Medicine, Ruhr-University Bochum(波鸿鲁尔大学医学院)

Marc Oedingen, Raphael C. Engelhardt, Robin Denz, Maximilian Hammer, Wolfgang Konen

AI总结:

本文研究如何区分人类代码与 ChatGPT 生成代码,提出结合嵌入特征与监督学习的方法,准确率达 98%,并引入可解释贝叶斯分类器,旨在降低 AI 代码生成在教育和开发中的滥用风险。

摘要:

近年来,大语言模型(LLMs)在生成计算机代码方面取得了显著进展,使得人类编写的代码与人工智能(AI)生成的代码之间的界限变得模糊。随着这些技术的快速发展,探索它们如何影响代码生成至关重要,尤其是在高等教育等领域存在滥用风险的背景下。本文通过使用先进的分类技术来区分人类编写的代码与 ChatGPT(一种大语言模型)生成的代码,从而探讨这一问题。我们采用一种新方法,将强大的嵌入特征(黑盒)与监督学习算法相结合——包括深度神经网络、随机森林和极端梯度提升——以高达 98% 的惊人准确率实现这种区分。对于成功的组合,我们还检验了它们的模型校准情况,结果表明其中一些模型校准得非常好。此外,我们提出了白盒特征和一个可解释的贝叶斯分类器,以阐明代码来源之间的关键差异,从而增强我们方法的可解释性和透明度。两种方法均表现良好,但准确率最高仅为 85-88%。我们还表明,未经训练的人类在完成相同任务时的表现并不优于随机猜测。这项研究对于理解和减轻在代码生成中使用 AI 所带来的潜在风险至关重要,特别是在高等教育、软件开发和竞赛编程的背景下。

英文摘要:

In recent times, large language models (LLMs) have made significant strides in generating computer code, blurring the lines between code created by humans and code produced by artificial intelligence (AI). As these technologies evolve rapidly, it is crucial to explore how they influence code generation, especially given the risk of misuse in areas like higher education. This paper explores this issue by using advanced classification techniques to differentiate between code written by humans and that generated by ChatGPT, a type of LLM. We employ a new approach that combines powerful embedding features (black-box) with supervised learning algorithms - including Deep Neural Networks, Random Forests, and Extreme Gradient Boosting - to achieve this differentiation with an impressive accuracy of 98%. For the successful combinations, we also examine their model calibration, showing that some of the models are extremely well calibrated. Additionally, we present white-box features and an interpretable Bayes classifier to elucidate critical differences between the code sources, enhancing the explainability and transparency of our approach. Both approaches work well but provide at most 85-88% accuracy. We also show that untrained humans solve the same task not better than random guessing. This study is crucial in understanding and mitigating the potential risks associated with using AI in code generation, particularly in the context of higher education, software development, and competitive programming.

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

↑