[論文レビュー] Evaluating Large Language Models Trained on Code
Codexは公開GitHubコードでファインチューニングされたGPTベースのモデルで、docstringsからの機能的なコード生成を実証し、新しいHumanEvalベンチマークで複数のベースラインを凌駕します。単一サンプルの最良性能は、複数サンプルとユニットテストを使用することで顕著に改善されます。
We introduce Codex, a GPT language model fine-tuned on publicly available code from GitHub, and study its Python code-writing capabilities. A distinct production version of Codex powers GitHub Copilot. On HumanEval, a new evaluation set we release to measure functional correctness for synthesizing programs from docstrings, our model solves 28.8% of the problems, while GPT-3 solves 0% and GPT-J solves 11.4%. Furthermore, we find that repeated sampling from the model is a surprisingly effective strategy for producing working solutions to difficult prompts. Using this method, we solve 70.2% of our problems with 100 samples per problem. Careful investigation of our model reveals its limitations, including difficulty with docstrings describing long chains of operations and with binding operations to variables. Finally, we discuss the potential broader impacts of deploying powerful code generation technologies, covering safety, security, and economics.
研究の動機と目的
- 公に利用可能なコードで訓練されたコード中心の言語モデルの開発を動機づける。
- コード生成の機能的正確性評価フレームワークをユニットテストで導入する。
- docstringsからのPython関数合成におけるCodexの性能を基準と比較する。
- サンプリング戦略と監督付きファインチューニングがコード生成品質に及ぼす影響を探る。
- 強力なコード生成モデルの限界・リスク・社会的影響について議論する。
提案手法
- Codexを作成するために大規模なGitHub Pythonコーパスに対してGPT系モデルをファインチューニングする。
- ユニットテストを用いた164の手書き問題からなる新しいHumanEvalデータセットで機能的正確性を評価する。
- pass@kをコードサンプルのマルチサンプル評価のための偏りのない推定量として用いる。
- CodexをGPT-Neo、GPT-J、TabNineと複数のモデルサイズで比較する。
- Codexを正しい standalone関数に対してさらにファインチューニングしてCodex-Sを作成し、利得を評価する。
- 生成コードをユニットテストと安全に実行するための sandboxed 実行環境(gVisorベース)を提案する。
実験結果
リサーチクエスチョン
- RQ1Codexは docstrings からの正しい Python 関数を、コードにファインチューニングしていないベースラインと比較してどれだけ正しく生成できるか。
- RQ2ドキュstringからのコード補完におけるモデルサイズとサンプリング戦略が pass@k の性能に与える影響は。
- RQ3機能的に正しいサンプルはBLEUなどの標準的なコード類似度指標と相関するか。
- RQ4Codex-Sのように正しい standalone関数で監督付きファインチューニングを行うと、基本のCodexより性能が向上するか。
- RQ5大規模にコード生成LLMを展開する際の制限と安全性の考慮点は。
主な発見
| pass@k | k=1 | k=10 | k=100 |
|---|---|---|---|
| GPT-Neo 125M | 0.75% | 1.88% | 2.97% |
| GPT-Neo 1.3B | 4.79% | 7.47% | 16.30% |
| GPT-Neo 2.7B | 6.41% | 11.27% | 21.37% |
| GPT-J 6B | 11.62% | 15.74% | 27.74% |
| TabNine | 2.58% | 4.35% | 7.59% |
| Codex-12M | 2.00% | 3.62% | 8.58% |
| Codex-25M | 3.21% | 7.10% | 12.89% |
| Codex-42M | 5.06% | 8.80% | 15.55% |
| Codex-85M | 8.22% | 12.81% | 22.40% |
| Codex-300M | 13.17% | 20.37% | 36.27% |
| Codex-679M | 16.22% | 25.70% | 40.95% |
| Codex-2.5B | 21.36% | 35.42% | 59.50% |
| Codex-12B | 28.81% | 46.81% | 72.31% |
- 1サンプルで、Codex-12BはHumanEval問題の28.8%を解く;GPT-3ファミリーはほぼ0%、GPT-Jは11.4%。
- 問題ごとに100サンプルを生成し、ユニットテストで最良を選ぶと77.5%を解く;平均対数確率の平均値が最も高いサンプルを用いると44.5%。
- Codex-S(正しい standalone関数で監督付きファインチューニング)は単一サンプルで37.7%を解き、Codexより顕著な差をつけて上回る。
- 比較ではGPT-NeoとGPT-JのベースラインはCodexに劣る;Codex-12BはHumanEvalでpass@1=28.81%、pass@10=46.81%、pass@100=72.31%を達成;Codex-2.5B以上へさらに改善を続ける。
- BLEUスコアは機能的正確性と低相関であり、機能的に等価な解が低BLEUを持つ場合やその逆もあり得る。
- Codex-Sは一般にCodexよりモデルサイズを問わず上回り、最適なサンプリング温度はkにより異なる;平均対数確率でサンプルを選ぶと性能が向上。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。