Reproduce “Zero-Shot Detection of Machine-Generated Codes” on OpenResearch
Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Xianjun Yang, Kexun Zhang, Haifeng Chen, Linda Petzold, William Yang Wang, Wei Cheng
A zero-shot method, DetectGPT4Code, identifies machine-generated code from black-box large language models like GPT-4. It significantly outperforms existing text detectors on various programming languages and datasets.
Key insights
- Generic text detectors are ineffective for code, highlighting the distinct statistical properties and lower entropy of machine-generated code.
- Focusing on the rightmost portion of code (where LLM generation tends to be more deterministic) is crucial for accurate detection.
- Surprisingly, smaller, specialized code language models (e.g., PolyCoder-160M) serve as more effective universal surrogate detectors for black-box code than larger models or general text models.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.