CodeMirage: A Multi-Lingual Benchmark for Detecting AI-Generated and Paraphrased Source Code from Production-Level LLMs
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have become integral to modern software development, producing vast amounts of AI-generated source code. While these models boost programming productivity, their misuse introduces critical risks, including code plagiarism, license violations, and the propagation of insecure programs. As a result, robust detection of AI-generated code is essential. To support the development of such detectors, a comprehensive benchmark that reflects real-world conditions is crucial. However, existing benchmarks fall short -- most cover only a limited set of programming languages and rely on less capable generative models. In this paper, we present CodeMirage, a comprehensive benchmark that addresses these limitations through three major advancements: (1) it spans ten widely used programming languages, (2) includes both original and paraphrased code samples, and (3) incorporates outputs from ten state-of-the-art production-level LLMs, including both reasoning and non-reasoning models from six major providers. Using CodeMirage, we evaluate ten representative detectors across four methodological paradigms under four realistic evaluation configurations, reporting results using three complementary metrics. Our analysis reveals nine key findings that uncover the strengths and weaknesses of current detectors, and identify critical challenges for future work. We believe CodeMirage offers a rigorous and practical testbed to advance the development of robust and generalizable AI-generated code detectors.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 57 of its 93 references that are in the map. First posted on arXiv 27 May 2025.
Builds on
57 of 93 references.
References · 57
- 2017Attention Is All You Needcited by 60,361
- 2020Denoising Diffusion Probabilistic Modelscited by 21,076
- 2023GPT-4 Technical Reportcited by 18,396
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2015Deep Unsupervised Learning using Nonequilibrium Thermodynamicscited by 7,058
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2024Qwen2.5-Coder Technical Reportcited by 1,203
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agentscited by 1,002
- 2021Membership Inference Attacks From First Principlescited by 878
38 more
- 2023DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvaturecited by 726
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2019GLTR: Statistical Detection and Visualization of Generated Textcited by 496
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 431
- 2023Paraphrasing evades detectors of AI-generated text, but retrieval is an effective defensecited by 429
- 2023Can AI-Generated Text be Reliably Detected?cited by 386
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 333
- 2023GenImage: A Million-Scale Benchmark for Detecting AI-Generated Imagecited by 321
- 2024Spotting LLMs With Binoculars: Zero-Shot Detection of Machine-Generated Textcited by 263
- 2019Automatic Detection of Generated Text is Easiest when Humans are Fooledcited by 261
- 2021WildDeepfake: A Challenging Real-World Dataset for Deepfake Detectioncited by 209
- 2021TURINGBENCH: A Benchmark Environment for Turing Test in the Age of Neural Text Generationcited by 120
- 2018FaceForensics: A Large-scale Video Dataset for Forgery Detection in Human Facescited by 119
- 2023How Secure is Code Generated by ChatGPT?cited by 81
- 2022Is GitHub's Copilot as Bad as Humans at Introducing Vulnerabilities in Code?cited by 67
- 2022Out of the BLEU: how should we assess quality of the Code Generation models?cited by 65
- 2023On the Robustness of Code Generation Techniques: An Empirical Study on GitHub Copilotcited by 64
- 2024Bugs in Large Language Models Generated Code: An Empirical Studycited by 60
- 2024Raidar: geneRative AI Detection viA Rewritingcited by 52
- 2023What Makes Good In-context Demonstrations for Code Intelligence Tasks with LLMs?cited by 47
- 2023Will ChatGPT get you caught? Rethinking of Plagiarism Detectioncited by 41
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 40
- 2024CodeXEmbed: A Generalist Embedding Model Family for Multiligual and Multi-task Code Retrievalcited by 34
- 2023Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attackscited by 33
- 2024Between Lines of Code: Unraveling the Distinct Patterns of Machine and Human Programmerscited by 27
- 2024Toward Secure Code Generation: Bridging Correctness and Security via Task-Adaptive Vulnerability Modeling and Execution-Based Benchmarkingcited by 27
- 2023Zero-Shot Detection of Machine-Generated Codescited by 24
- 2024How secure is AI-generated Code: A Large-Scale Comparison of Large Language Modelscited by 24
- 2024LLMs in Web Development: Evaluating LLM-Generated PHP Code Unveiling Vulnerabilities and Limitationscited by 22
- 2023How Can ChatGPT Support Human Security Testers to Help Mitigate Supply Chain Attacks?cited by 20
- 2024Assessing AI Detectors in Identifying AI-Generated Code: Implications for Educationcited by 18
- 2023Poisoned ChatGPT Finds Work for Idle Hands: Exploring Developers' Coding Practices with Insecure Suggestions from Poisoned AI Modelscited by 17
- 2024Distinguishing LLM-generated from Human-written Code by Contrastive Learningcited by 16
- 2024LiCoEval: Evaluating LLMs on License Compliance in Code Generationcited by 14
- 2024Whodunit: Classifying Code as Human Authored or GPT-4 Generated -- A case study on CodeChef problemscited by 13
- 2024Do LLMs Know to Respect Copyright Notice?cited by 13
- 2024Uncovering LLM-Generated Code: A Zero-Shot Synthetic Code Detector via Code Rewritingcited by 11
50 most cited of 57 All 57 (JSON)
Built on by
Citing papers per year: 2025: 4; 2026: 2.
6 papers.
- 2025I Know Which LLM Wrote Your Code Last Summer: LLM generated Code Stylometry for Authorship Attributioncited by 9
- 2025textttDroid: A Resource Suite for AI-Generated Code Detectioncited by 9
- 2025AI Code in the Wild: Measuring Security Risks and Ecosystem Shifts of AI-Generated Code in Modern Softwarecited by 4
- 2025MultiAIGCD: A Comprehensive dataset for AI Generated Code Detection Covering Multiple Languages, Models,Prompts, and Scenarioscited by 2
- 2026AICD Bench: A Challenging Benchmark for AI-Generated Code Detectioncited by 2
- 2026HybridCodeAuthorship: A Benchmark Dataset for Line-Level Code Authorship Detectioncited by 0
- 2026HybridCodeAuthorship: A Benchmark Dataset for Line-Level Code Authorship Detection10 Jun 2026
- 2026AICD Bench: A Challenging Benchmark for AI-Generated Code Detection2 Feb 2026
- 2025AI Code in the Wild: Measuring Security Risks and Ecosystem Shifts of AI-Generated Code in Modern Software21 Dec 2025
- 2025MultiAIGCD: A Comprehensive dataset for AI Generated Code Detection Covering Multiple Languages, Models,Prompts, and Scenarios29 Jul 2025
- 2025textttDroid: A Resource Suite for AI-Generated Code Detection11 Jul 2025
- 2025I Know Which LLM Wrote Your Code Last Summer: LLM generated Code Stylometry for Authorship Attribution18 Jun 2025
Similar, not cited
Close in wording, no citation either way
- 2024CodeMMLU: A Multi-Task Benchmark for Assessing Code Understanding & Reasoning Capabilities of CodeLLMs
- 2026Are you Synthesizing or Recalling? Evaluating LLMs on Algorithmic Code Retrieval
- 2025PACIFIC: a framework for generating benchmarks to check Precise Automatically Checked Instruction Following In Code
- 2023SelfEvolve: A Code Evolution Framework via Large Language Models
- 2025Dynamic Benchmarking of Reasoning Capabilities in Code Large Language Models Under Data Contamination
- 2024DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositories
- 2026An Execution-Verified Multi-Language Benchmark for Code Semantic Reasoning
- 2026Narrowing the Complexity Gap in the Evaluation of Large Language Models ↗