Uncovering LLM-Generated Code: A Zero-Shot Synthetic Code Detector via Code Rewriting
Tong Ye, Yangkai Du, Tengfei Ma, Lingfei Wu, Xuhong Zhang, Shouling Ji, Wenhai Wang
摘要
Large Language Models (LLMs) have demonstrated remarkable proficiency in generating code. However, the misuse of LLM-generated (synthetic) code has raised concerns in both educational and industrial contexts, underscoring the urgent need for synthetic code detectors. Existing methods for detecting synthetic content are primarily designed for general text and struggle with code due to the unique grammatical structure of programming languages and the presence of numerous ``low-entropy'' tokens. Building on this, our work proposes a novel zero-shot synthetic code detector based on the similarity between the original code and its LLM-rewritten variants. Our method is based on the observation that differences between LLM-rewritten and original code tend to be smaller when the original code is synthetic. We utilize self-supervised contrastive learning to train a code similarity model and evaluate our approach on two synthetic code detection benchmarks. Our results demonstrate a significant improvement over existing SOTA synthetic content detectors, delivering notable gains in both performance and robustness on the APPS and MBPP benchmarks.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper4
- Exploring ChatGPT's Capabilities on Vulnerability ManagementPeiyu Liu, Junming Liu, Lirong Fu, Kangjie Lu 等USENIX Security 2024 · 被引用 52 次
- Dynamic Bundling with Large Language Models for Zero-Shot Inference on Text-Attributed GraphsYusheng Zhao, Qixin Zhang, Xiao Luo, Weizhi Zhang 等NeurIPS 2025 · 被引用 4 次
- Chiseling Out Efficiency: Structured Skeleton Supervision for Efficient Code GenerationYu Yu, Zhihong Sun, Jia Li, Yao Wan 等FSE 2026
- CodeChemist: Test-Time Scaling for Low-Resource Code Generation via Functional Knowledge TransferKaiXin Wang, Tianlin Li, Xiaoyu Zhang, Aishan Liu 等ICML 2026
它引用的顶会 Paper15
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 被引用 22,562 次
- SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 被引用 2,496 次
- GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng 等ICLR 2021 · 被引用 1,644 次
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 被引用 1,224 次
- DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability CurvatureEric Mitchell, Yoonho Lee, Alexander Khazatsky, Christopher D. Manning 等ICML 2023 · 被引用 988 次
相关 Paper
- DualCodeDetect: Zero-Shot LLM-Generated Code Detection via Dual-Channel PerturbationZhengdao Li, Xiuwei Shang, Zhenkan Fu, Shikai Guo 等FSE 2026
- DeTeCtive: Detecting AI-generated Text via Multi-Level Contrastive LearningXun Guo, Yongxin He, Shan Zhang, Ting Zhang 等NeurIPS 2024 · 被引用 100 次
- Detecting Semantic Clones of Unseen FunctionalityKonstantinos Kitsios, Francesco Sovrano, Earl T. Barr, Alberto BacchelliASE 2025 · 被引用 1 次
- Zero-Shot Detection of LLM-Generated Text via Implicit Reward ModelRunheng Liu, Heyan Huang, Xingchen Xiao, Zhijing WuNeurIPS 2025 · 被引用 7 次
- An Empirical Study to Evaluate AIGC Detectors on Code ContentJian Wang, Shangqing Liu, Xiaofei Xie, Yi LiASE 2024 · 被引用 4 次
