Unveiling the potential of large language models in generating semantic and cross-language clones

要約

セマンティックおよび言語間コード クローンの生成は、コードの再利用、コードの理解、リファクタリング、ベンチマークに役立つ場合があります。
OpenAI の GPT モデルは、テキスト生成に GPT が使用されるため、クローン生成などに可能性を秘めています。
開発者がスタック オーバーフロー (SO) またはシステム内からコードをコピー/ペーストすると、変更に一貫性がなく、予期しない動作が発生する可能性があります。
同様に、誰かが特定のプログラミング言語のコード スニペットを所有しているが、別の言語で同等の機能を求めている場合、セマンティック言語間コード クローン生成アプローチは貴重な支援を提供する可能性があります。この研究では、手段として SemanticCloneBench を使用して、どの程度優れた機能が得られるかを評価しました。
GPT-3 モデルは、特定のフラグメントのセマンティックおよび言語間のクローン バリアントを生成するのに役立ちます。私たちはさまざまなコード フラグメントのセットを構成し、コード バリアントの生成における GPT-3 のパフォーマンスを評価しました。9 人の審査員が費やした広範な実験と分析を通じて、
検証には 158 時間かかり、正確で意味的に正しいバリアントを生成するモデルの能力を調査しました。
私たちの調査結果は、コード生成における GPT-3 の強みに光を当て、ソフトウェア開発で高度な言語モデルを使用する際の潜在的なアプリケーションと課題についての洞察を提供します。
当社の定量分析により、説得力のある結果が得られます。
セマンティック クローンの領域では、GPT-3 は、数ショット プロンプト エンジニアリングを通じて 62.14% と 0.55 BLEU スコアという驚異的な精度を達成しました。
さらに、このモデルは言語の境界を超えて優れており、言語を超えたクローンの生成において 91.25% という例外的な精度を誇ります。

要約(オリジナル)

Semantic and Cross-language code clone generation may be useful for code reuse, code comprehension, refactoring and benchmarking. OpenAI’s GPT model has potential in such clone generation as GPT is used for text generation. When developers copy/paste codes from Stack Overflow (SO) or within a system, there might be inconsistent changes leading to unexpected behaviours. Similarly, if someone possesses a code snippet in a particular programming language but seeks equivalent functionality in a different language, a semantic cross-language code clone generation approach could provide valuable assistance.In this study, using SemanticCloneBench as a vehicle, we evaluated how well the GPT-3 model could help generate semantic and cross-language clone variants for a given fragment.We have comprised a diverse set of code fragments and assessed GPT-3s performance in generating code variants.Through extensive experimentation and analysis, where 9 judges spent 158 hours to validate, we investigate the model’s ability to produce accurate and semantically correct variants. Our findings shed light on GPT-3’s strengths in code generation, offering insights into the potential applications and challenges of using advanced language models in software development. Our quantitative analysis yields compelling results. In the realm of semantic clones, GPT-3 attains an impressive accuracy of 62.14% and 0.55 BLEU score, achieved through few-shot prompt engineering. Furthermore, the model shines in transcending linguistic confines, boasting an exceptional 91.25% accuracy in generating cross-language clones

arxiv情報

著者 Palash R. Roy,Ajmain I. Alam,Farouq Al-omari,Banani Roy,Chanchal K. Roy,Kevin A. Schneider
発行日 2023-09-12 17:40:49+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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