EX-CODE: A Robust and Explainable Model to Detect AI-Generated Code

Distinguishing whether some code portions were implemented by humans or generated by a tool based on artificial intelligence has become hard. However, such a classification would be important as it could point developers towards some further validation for the produced code. Additionally, it holds significant importance in security, legal contexts, and educational settings, where upholding academic integrity is of utmost importance. We present EX-CODE, a novel and explainable model that leverages the probability of the occurrence of some tokens, within a code snippet, estimated according to a language model, to distinguish human-written from AI-generated code. EX-CODE has been evaluated on a heterogeneous real-world dataset and stands out for its ability to provide human-understandable explanations of its outcomes. It achieves this by uncovering the features that for a snippet of code make it classified as human-written code (or AI-generated code).

Authors

Institutions

Publication Details

Journal
Information
Published
2024-12-20
DOI
https://doi.org/10.3390/info15120819
Citations
5
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
3.90

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

EX-CODE: A Robust and Explainable Model to Detect AI-Generated Code

Misael Mongiovı̀, Emiliano Tramontana, Alessandro Midolo, Luana Bulla
5 citations
Information
Software Engineering Research
3.90
article

EX-CODE: A Robust and Explainable Model to Detect AI-Generated Code

Misael Mongiovı̀, Emiliano Tramontana, Alessandro Midolo, Luana Bulla
article en
5 citations

Abstract

Distinguishing whether some code portions were implemented by humans or generated by a tool based on artificial intelligence has become hard. However, such a classification would be important as it could point developers towards some further validation for the produced code. Additionally, it holds significant importance in security, legal contexts, and educational settings, where upholding academic integrity is of utmost importance. We present EX-CODE, a novel and explainable model that leverages the probability of the occurrence of some tokens, within a code snippet, estimated according to a language model, to distinguish human-written from AI-generated code. EX-CODE has been evaluated on a heterogeneous real-world dataset and stands out for its ability to provide human-understandable explanations of its outcomes. It achieves this by uncovering the features that for a snippet of code make it classified as human-written code (or AI-generated code).

InformationVol. 15(12)
University of Catania (IT)
Università di Catania
Peace, Justice and strong institutions
Openalex Percentile: Top 5%
Software Engineering Research
3.90
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.