Skip to main content
QUICK REVIEW

[Paper Review] Assessing AI Detectors in Identifying AI-Generated Code: Implications for Education

Wei Pan, Ming Jie Chok|arXiv (Cornell University)|Jan 8, 2024
Artificial Intelligence in Healthcare and Education6 citations
TL;DR

The paper empirically evaluates five AI-generated-content (AIGC) detectors on AI-generated Python code across 13 prompt variants, using a 5,069-sample dataset, and finds detectors perform poorly at distinguishing human-written from AI-generated code and are sensitive to code variants.

ABSTRACT

Educators are increasingly concerned about the usage of Large Language Models (LLMs) such as ChatGPT in programming education, particularly regarding the potential exploitation of imperfections in Artificial Intelligence Generated Content (AIGC) Detectors for academic misconduct. In this paper, we present an empirical study where the LLM is examined for its attempts to bypass detection by AIGC Detectors. This is achieved by generating code in response to a given question using different variants. We collected a dataset comprising 5,069 samples, with each sample consisting of a textual description of a coding problem and its corresponding human-written Python solution codes. These samples were obtained from various sources, including 80 from Quescol, 3,264 from Kaggle, and 1,725 from LeetCode. From the dataset, we created 13 sets of code problem variant prompts, which were used to instruct ChatGPT to generate the outputs. Subsequently, we assessed the performance of five AIGC detectors. Our results demonstrate that existing AIGC Detectors perform poorly in distinguishing between human-written code and AI-generated code.

Motivation & Objective

  • Assess how well existing AIGC detectors identify AI-generated code in programming tasks.
  • Investigate detector limitations under diverse code and prompt variants.
  • Provide empirical data to inform educational integrity practices and detector use.

Proposed method

  • Assemble a dataset of 5,069 samples comprising problem descriptions and human-written Python solutions from Quescol, Kaggle, and LeetCode.
  • Create 13 AI-generated code variants by prompting ChatGPT with variant prompts.
  • Apply five AIGC detectors to classify code as human- or AI-generated using a 0.5 decision threshold.
  • Evaluate detectors using accuracy, precision, TPR, FPR, TNR, and FNR across all variants.
  • Provide a replication package and document the workflow in Algorithmic steps for replicability.

Experimental results

Research questions

  • RQ1RQ1: How accurate are existing AIGC Detectors at detecting AI-generated code?
  • RQ2RQ2: What are the limitations of existing AIGC Detectors when it comes to detecting AI-generated code.

Key findings

  • All five detectors show poor accuracy in distinguishing human-written vs AI-generated code (ACC around 0.5 for several detectors).
  • GLTR shows significant sensitivity to variants, with ACC ranging from 0.4841 to 0.7693 across variants.
  • DetectGPT improves true negative rate (TNR) by 5–9 percentage points relative to some baselines, but overall remains limited.
  • Sapling consistently achieves ACC above 0.6 in many variants, showing relative robustness to certain variants.
  • GPTZero and GPT-2 Detector generally hover around baseline performance with low true negative rates in many variants.
  • Variant-induced changes (e.g., removing stopwords, naming alterations, dead code) can substantially affect detector performance.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.