要約
大規模言語モデル (LLM) は、コード生成タスクにおいて優れた機能を実証しています。
ただし、リポジトリ レベルのコード生成には、特にリポジトリ内の複数のファイルにまたがる情報を利用する必要があるため、特有の課題が生じます。
既存の検索ベースのアプローチは、より広範でより深いリポジトリ コンテキストの取得に制限があるため、不十分な場合があります。
この論文では、静的型付けプログラミング言語用に設計された新しいコード生成フレームワークである CatCoder を紹介します。
CatCoder は、関連するコードと型コンテキストを統合することにより、リポジトリ レベルのコード生成を強化します。
具体的には、静的アナライザーを利用して型の依存関係を抽出し、この情報を取得したコードとマージして、LLM 用の包括的なプロンプトを作成します。
CatCoder の有効性を評価するために、199 個の Java タスクと 90 個の Rust タスクを含むベンチマークを調整して構築しました。
結果は、CatCoder が pass@k スコアに関して RepoCoder ベースラインを最大 17.35% 上回るパフォーマンスを示していることを示しています。
さらに、CatCoder の汎用性は、コードに特化したモデルと汎用モデルの両方を含むさまざまな LLM を使用して評価されます。
私たちの調査結果は、すべてのモデルにわたって一貫したパフォーマンスの向上を示しており、CatCoder の実用性を強調しています。
要約(オリジナル)
Large language models (LLMs) have demonstrated remarkable capabilities in code generation tasks. However, repository-level code generation presents unique challenges, particularly due to the need to utilize information spread across multiple files within a repository. Existing retrieval-based approaches sometimes fall short as they are limited in obtaining a broader and deeper repository context. In this paper, we present CatCoder, a novel code generation framework designed for statically typed programming languages. CatCoder enhances repository-level code generation by integrating relevant code and type context. Specifically, it leverages static analyzers to extract type dependencies and merges this information with retrieved code to create comprehensive prompts for LLMs. To evaluate the effectiveness of CatCoder, we adapt and construct benchmarks that include 199 Java tasks and 90 Rust tasks. The results show that CatCoder outperforms the RepoCoder baseline by up to 17.35%, in terms of pass@k score. Furthermore, the generalizability of CatCoder is assessed using various LLMs, including both code-specialized models and general-purpose models. Our findings indicate consistent performance improvements across all models, which underlines the practicality of CatCoder.
arxiv情報
| 著者 | Zhiyuan Pan,Xing Hu,Xin Xia,Xiaohu Yang |
| 発行日 | 2024-06-05 13:56:42+00:00 |
| arxivサイト | arxiv_id(pdf) |
提供元, 利用サービス
arxiv.jp, Google