CodeT5+: コード理解と生成のためのオープンなコード大規模言語モデル
CodeT5+: Open Code Large Language Models for Code Understanding and Generation
May 13, 2023
著者: Yue Wang, Hung Le, Akhilesh Deepak Gotmare, Nghi D. Q. Bui, Junnan Li, Steven C. H. Hoi
cs.AI
要旨
大規模なソースコードで事前学習された大規模言語モデル(LLM)は、コード知能において顕著な進歩を遂げています。しかし、既存のコードLLMには、アーキテクチャと事前学習タスクの観点で2つの主要な制限があります。第一に、特定のアーキテクチャ(エンコーダのみまたはデコーダのみ)を採用するか、異なる下流タスクに対して統一されたエンコーダ-デコーダネットワークに依存しています。前者のパラダイムはアプリケーションにおける柔軟性の欠如に制限され、後者ではモデルがすべてのタスクに対して単一のシステムとして扱われるため、一部のタスクで最適ではないパフォーマンスが生じます。第二に、事前学習目標のセットが限定的であり、一部の下流タスクに関連しない可能性があり、その結果、パフォーマンスが大幅に低下することがあります。これらの制限を解決するために、我々は「CodeT5+」を提案します。これは、コンポーネントモジュールを柔軟に組み合わせて、幅広い下流コードタスクに適応できるエンコーダ-デコーダLLMのファミリーです。この柔軟性は、事前学習とファインチューニングの不一致を緩和するために提案された複数の事前学習目標によって実現されます。これらの目標は、スパンデノイジング、対照学習、テキスト-コードマッチング、および因果LM事前学習タスクをカバーし、単一モーダルおよび二モーダルの多言語コードコーパスで行われます。さらに、CodeT5+をゼロからトレーニングせずに、凍結された既存のLLMで初期化し、モデルを効率的にスケールアップすることを提案し、自然言語指示に合わせるための指示チューニングを探求します。我々は、ゼロショット、ファインチューニング、指示チューニングを含むさまざまな設定で、20以上のコード関連ベンチマークでCodeT5+を広範に評価します。コード生成と補完、数学プログラミング、テキストからコードへの検索タスクなど、さまざまなコード関連タスクで最先端(SoTA)のモデルパフォーマンスを観察します。特に、指示チューニングされたCodeT5+ 16Bは、他のオープンコードLLMに対してHumanEvalコード生成タスクで新しいSoTA結果を達成しました。
English
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.