[論文レビュー] Self-collaboration Code Generation via ChatGPT
この論文は、ChatGPTの役割(アナリスト、コーダー、テスター)が仮想チームとして協働する自己協働フレームワークを導入し、コード生成ベンチマークで最先端の結果を達成し、いくつかの設定ではGPT-4を超えることもある。
Although Large Language Models (LLMs) have demonstrated remarkable code-generation ability, they still struggle with complex tasks. In real-world software development, humans usually tackle complex tasks through collaborative teamwork, a strategy that significantly controls development complexity and enhances software quality. Inspired by this, we present a self-collaboration framework for code generation employing LLMs, exemplified by ChatGPT. Specifically, through role instructions, 1) Multiple LLM agents act as distinct `experts', each responsible for a specific subtask within a complex task; 2) Specify the way to collaborate and interact, so that different roles form a virtual team to facilitate each other's work, ultimately the virtual team addresses code generation tasks collaboratively without the need for human intervention. To effectively organize and manage this virtual team, we incorporate software-development methodology into the framework. Thus, we assemble an elementary team consisting of three LLM roles (i.e., analyst, coder, and tester) responsible for software development's analysis, coding, and testing stages. We conduct comprehensive experiments on various code-generation benchmarks. Experimental results indicate that self-collaboration code generation relatively improves 29.9%-47.1% Pass@1 compared to the base LLM agent. Moreover, we showcase that self-collaboration could potentially enable LLMs to efficiently handle complex repository-level tasks that are not readily solved by the single LLM agent.
研究の動機と目的
- 複雑なコード生成タスクの難しさを、協調的なLLMチームワークを活用して動機づけ、対処する。
- 役割を割り当て、エージェント間協力を定義してタスクを解決する自己協働フレームワークを提案する。
- SDM(ソフトウェア開発手法)に従い、アナリスト・コーダー・テスターの三役を持つ初歩的なチームを実装する。
- 複数のベンチマークと現実世界に近いタスクで頑健性と一般性を示す。
提案手法
- 役割指示による労働分担の定義(DOL)を通じて専門的なLLMエキスパートを作成する。
- ブラックボードを共有し、役割間の調整を形式化して協働を実装する(式1と式2)。
- アナリスト、コーダー、テスターの三つのChatGPT役割を使用して、ウォーターフォール風のSDM(分析、コーディング、テスト)を辿る初歩的なチームを実装する。
- 役割指示を用いて各エージェントの初期化時に役割を固定し、再プロンプトなしで後続の相互作用を可能にする。
- NLのみのプロンプトとNL+署名+公開テストケース設定で、MBPP、HumanEval、MBPP-ET、HumanEval-ETをPass@k(Pass@1を重視)で評価する。
- 役割演技と非役割プロンプトの影響を探り、相互作用ラウンド(MI)の効果を測定する。
実験結果
主な発見
| アプローチ | HumanEval | HumanEval-ET | MBPP | MBPP-ET |
|---|---|---|---|---|
| Direct | 57.3 | 42.7 | 52.2 | 36.8 |
| Self-collaboration (Virtual Team) | 74.4 | 56.1 | 68.2 | 49.5 |
- 自己協働は、直接生成に比べてPass@1を29.9%〜47.1%改善する。
- 初歩的な三役チーム(アナリスト、コーダー、テ tester)によって4つのコード生成ベンチマークで最先端の結果を達成し、時にはGPT-4を超える。
- 役割演技はNL駆動プロンプトで非役割演技ベースラインを大幅に上回る。
- 相互作用(より多くのフィードバックラウンド)は初回ラウンドを超えるとリターンが低下するが、複雑なタスクには一貫した利得を提供する。
- このアプローチは拡張テストベンチマーク(HumanEval-ETとMBPP-ET)で特に有益で、境界ケースやバグの処理能力が向上している。
- ケーススタディは、フレームワークが複雑な実世界タスク(例:Pythonのゲーム)を自律的に解決することを示す。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。