RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generation

要約

リポジトリ レベルのコード補完のタスクは、リポジトリのより広範なコンテキストに基づいて未完成のコードを書き続けることです。
自動コード補完ツールの場合、さまざまなファイルに散在する有用な情報を利用するのは困難です。
私たちは、この課題に対処するためのシンプルで汎用的かつ効果的なフレームワークである RepoCoder を提案します。
類似度ベースの検索機能と事前トレーニングされたコード言語モデルを反復検索生成パイプラインに組み込むことで、リポジトリ レベルのコード補完プロセスを合理化します。
RepoCoder は、コード補完のためにリポジトリ レベルの情報を効果的に利用し、さまざまな粒度レベルでコードを生成する機能を備えています。
さらに、ライン、API 呼び出し、関数本体の完了シナリオをカバーする最新かつ高品質な現実世界のリポジトリで構成される新しいベンチマーク RepoEval を提案します。
実験結果は、RepoCoder がすべての設定でファイル内補完ベースラインを 10% 以上大幅に改善し、バニラの検索拡張コード補完アプローチよりも一貫して優れていることを示しています。
さらに、包括的な分析を通じて RepoCoder の有効性を検証し、将来の研究に貴重な洞察を提供します。
私たちのソース コードとベンチマークは、https://github.com/microsoft/CodeT/tree/main/RepoCoder から公開されています。

要約(オリジナル)

The task of repository-level code completion is to continue writing the unfinished code based on a broader context of the repository. While for automated code completion tools, it is difficult to utilize the useful information scattered in different files. We propose RepoCoder, a simple, generic, and effective framework to address the challenge. It streamlines the repository-level code completion process by incorporating a similarity-based retriever and a pre-trained code language model in an iterative retrieval-generation pipeline. RepoCoder makes effective utilization of repository-level information for code completion and has the ability to generate code at various levels of granularity. Moreover, we propose a new benchmark RepoEval, which consists of the latest and high-quality real-world repositories covering line, API invocation, and function body completion scenarios. Experimental results indicate that RepoCoder significantly improves the In-File completion baseline by over 10% in all settings and consistently outperforms the vanilla retrieval-augmented code completion approach. Furthermore, we validate the effectiveness of RepoCoder through comprehensive analysis, providing valuable insights for future research. Our source code and benchmark are publicly available: https://github.com/microsoft/CodeT/tree/main/RepoCoder

arxiv情報

著者 Fengji Zhang,Bei Chen,Yue Zhang,Jacky Keung,Jin Liu,Daoguang Zan,Yi Mao,Jian-Guang Lou,Weizhu Chen
発行日 2023-10-20 15:21:51+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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