[論文レビュー] CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-X
CodeGeeX は 13B の多言語コード生成モデルで、23 言語にわたる 850B トークンの学習データを用い、コード生成と翻訳の同規模ベースラインを上回り、オープンソースリリースと HumanEval-X ベンチマークを提供。
Large pre-trained code generation models, such as OpenAI Codex, can generate syntax- and function-correct code, making the coding of programmers more productive and our pursuit of artificial general intelligence closer. In this paper, we introduce CodeGeeX, a multilingual model with 13 billion parameters for code generation. CodeGeeX is pre-trained on 850 billion tokens of 23 programming languages as of June 2022. Our extensive experiments suggest that CodeGeeX outperforms multilingual code models of similar scale for both the tasks of code generation and translation on HumanEval-X. Building upon HumanEval (Python only), we develop the HumanEval-X benchmark for evaluating multilingual models by hand-writing the solutions in C++, Java, JavaScript, and Go. In addition, we build CodeGeeX-based extensions on Visual Studio Code, JetBrains, and Cloud Studio, generating 4.7 billion tokens for tens of thousands of active users per week. Our user study demonstrates that CodeGeeX can help to increase coding efficiency for 83.4% of its users. Finally, CodeGeeX is publicly accessible and in Sep. 2022, we open-sourced its code, model weights (the version of 850B tokens), API, extensions, and HumanEval-X at https://github.com/THUDM/CodeGeeX.
研究の動機と目的
- 広範な言語サポート(23 言語)と強力な跨言語能力を備えた多言語コード生成モデルを開発する。
- 多言語コードモデルを評価するため、生成と翻訳タスクの両方で機能的正確性を測定する HumanEval-X を作成・公開する。
- 実務的なツールを提供(IDE 拡張機能)してコーディング生産性を向上させ、実世界での影響を示す。
- 再現性とさらなる研究を可能にするため、モデル、ウェイト、API、評価ベンチマークをオープンソース化する。
提案手法
- GPTスタイルのデコーダアーキテクチャを採用し、自己回帰的コードモデリングのために 39 層のトランスフォーマーを用いる。
- CodeGeeX(13B パラメータ)を 23 言語にまたがるコードコーパスから 850B トークンで、2か月の Ascend 910 クラスター走行を用いて学習する。
- 訓練時に言語識別子で入力シーケンスをタグ付けし、モデルが言語を区別できるようにする。
- 最終トークン予測のための Top Query Layer を使用し、複数のデコード戦略(greedy、top-k、nucleus、beam search)を公開する。
- HumanEval-X ベンチマークの pass@k および跨言語予算配分を用いてクロス言語解決率を最適化する。
- FP16/FP32 精度チューニング、学習後量子化による INT8、NVIDIA FasterTransformer による加速を含む推論最適化を提供する。

実験結果
リサーチクエスチョン
- RQ1CodeGeeX は、Python、C++、Java、JavaScript、Go のコード生成で、同規模の多言語ベースラインと比較してどう性能を示すか。
- RQ25 言語間の翻訳ペア(20 のソース-ターゲットペア)における機能的正確性の点で、CodeGeeX はどの程度うまく対処するか。
- RQ3複数言語に生成予算を分配することが、マルチリンガルモデルの解決性能(pass@k)にどのような影響を与えるか。
- RQ4実務的な観点から、CodeGeeX の拡張機能(VS Code、JetBrains、Cloud Studio)は実際のコーディング作業でどんな利点を提供するか。
主な発見
- CodeGeeX は HumanEval-X において、コード生成と翻訳タスクの両方で同規模の多言語ベースラインモデルを上回る。
- CodeGeeX は言語ごとの平均性能で最高を達成し、いくつかのベースラインを上回る利得と、より大規模な CodeGen-Multi-16B に対する競争力のある結果を示す。
- HumanEval-X は 164 問題と 820 の言語特有解を含み、テストケースを通じた機能的正確性で跨言語の生成と翻訳を評価できる。
- IDE での CodeGeeX 拡張機能はコード補完、生成、翻訳、説明をサポートし、ユーザー調査で 83.4% の効率向上を報告。
- 本プロジェクトはオープンソース(850B トークン版のモデルウェイト)、API、拡張機能、HumanEval-X を 2022 年 9 月に公開しており、現実世界での実利用が報告されている(週あたり 4.7B トークン生成)。

より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。