返回
MAGECODE: Machine-Generated Code Detection Method Using Large Language Models
DOI:10.1109/ACCESS.2024.3509987.png)
摘要
En 中文
The widespread use of virtual assistants (e.g., GPT4 and Gemini, etc.) by students in their academic assignments raises concerns about academic integrity. Consequently, various machine-generated text (MGT) detection methods, developed from metric-based and model-based approaches, were proposed and shown to be highly effective. The model-based MGT methods often encounter difficulties when dealing with source code due to disparities in semantics compared to natural languages. Meanwhile, the efficacy of metric-based MGT methods on source code has not been investigated. Moreover, the challenge of identifying machine-generated codes (MGC) has received less attention, and existing solutions demonstrate low accuracy and high false positive rates across diverse human-written codes. In this paper, we take into account both semantic features extracted from Large Language Models (LLMs) and the applicability of metrics (e.g., Log-Likelihood, Rank, Log-rank, etc.) for source code analysis. Concretely, we propose MageCode, a novel method for identifying machine-generated codes. MageCode utilizes the pre-trained model CodeT5+ to extract semantic features from source code inputs and incorporates metric-based techniques to enhance accuracy. In order to assess the proposed method, we introduce a new dataset comprising more than 45,000 code solutions generated by LLMs for programming problems. The solutions for these programming problems which were obtained from three advanced LLMs (GPT4, Gemini, and Code-bison-32k), were written in Python, Java, and C++. The evaluation of MageCode on this dataset demonstrates superior performance compared to existing baselines, achieving up to 98.46% accuracy while maintaining a low false positive rate of less than 1%.
Keyword:
Codes
Source coding
Computer architecture
Transformers
Programming profession
Large language models
Feature extraction
Measurement
Computational modeling
Python
Machine-generated code detection
large language model
metrics
CodeT5+
期刊
IF:
3.6
论文数:
9.8W
被引数:
29.4W
机构
引用论文
Research on the Efficiency of Wireless Power Transfer System Based on Multi-Auxiliary Transmitting Coils基于多辅助发射线圈的无线电能传输系统效率研究
Students’ Experiences of Using ChatGPT in an Undergraduate Programming Course学生在本科编程课程中使用ChatGPT的经验
IEEE ACCESS
IF3.6
没有更多内容

