DIFFERENCE BETWEEN HUMAN AND AI-GENERATED CODE

The emergence of artificial intelligence (AI) in software engineering has profoundly transformed the programming domain, with AI-driven code generation platforms such as GitHub Copilot and OpenAI Codex facilitating swift and automated code creation. Nonetheless, the disparities between AI-generated and human-crafted code remain a vital area of investigation. This research delves into techniques to distinguish between them, emphasizing lexical, syntactic, and semantic attributes. A thorough dataset comprising code snippets from various programming languages was compiled and examined through machine learning algorithms, including Support Vector Machines (SVM), Random Forest (RF), and XGBoost (XGB). Findings suggest that AI-generated code often presents foreseeable patterns, structured syntax, and uniform keyword utilization, whereas human-authored code demonstrates greater diversity, originality, and adaptability in problem-solving. Syntactic aspects, particularly control flow intricacy and nesting levels, proved to be the most effective in differentiation, with the combined feature set achieving an accuracy of 92.8%. Despite these encouraging results, challenges such as evolving AI algorithms and dataset constraints persist. This study highlights the necessity for robust identification frameworks to uphold code quality, sustainability, and ethical compliance in AI-supported programming environments.

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2025-02-06
DOI
https://doi.org/10.5281/zenodo.14826524
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

DIFFERENCE BETWEEN HUMAN AND AI-GENERATED CODE

Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research
article

DIFFERENCE BETWEEN HUMAN AND AI-GENERATED CODE

article en

Abstract

The emergence of artificial intelligence (AI) in software engineering has profoundly transformed the programming domain, with AI-driven code generation platforms such as GitHub Copilot and OpenAI Codex facilitating swift and automated code creation. Nonetheless, the disparities between AI-generated and human-crafted code remain a vital area of investigation. This research delves into techniques to distinguish between them, emphasizing lexical, syntactic, and semantic attributes. A thorough dataset comprising code snippets from various programming languages was compiled and examined through machine learning algorithms, including Support Vector Machines (SVM), Random Forest (RF), and XGBoost (XGB). Findings suggest that AI-generated code often presents foreseeable patterns, structured syntax, and uniform keyword utilization, whereas human-authored code demonstrates greater diversity, originality, and adaptability in problem-solving. Syntactic aspects, particularly control flow intricacy and nesting levels, proved to be the most effective in differentiation, with the combined feature set achieving an accuracy of 92.8%. Despite these encouraging results, challenges such as evolving AI algorithms and dataset constraints persist. This study highlights the necessity for robust identification frameworks to uphold code quality, sustainability, and ethical compliance in AI-supported programming environments.

Zenodo (CERN European Organization for Nuclear Research)
Responsible consumption and production
Openalex Percentile: Top 43%
Software Engineering Research
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.