Skip to main content
QUICK REVIEW

[論文レビュー] CodeT5+: Open Code Large Language Models for Code Understanding and Generation

Yue Wang, Hung Lê|arXiv (Cornell University)|May 13, 2023
Natural Language Processing Techniques被引用数 27
ひとこと要約

CodeT5+ は、複数の事前学習目的を柔軟に組み合わせるエンコーダ-デコーダ型のオープンコードLLM ファミリーを提示し、オフ・ザ・シェルの LLM から初期化可能で、命令調整版を含むさまざまなコード理解・生成タスクで最先端(SoTA)を達成。

ABSTRACT

Large language models (LLMs) pretrained on vast source code have achieved prominent progress in code intelligence. However, existing code LLMs have two main limitations in terms of architecture and pretraining tasks. First, they often adopt a specific architecture (encoder-only or decoder-only) or rely on a unified encoder-decoder network for different downstream tasks. The former paradigm is limited by inflexibility in applications while in the latter, the model is treated as a single system for all tasks, leading to suboptimal performance on a subset of tasks. Secondly, they often employ a limited set of pretraining objectives which might not be relevant to some downstream tasks and hence result in substantial performance degrade. To address these limitations, we propose ``CodeT5+'', a family of encoder-decoder LLMs for code in which component modules can be flexibly combined to suit a wide range of downstream code tasks. Such flexibility is enabled by our proposed mixture of pretraining objectives to mitigate the pretrain-finetune discrepancy. These objectives cover span denoising, contrastive learning, text-code matching, and causal LM pretraining tasks, on both unimodal and bimodal multilingual code corpora. Furthermore, we propose to initialize CodeT5+ with frozen off-the-shelf LLMs without training from scratch to efficiently scale up our models, and explore instruction-tuning to align with natural language instructions. We extensively evaluate CodeT5+ on over 20 code-related benchmarks in different settings, including zero-shot, finetuning, and instruction-tuning. We observe state-of-the-art (SoTA) model performance on various code-related tasks, such as code generation and completion, math programming, and text-to-code retrieval tasks. Particularly, our instruction-tuned CodeT5+ 16B achieves new SoTA results on HumanEval code generation task against other open code LLMs.

研究の動機と目的

  • コードLLMs の固定アーキテクチャ(エンコーダーのみ、デコーダーのみ、または統合型エンコーダ-デコーダ)と限定的な事前学習タスクの制約を解消する。
  • コードタスク全般にわたり、ゼロショット・ファインチューニング・指示調整をサポートする、柔軟でモジュール型のエンコーダ-デコーダフレームワークを開発する。
  • 事前学習とファインチューニングのギャップを埋める混合事前学習目的枠組み(スパンデノイジング、CLM、テキスト-コード対照学習、テキスト-コードマッチング)を提案する。
  • 市販のLLMからの計算効率的な初期化を活用し、ゼロからの学習なしでモデルをスケールさせる。
  • オープンモデルや一部クローズドモデルを上回る指示調整性能を含む、複数言語・複数タスクで20以上のベンチマークで高性能を示す。

提案手法

  • CodeT5+ を、エンコーダーのみ、デコーダーのみ、またはエンコーダ-デコーダモードで動作可能なエンコード-デコード型コードLLMとして提案する。
  • 2段階の事前学習を用いる:ステージ1はスパンデノイジングと因果LM objectivesを用いた単模態コード事前学習、ステージ2はテキストとコードの2モード事前学習で、対照学習、マッチング、テキスト-コード因果LMを含む。
  • 浅いエンコーダーと深いデコーダーを用い、クロスアテンション接続を持つ凍結済みの市販LLMからコンポーネントを初期化して、効率的にスケールさせる。
  • 各段階で目的損失の混合で訓練し、下流タスクと整合させるために合成NL指示データを用いて指示調整を適用する。
  • ゼロショット、ファインチューニング、指示調整設定で、9つのプログラミング言語にわたる20以上のベンチマークで評価する。
  • オープンソースおよびクローズドソースモデルを含む、エンコーダーのみ、デコーダーのみ、エンコーダ-デコーダのベースラインと比較する。

実験結果

リサーチクエスチョン

  • RQ1柔軟なモジュール型アーキテクチャは、コード理解と生成の両タスクで固定アーキテクチャのLLMを上回れるか?
  • RQ2混合事前学習目的は、タスク間転移を改善し、コードモデルの事前学習とファインチューニングの不一致を減らすか?
  • RQ3浅いエンコーダーと深いデコーダーを備えた市販LLMからの初期化は、完全な事前学習なしでスケーラブルで計算効率の良いスケーリングを実現するか?
  • RQ4人間評価ベンチマークにおいて、指示調整された CodeT5+ モデルは、オープンモデルおよびクローズドモデルと比較してどの程度の利得を達成するか?
  • RQ5複数言語で、ゼロショット、ファインチューニング、検索拡張生成設定における CodeT5+ のバリエーションの性能はどうか?

主な発見

モデルモデルサイズpass@1pass@10pass@100
CodeT5+220M12.020.731.6
CodeT5+770M15.527.242.7
CodeT5+2B24.238.257.8
CodeT5+6B28.047.269.8
CodeT5+16B30.951.676.7
InstructCodeT5+16B35.054.577.9
CodeT5+ w/ CodeT16B38.563.677.1
InstructCodeT5+ w/ CodeT16B42.967.878.7
  • CodeT5+ は、指示調整を含むゼロショットの HumanEval 生成を含む、複数のコードタスクで SoTA ライクな結果を達成。
  • 指示調整済み CodeT5+ 16B は HumanEval で pass@1 35.0%、pass@10 54.5% を達成し、オープンLLMs を上回り、いくつかのクローズドモデルをも凌駕。
  • 小型の CodeT5+ バリアント(例:220M–770M)は、いくつかのタスクで大規模なオープンLLMs に匹敵または上回る。
  • 凍結済みの深いデコーダーと浅いエンコーダーを用いた計算効率的な事前学習により、限られた訓練可能パラメータで最大16Bパラメータへスケール可能。
  • CodeT5+ を用いた検索拡張生成設定は、コード生成を著しく改善し、同様の手法を上回る。
  • CodeT5+ はゼロショット・ファインチューニング・指示調整のいずれでも高性能を示し、テキスト-コード検索、コード補完、数学プログラミングタスクで顕著な利得を示す。

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。