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

要約

大規模な言語モデルは、コード生成において前例のない波を引き起こしました。
大きな進歩を遂げる一方、機械が作成したソース コードと人間が作成したソース コードの区別があいまいになり、ソフトウェア アーティファクトの完全性と信頼性の問題が発生します。
DetectGPT などの以前の方法は、機械生成されたテキストを識別するのに効果的であることが証明されていますが、機械生成されたコードの固有のパターンを識別して利用することはできません。
したがって、コードに適用すると、その適用性が低下します。
この論文では、機械コードと人間が作成したコードを特徴付ける特定のパターンを注意深く研究します。
長さ、語彙の多様性、自然さなどのコード属性の厳密な分析を通じて、各ソースに固有の固有のパターンを明らかにします。
特に、コードの出所を特定するには、コードの構造的セグメント化が重要な要素であることに気づきました。
私たちの発見に基づいて、コードの明確な構造パターンを捕捉することで DetectGPT を改善する、DetectCodeGPT と呼ばれる新しい機械生成コード検出方法を提案します。
摂動を外部 LLM に依存する従来の手法とは異なり、DetectCodeGPT はスペースと改行を戦略的に挿入することでコード コーパスを摂動し、有効性と効率の両方を保証します。
実験結果は、私たちのアプローチが機械生成コードの検出において最先端の技術を大幅に上回ることを示しています。

要約(オリジナル)

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 length, lexical diversity, and naturalness, we expose unique pat-terns inherent to each source. We particularly notice that the structural segmentation of code is a critical factor in identifying its provenance. Based on our findings, we propose a novel machine-generated code detection method called DetectCodeGPT, which improves DetectGPT by capturing the distinct structural 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.

arxiv情報

著者 Yuling Shi,Hongyu Zhang,Chengcheng Wan,Xiaodong Gu
発行日 2024-01-24 14:57:42+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.SE パーマリンク