arrow
返回

MAGECODE: Machine-Generated Code Detection Method Using Large Language Models

delete2024-01-01
delete0
delete
OA
AI
H
Hung N. Pham
H
Huyen Ha
T
Tong, Van
D
Dung Hoang Tien
D
Duc Tran *
N
Ngoc Tuyen Le *
DOI:10.1109/ACCESS.2024.3509987delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

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+

期刊

IEEE Access 封面图
IEEE Access
IF:
3.6
论文数:
9.8W
被引数:
29.4W

机构

H
hanoi university of science & technology (hust)
学者数:
3.3K
论文数: 2.2K
被引数: 1
M
Ming Chi University of Technology
学者数:
2.3K
论文数: 2.3K
被引数: 3.4K
引用论文

引用论文

Regioselectivity of the ring opening in the reaction of phenyloxirane, (phenylmethyl)oxirane and (2-phenylethyl)oxirane with K−, K+(15-crown-5)2
err2003-04-01
err0
PREAI
errZbigniew Grobelny; Andrzej Stolarzewicz; Barbara Morejko-Buż; Adalbert Maercker; Stanisław; Krompiec; Tadeusz Bieg
err分享
err收藏
Variable effects of temperature on insect herbivory温度对昆虫食草的可变影响
err2014-05-06
err0
errOAAI
errNathan P. Lemoine; Deron E. Burkepile; John D. Parker
err分享
err收藏
The HadGEM2-ES implementation of CMIP5 centennial simulationsCMIP5百年模拟的HadGEM2-ES实现
err
IF0
err2011-03-31
err0
errOAAI
errC. D. Jones; J. K. Hughes; N. Bellouin; S. C. Hardiman; G. S. Jones; J. Knight; S. Liddicoat; F. M. O'Connor; R. J. Andres; C. Bell; K.-O. Boo; A. Bozzo; N. Butchart; P. Cadule; K. D. Corbin; M. Doutriaux-Boucher; P. Friedlingstein; J. Gornall; L. Gray; P. R. Halloran; G. Hurtt; W. Ingram; J.-F. Lamarque; R. M. Law; M. Meinshausen; S. Osprey; E. J. Palin; L. Parsons Chini; T. Raddatz; M. Sanderson; A. A. Sellar; A. Schurer; P. Valdes; N. Wood; S. Woodward; M. Yoshioka; M. Zerroukat
err分享
err收藏
没有更多内容