Between Lines of Code: Unraveling the Distinct Patterns of Machine and Human Programmers
Not on the map. Why?
Abstract (arXiv)
Large language models have catalyzed an unprecedented wave in code generation. While achieving significant advances, they blur the distinctions between machine- and human-authored source code, causing integrity and authenticity issues of software artifacts. Previous methods such as DetectGPT have proven effective in discerning machine-generated texts, but they do not identify and harness the unique patterns of machine-generated code. Thus, its applicability falters when applied to code. In this paper, we carefully study the specific patterns that characterize machine- and human-authored code. Through a rigorous analysis of code attributes such as lexical diversity, conciseness, and naturalness, we expose unique patterns inherent to each source. We particularly notice that the syntactic segmentation of code is a critical factor in identifying its provenance. Based on our findings, we propose DetectCodeGPT, a novel method for detecting machine-generated code, which improves DetectGPT by capturing the distinct stylized patterns of code. Diverging from conventional techniques that depend on external LLMs for perturbations, DetectCodeGPT perturbs the code corpus by strategically inserting spaces and newlines, ensuring both efficacy and efficiency. Experiment results show that our approach significantly outperforms state-of-the-art techniques in detecting machine-generated code.
Key facts. Cited by 27 papers in the map (data through 7 Oct 2026). Builds on 51 of its 75 references that are in the map. First posted on arXiv 12 Jan 2024.
Builds on
51 of 75 references.
References · 51
- 2017Attention Is All You Needcited by 59,932
- 2023GPT-4 Technical Reportcited by 18,132
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2023A Survey of Large Language Modelscited by 2,537
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
38 more
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2023StarCoder: may the source be with you!cited by 790
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
- 2023DetectGPT: Zero-Shot Machine-Generated Text Detection using Probability Curvaturecited by 705
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2023Textbooks Are All You Needcited by 561
- 2019Release Strategies and the Social Impacts of Language Modelscited by 505
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2019GLTR: Statistical Detection and Visualization of Generated Textcited by 490
- 2021Unified Pre-training for Program Understanding and Generationcited by 361
- 2022A Systematic Evaluation of Large Language Models of Codecited by 360
- 2022The Stack: 3 TB of permissively licensed source codecited by 354
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
- 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 294
- 2023Fast-DetectGPT: Efficient Zero-Shot Detection of Machine-Generated Text via Conditional Probability Curvaturecited by 278
- 2019Automatic Detection of Generated Text is Easiest when Humans are Fooledcited by 260
- 2023DetectLLM: Leveraging Log Rank Information for Zero-Shot Detection of Machine-Generated Textcited by 207
- 2023RADAR: Robust AI-Text Detection via Adversarial Learningcited by 187
- 2023SantaCoder: don't reach for the stars!cited by 169
- 2023CodeGen2: Lessons for Training LLMs on Programming and Natural Languagescited by 124
- 2023Who Wrote this Code? Watermarking for Code Generationcited by 116
- 2023A Survey on LLM-Generated Text Detection: Necessity, Methods, and Future Directionscited by 101
- 2023Evaluating the Code Quality of AI-Assisted Code Generation Tools: An Empirical Study on GitHub Copilot, Amazon CodeWhisperer, and ChatGPTcited by 71
- 2023A Survey on Detection of LLMs-Generated Contentcited by 70
- 2023Multiscale Positive-Unlabeled Detection of AI-Generated Textscited by 59
- 2023LLMDet: A Third Party Large Language Models Generated Text Detection Toolcited by 44
- 2023GPT-Sentinel: Distinguishing Human and ChatGPT Generated Contentcited by 40
- 2023Smaller Language Models are Better Black-box Machine-Generated Text Detectorscited by 35
- 2022CoCo: Coherence-Enhanced Machine-Generated Text Detection Under Data Limitation With Contrastive Learningcited by 32
- 2023CodeMark: Imperceptible Watermarking for Code Datasets against Neural Code Completion Modelscited by 28
- 2023Zero-Shot Detection of Machine-Generated Codescited by 24
- 2023The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generationcited by 20
- 2024Assessing AI Detectors in Identifying AI-Generated Code: Implications for Educationcited by 18
- 2023G3Detector: General GPT-Generated Text Detectorcited by 17
50 most cited of 51 All 51 (JSON)
Built on by
Citing papers per year: 2024: 2; 2025: 10; 2026: 15.
27 papers.
Sort:
By area:
- 2025SWE-Exp: Experience-Driven Software Issue Resolutioncited by 64
- 2025SWE-Debate: Competitive Multi-Agent Debate for Software Issue Resolutioncited by 52
- 2024From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debuggingcited by 46
- 2025LongCodeZip: Compress Long Context for Code Language Modelscited by 38
- 2026SWE-Explore: Benchmarking How Coding Agents Explore Repositoriescited by 20
- 2026In Line with Context: Repository-Level Code Generation via Context Inliningcited by 18
- 2026Seeing is Coding: On the Effectiveness of Vision Language Models in Code Understandingcited by 13
- 2026EffiSkill: Agent Skill Based Automated Code Efficiency Optimizationcited by 9
- 2025Marking Code Without Breaking It: Code Watermarking for Detecting LLM-Generated Codecited by 7
- 2025CodeMirage: A Multi-Lingual Benchmark for Detecting AI-Generated and Paraphrased Source Code from Production-Level LLMscited by 6
- 2026Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generationcited by 6
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoringcited by 5
15 more
- 2025Detection of LLM-Paraphrased Code and Identification of the Responsible LLM Using Coding Style Featurescited by 4
- 2026Code Is More Than Text: Uncertainty Estimation for Code Generationcited by 4
- 2026LLM Agents Can See Code Repositoriescited by 3
- 2025HyperAgent: Leveraging Hypergraphs for Topology Optimization in Multi-Agent Communicationcited by 2
- 2025Robust Preference Alignment via Directional Neighborhood Consensuscited by 2
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generationcited by 2
- 2026An Exploratory Study on LLM-Generated Code and Comments in Code Repositoriescited by 2
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prunecited by 2
- 2024Automatic Detection of LLM-Generated Code: A Comparative Case Study of Contemporary Models Across Function and Class Granularitiescited by 1
- 2025Zero-Shot Detection of LLM-Generated Code via Approximated Task Conditioningcited by 1
- 2026Who Wrote This Line? Evaluating the Detection of LLM-Generated Classical Chinese Poetrycited by 1
- 2026Hitting a Moving Target: Test-Time Adaptation for AI Text Detection under Continual Distribution Shiftcited by 1
- 2025code_transformed: The Influence of Large Language Models on Codecited by 0
- 2026Whitespaces Don't Lie: Feature-Driven and Embedding-Based Approaches for Detecting Machine-Generated Codecited by 0
- 2026HybridCodeAuthorship: A Benchmark Dataset for Line-Level Code Authorship Detectioncited by 0
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoring10 Aug 2026
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prune20 Jul 2026
- 2026An Exploratory Study on LLM-Generated Code and Comments in Code Repositories2 Jul 2026
- 2026Hitting a Moving Target: Test-Time Adaptation for AI Text Detection under Continual Distribution Shift23 Jun 2026
- 2026LLM Agents Can See Code Repositories12 Jun 2026
- 2026HybridCodeAuthorship: A Benchmark Dataset for Line-Level Code Authorship Detection10 Jun 2026
- 2026Code Is More Than Text: Uncertainty Estimation for Code Generation8 Jun 2026
- 2026SWE-Explore: Benchmarking How Coding Agents Explore Repositories5 Jun 2026
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generation29 Apr 2026
- 2026Who Wrote This Line? Evaluating the Detection of LLM-Generated Classical Chinese Poetry11 Apr 2026
- 2026EffiSkill: Agent Skill Based Automated Code Efficiency Optimization29 Mar 2026
- 2026Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generation8 Feb 2026
15 more
- 2026Seeing is Coding: On the Effectiveness of Vision Language Models in Code Understanding2 Feb 2026
- 2026Whitespaces Don't Lie: Feature-Driven and Embedding-Based Approaches for Detecting Machine-Generated Code27 Jan 2026
- 2026In Line with Context: Repository-Level Code Generation via Context Inlining1 Jan 2026
- 2025Robust Preference Alignment via Directional Neighborhood Consensus23 Oct 2025
- 2025HyperAgent: Leveraging Hypergraphs for Topology Optimization in Multi-Agent Communication12 Oct 2025
- 2025LongCodeZip: Compress Long Context for Code Language Models1 Oct 2025
- 2025SWE-Exp: Experience-Driven Software Issue Resolution31 Jul 2025
- 2025SWE-Debate: Competitive Multi-Agent Debate for Software Issue Resolution31 Jul 2025
- 2025code_transformed: The Influence of Large Language Models on Code13 Jun 2025
- 2025Zero-Shot Detection of LLM-Generated Code via Approximated Task Conditioning6 Jun 2025
- 2025CodeMirage: A Multi-Lingual Benchmark for Detecting AI-Generated and Paraphrased Source Code from Production-Level LLMs27 May 2025
- 2025Marking Code Without Breaking It: Code Watermarking for Detecting LLM-Generated Code26 Feb 2025
- 2025Detection of LLM-Paraphrased Code and Identification of the Responsible LLM Using Coding Style Features25 Feb 2025
- 2024From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debugging2 Oct 2024
- 2024Automatic Detection of LLM-Generated Code: A Comparative Case Study of Contemporary Models Across Function and Class Granularities2 Sep 2024
- 2026SWE-Explore: Benchmarking How Coding Agents Explore Repositoriescited by 20
- 2026EffiSkill: Agent Skill Based Automated Code Efficiency Optimizationcited by 9
- 2026Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generationcited by 6
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoringcited by 5
- 2026LLM Agents Can See Code Repositoriescited by 3
- 2025HyperAgent: Leveraging Hypergraphs for Topology Optimization in Multi-Agent Communicationcited by 2
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prunecited by 2
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoring10 Aug 2026
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prune20 Jul 2026
- 2026LLM Agents Can See Code Repositories12 Jun 2026
- 2026SWE-Explore: Benchmarking How Coding Agents Explore Repositories5 Jun 2026
- 2026EffiSkill: Agent Skill Based Automated Code Efficiency Optimization29 Mar 2026
- 2026Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generation8 Feb 2026
- 2025HyperAgent: Leveraging Hypergraphs for Topology Optimization in Multi-Agent Communication12 Oct 2025
- 2025SWE-Exp: Experience-Driven Software Issue Resolutioncited by 64
- 2024From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debuggingcited by 46
- 2025LongCodeZip: Compress Long Context for Code Language Modelscited by 38
- 2026In Line with Context: Repository-Level Code Generation via Context Inliningcited by 18
- 2025CodeMirage: A Multi-Lingual Benchmark for Detecting AI-Generated and Paraphrased Source Code from Production-Level LLMscited by 6
- 2025Detection of LLM-Paraphrased Code and Identification of the Responsible LLM Using Coding Style Featurescited by 4
- 2026Code Is More Than Text: Uncertainty Estimation for Code Generationcited by 4
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generationcited by 2
- 2026An Exploratory Study on LLM-Generated Code and Comments in Code Repositoriescited by 2
- 2024Automatic Detection of LLM-Generated Code: A Comparative Case Study of Contemporary Models Across Function and Class Granularitiescited by 1
- 2025Zero-Shot Detection of LLM-Generated Code via Approximated Task Conditioningcited by 1
- 2026Who Wrote This Line? Evaluating the Detection of LLM-Generated Classical Chinese Poetrycited by 1
12 most cited of 16 All 16 (JSON)
- 2026An Exploratory Study on LLM-Generated Code and Comments in Code Repositories2 Jul 2026
- 2026Hitting a Moving Target: Test-Time Adaptation for AI Text Detection under Continual Distribution Shift23 Jun 2026
- 2026HybridCodeAuthorship: A Benchmark Dataset for Line-Level Code Authorship Detection10 Jun 2026
- 2026Code Is More Than Text: Uncertainty Estimation for Code Generation8 Jun 2026
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generation29 Apr 2026
- 2026Who Wrote This Line? Evaluating the Detection of LLM-Generated Classical Chinese Poetry11 Apr 2026
- 2026Whitespaces Don't Lie: Feature-Driven and Embedding-Based Approaches for Detecting Machine-Generated Code27 Jan 2026
- 2026In Line with Context: Repository-Level Code Generation via Context Inlining1 Jan 2026
- 2025LongCodeZip: Compress Long Context for Code Language Models1 Oct 2025
- 2025SWE-Exp: Experience-Driven Software Issue Resolution31 Jul 2025
- 2025code_transformed: The Influence of Large Language Models on Code13 Jun 2025
- 2025Zero-Shot Detection of LLM-Generated Code via Approximated Task Conditioning6 Jun 2025
12 newest of 16 All 16 (JSON)