Copiloting the Copilots: Fusing Large Language Models with Completion Engines for Automated Program Repair

要約

プログラム自動修復(APR)の際、汎用プログラミング言語で実世界のシステムに対して正しいパッチを合成することは困難である。最近の大規模言語モデル(LLM)は、開発者の様々なコーディング作業を支援する「コパイロット」として役立つことが示されており、パッチ合成にも直接適用されている。しかし、ほとんどのLLMはプログラムをトークンの列として扱うため、ターゲットとなるプログラミング言語の基本的なセマンティクス制約には無頓着である。その結果、静的に無効なパッチが大量に生成され、この手法の実用性を妨げている。そこで我々は、AI「コパイロット」(すなわちLLM)をさらにコパイロットするためのフレームワークであるRepilotを提案する。我々の重要な洞察は、多くのLLMが人間の記述プログラムに似た出力を自己回帰的に(つまりトークンごとに)生成することである。Repilotは、LLMとCompletion Engineの相互作用を通じて、1) LLMが提案する実現不可能なトークンを除去し、2) Completion Engineが提供する提案に基づいてトークンをプロアクティブに補完することで、相乗的にパッチの候補を合成する。広く使用されているDefects4j 1.2および2.0データセットのサブセットを使用した評価では、Repilotはそれぞれ66個と50個のバグを修正し、最高性能のベースラインを14個と16個上回るバグを修正しました。さらに重要なことに、Repilotは、同じ生成予算が与えられた場合に、ベースラインLLMよりも有効で正しいパッチを生成することができます。

要約(オリジナル)

During Automated Program Repair (APR), it can be challenging to synthesize correct patches for real-world systems in general-purpose programming languages. Recent Large Language Models (LLMs) have been shown to be helpful ‘copilots’ in assisting developers with various coding tasks, and have also been directly applied for patch synthesis. However, most LLMs treat programs as sequences of tokens, meaning that they are ignorant of the underlying semantics constraints of the target programming language. This results in plenty of statically invalid generated patches, impeding the practicality of the technique. Therefore, we propose Repilot, a framework to further copilot the AI ‘copilots’ (i.e., LLMs) by synthesizing more valid patches during the repair process. Our key insight is that many LLMs produce outputs autoregressively (i.e., token by token), resembling human writing programs, which can be significantly boosted and guided through a Completion Engine. Repilot synergistically synthesizes a candidate patch through the interaction between an LLM and a Completion Engine, which 1) prunes away infeasible tokens suggested by the LLM and 2) proactively completes the token based on the suggestions provided by the Completion Engine. Our evaluation on a subset of the widely-used Defects4j 1.2 and 2.0 datasets shows that Repilot fixes 66 and 50 bugs, respectively, surpassing the best-performing baseline by 14 and 16 bugs fixed. More importantly, Repilot is capable of producing more valid and correct patches than the base LLM when given the same generation budget.

arxiv情報

著者 Yuxiang Wei,Chunqiu Steven Xia,Lingming Zhang
発行日 2023-09-01 17:54:14+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, DeepL

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