atlas

Research map / Large language models / Language, safety and interpretability

ChatGPT-Generated Code Assignment Detection Using Perplexity of Large Language Models (Student Abstract)

AAAI 2024 · Large language models › Language, safety and interpretability · approach: Zero-shot machine-text detection · 12 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes CGCode Detector, a zero-shot detector for ChatGPT-generated code that scores code by perplexity, line-level perplexity variation, and burstiness after targeted masking perturbations refilled by a fine-tuned CodeBERT.

Problem

Detecting ChatGPT-generated programming assignments to protect academic integrity, a setting where existing text detectors were designed for natural language rather than code.

Approach

Adapts DetectGPT-style perturbation to code: masks high-perplexity lines more heavily, refills masks with a fine-tuned CodeBERT, and scores the original code by overall perplexity, cross-line perplexity deviation, and burstiness, where model-generated code ranks stably low.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use CGCode Detector instead of GPTZeroCode detection · CAUC: 0.90 -> 0.95Helped
Use CGCode Detector instead of GPTZeroCode detection · C++AUC: 0.83 -> 0.88Helped
Use CGCode Detector instead of WriterCode detection · C#AUC: 0.52 -> 0.86Helped
Use CGCode Detector instead of WriterCode detection · JavaAUC: 0.54 -> 0.82Helped
Use CGCode Detector instead of WriterCode detection · JavaScriptAUC: 0.56 -> 0.81Helped
Use CGCode Detector instead of GPTZeroCode detection · PythonAUC: 0.59 -> 0.92Helped
Use CGCode Detector instead of GPTZeroCode detection · Average across programming languagesAUC: 0.56 to 0.87Helped

Surprising findings

Limitations

Experimental setup

Datasets: IBM CodeNet CGCode

Benchmarks: CGCode

Metrics: AUC FPR FNR

Baselines: GPT2-Detector DetectGPT RoBERTa-QA GPTZero Writer

Builds on: DetectGPT CodeBERT GPTZero

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy