paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Between Lines of Code: Unraveling the Distinct Patterns of Machine and Human Programmers

代码行之间:揭示机器程序员与人类程序员的不同模式
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 2/10 · 该论文研究机器生成代码检测与代码风格模式分析,属于LLM代码生成溯源方向,与用户核心关注的“用静态分析改进Agentic程序/ML系统”“用LLM/Agent改进静态分析与形式化验证”以及浮点、贝叶斯程序分析无直接关联。其目标本身偏向检测LLM生成内容,不是问题驱动的静态分析或验证方法。引用 15 inbox
Yuling Shi, Hongyu Zhang, Chengcheng Wan, Xiaodong Gu
crossref: 2026-09-12

AI 速览

一句话:提出 DetectCodeGPT,通过分析代码风格模式并插入空格换行扰动,显著提升机器生成代码检测。

大语言模型代码生成能力增强,使机器与人类编写的源代码边界模糊,带来软件工件完整性与真实性识别问题。已有 DetectGPT 等方法虽能检测机器生成文本,却未利用代码特有模式,直接用于代码效果受限。本文系统分析词法多样性、简洁性、自然性等代码属性,揭示机器与人类代码的独特风格,并发现语法切分是判断来源的关键因素。基于此提出 DetectCodeGPT:不再依赖外部 LLM 扰动,而是通过策略性插入空格与换行扰动代码语料,兼顾有效性与效率。实验表明,该方法在机器生成代码检测任务上显著优于现有最先进技术。

问题
机器生成代码与人类代码界限模糊,软件工件完整性和真实性受到威胁,现有机器文本检测方法未利用代码特有模式,难以直接适用。
方法
通过分析词法多样性、简洁性和自然性等属性,发现语法切分是关键,并提出 DetectCodeGPT,用插入空格和换行的策略扰动代码来检测机器生成代码。
评估
在机器生成代码检测任务上与最先进技术对比,实验显示该方法显著更优,同时其扰动策略兼顾有效性与效率。
原文摘要(Abstract)

Large language models have catalyzed an unprece-dented 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 DetectGPthave 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.1.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8833,
  title = {Between Lines of Code: Unraveling the Distinct Patterns of Machine and Human Programmers},
  author = {Yuling Shi and Hongyu Zhang and Chengcheng Wan and Xiaodong Gu},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00005}
}