RAPGen: An Approach for Fixing Code Inefficiencies in Zero-Shot

要約

パフォーマンスのバグは、十分にテストされた商用製品にも現れる可能性がある非機能的なバグです。
これらのパフォーマンスのバグを修正することは重要ですが、困難な問題です。
この研究では、この課題に取り組み、検索拡張プロンプト生成 (RAPGen) と呼ばれる新しいアプローチを紹介します。
パフォーマンスの問題のあるコード スニペットが与えられると、RAPGen はまず、以前のパフォーマンスのバグ修正に関する事前に構築されたナレッジ ベースからプロンプト命令を取得し、次に取得した命令を使用してプロンプトを生成します。
次に、大規模言語モデル (Codex など) でこのプロンプトをゼロショットで使用して、修正を生成します。
私たちのアプローチを、パフォーマンスのバグ修正タスクにおけるさまざまなプロンプトのバリエーションや最先端の​​方法と比較します。
私たちの評価によると、RAPGen は、C# 開発者によって行われた過去のパフォーマンス変更に関する専門家検証済みのデータセットで、ケースの最大 60% で開発者と同等以上のパフォーマンス改善提案を生成でき、そのうちの最大 39% を逐語的に取得できます。

要約(オリジナル)

Performance bugs are non-functional bugs that can even manifest in well-tested commercial products. Fixing these performance bugs is an important yet challenging problem. In this work, we address this challenge and present a new approach called Retrieval-Augmented Prompt Generation (RAPGen). Given a code snippet with a performance issue, RAPGen first retrieves a prompt instruction from a pre-constructed knowledge-base of previous performance bug fixes and then generates a prompt using the retrieved instruction. It then uses this prompt on a Large Language Model (such as Codex) in zero-shot to generate a fix. We compare our approach with the various prompt variations and state of the art methods in the task of performance bug fixing. Our evaluation shows that RAPGen can generate performance improvement suggestions equivalent or better than a developer in ~60% of the cases, getting ~39% of them verbatim, in an expert-verified dataset of past performance changes made by C# developers.

arxiv情報

著者 Spandan Garg,Roshanak Zilouchian Moghaddam,Neel Sundaresan
発行日 2023-06-29 16:28:34+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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