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

要約

自動プログラム修復 (APR) 中に、汎用プログラミング言語で実際のシステム用の正しいパッチを合成するのは困難な場合があります。
最近のラージ言語モデル (LLM) は、開発者のさまざまなコーディング タスクを支援する「副操縦士」として役立つことが示されており、パッチ合成にも直接適用されています。
ただし、ほとんどの 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-10-19 16:20:13+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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