InstructCoder: Instruction Tuning Large Language Models for Code Editing

要約

コード編集には、開発者が日常的に取り組むさまざまな実用的なタスクが含まれます。
自動コード編集は、その関連性と実用的な有用性にもかかわらず、データ不足のこともあり、深層学習モデルの進化においては依然として研究されていない領域です。
この研究では、ユーザーの指示に基づいてコードを編集するための大規模言語モデル (LLM) の使用について検討します。
EditEval と呼ばれる、人間が作成した新しい実行ベースのベンチマークで評価したところ、現在のモデルは指示を満たすのに苦労していることが多いことがわかりました。
これを考慮して、私たちは InstructCoder を提供します。これは、コメント挿入、コードの最適化、コードのリファクタリングなどの多様性の高いコード編集タスクを含む、LLM を汎用コード編集に適応させるように設計された最初の命令チューニング データセットです。
これは 114,000 を超える命令、入出力のトリプレットで構成され、複数の異なるコード編集シナリオをカバーします。
収集プロセスは、GitHub Python リポジトリからシードとして取得されたフィルター処理されたコミット データから始まります。
その後、データセットは反復プロセスを通じて体系的に拡張され、シード タスクと生成されたタスクの両方を使用して ChatGPT に追加のデータを要求します。
私たちの調査結果では、InstructCoder で微調整されたオープンソース LLM がコード編集の精度を大幅に向上させ、高度な独自仕様 LLM に匹敵する優れたコード編集パフォーマンスを発揮できることが明らかになりました。
データセットとソース コードは、https://github.com/qishenghu/CodeInstruct で公開されています。

要約(オリジナル)

Code editing encompasses a variety of pragmatic tasks that developers deal with daily. Despite its relevance and practical usefulness, automatic code editing remains an underexplored area in the evolution of deep learning models, partly due to data scarcity. In this work, we explore the use of Large Language Models (LLMs) to edit code based on user instructions. Evaluated on a novel human-written execution-based benchmark dubbed EditEval, we found current models often struggle to fulfill the instructions. In light of this, we contribute InstructCoder, the first instruction-tuning dataset designed to adapt LLMs for general-purpose code editing, containing high-diversity code-editing tasks such as comment insertion, code optimization, and code refactoring. It consists of over 114,000 instruction-input-output triplets and covers multiple distinct code editing scenarios. The collection process starts with filtered commit data sourced from GitHub Python repositories as seeds. Subsequently, the dataset is systematically expanded through an iterative process, where both seed and generated tasks are used to prompt ChatGPT for more data. Our findings reveal that open-source LLMs fine-tuned on InstructCoder can significantly enhance the accuracy of code edits, exhibiting superior code-editing performance matching advanced proprietary LLMs. The datasets and the source code are publicly available at https://github.com/qishenghu/CodeInstruct.

arxiv情報

著者 Kaixin Li,Qisheng Hu,Xu Zhao,Hui Chen,Yuxi Xie,Tiedong Liu,Qizhe Xie,Junxian He
発行日 2024-02-28 15:47:11+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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