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
本文研究如何区分人类代码与 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.
From Code to Compliance: Assessing ChatGPT's Utility in Designing an Accessible Webpage -- A Case Study
Department of Computer Science, Norwegian University of Science and Technology(计算机科学系,挪威科学技术大学);Department of Design, Norwegian University of Science and Technology(设计系,挪威科学技术大学)
Exploring the Limits of ChatGPT in Software Security Applications
University of Michigan, Ann Arbor(密歇根大学安娜堡分校);ASU(亚利桑那州立大学);Washington University in St. Louis(圣路易斯华盛顿大学);University of Wisconsin, Madison(威斯康星大学麦迪逊分校)
A Systematic Study and Comprehensive Evaluation of ChatGPT on Benchmark Datasets
York University(约克大学);Nanyang Technological University(南洋理工大学);Dialpad Canada Inc.(Dialpad加拿大公司);Royal Bank of Canada(加拿大皇家银行);Salesforce Research(赛富时研究院)
Identifying the Achilles' Heel: An Iterative Method for Dynamically Uncovering Factual Errors in Large Language Models
Renmin University of China(中国人民大学);The Chinese University of Hong Kong(香港中文大学);The Chinese University of Hong Kong, Shenzhen(香港中文大学深圳校区);Johns Hopkins University(约翰霍普金斯大学);Nanyang Technological University(南洋理工大学);Xiaohongshu Inc.(小红书公司);Tencent Inc.(腾讯公司)
University of California, Los Angeles(加州大学洛杉矶分校);Nanyang Technological University(南洋理工大学);University of California, Davis(加州大学戴维斯分校);National University of Singapore(新加坡国立大学);Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州))