跳到主要导航 跳到搜索 跳到主要内容

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

  • Yuling Shi
  • , Hongyu Zhang
  • , Chengcheng Wan
  • , Xiaodong Gu*
  • *此作品的通讯作者
  • Shanghai Jiao Tong University
  • Chongqing University

科研成果: 书/报告/会议事项章节 › 会议稿件 › 同行评审

摘要

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.

源语言英语
主期刊名Proceedings - 2025 IEEE/ACM 47th International Conference on Software Engineering, ICSE 2025
出版商IEEE Computer Society
页1628-1639
页数12
ISBN(电子版)9798331505691
DOI
出版状态已出版 - 2025
活动47th IEEE/ACM International Conference on Software Engineering, ICSE 2025 - Ottawa, 加拿大
期限: 27 4月 2025 → 3 5月 2025

丛书

姓名Proceedings - International Conference on Software Engineering
ISSN(印刷版)0270-5257

会议

会议47th IEEE/ACM International Conference on Software Engineering, ICSE 2025
国家/地区加拿大
市Ottawa
时期27/04/25 → 3/05/25

学术指纹

探究 'Between Lines of Code: Unraveling the Distinct Patterns of Machine and Human Programmers' 的科研主题。它们共同构成独一无二的学术指纹。

引用此