[論文レビュー] SelfEvolve: A Code Evolution Framework via Large Language Models
SelfEvolve は、モデルが最初に自己ソースの知識を生成してコードを構築し、次いで解釈器のフィードバックループを通じてそれを洗練させる、2段階のLLM駆動パイプラインを使用します。DS-1000、HumanEval、TransCoder のデータセット全体で大きな改善を達成し、GPT-4 のスケーラブルな改善を実現します。
Large language models (LLMs) have already revolutionized code generation, after being pretrained on publicly available code data. However, while various methods have been proposed to augment LLMs with retrieved knowledge and enhance the quality of code generation, the performance of these retrieval-based methods is limited by the strength of the retrievers used. In addition, while LLMs show great emergent ability, they still struggle to produce the correct code in one turn. To address these challenges, we propose a novel two-step pipeline, called \autoknow, that leverages LLMs as both knowledge providers and self-reflective programmers. Unlike retrieval-based methods, \autoknow~obtains the knowledge from input prompts and generates intermediate code based on the generated knowledge. After that, \autoknow~asks LLM to act as an expert programmer to perform debugging for the generated code. This is achieved by receiving the error message from the interpreter, without requiring special test cases for correctness verification. We evaluate \autoknow~on three code generation datasets, including DS-1000 for data science code, HumanEval for software engineering code, and TransCoder for C++-to-Python translation. Our empirical experiments show that \autoknow~outperforms strong baselines by a significant margin on all datasets. We also conduct exhaustive analytical experiments to validate the effectiveness of the two stages of \autoknow, and find that both are superior to other prompting-based methods. Further scalability analysis demonstrates that \autoknow~can be adapted to other more advanced models, such as GPT-4, and bring consistent efficacy improvement.
研究の動機と目的
- LLMsを知識源とデバッガーの両方として活用し、取得ベースのプロンプトを超える堅牢なデータサイエンスとソフトウェア工学のコード生成を促進する。
- 問題プロンプトから内部的に必要な知識を生成できるようにすることで、外部リトリーバーへの依存を排除する。
- エラーフィードバックを提供するPythonインタプリタを用いた自動リファインメントループを通じて、コードの正確性と頑健性を向上させる。
- より強力なモデル(例:GPT-4)へのスケーラビリティと、多様なプログラミングタスクに対する適用性を示す。
- 強力なプロンプティングのベースラインと比べて、二段階の自己進化が優れた結果をもたらすことを実証的証拠として示す。
提案手法
- 問題を条件にして知識を生成し、次にその知識に基づく試行解を出す二段階パイプライン。
- 知識生成は、問題文脈から必要な情報を抽出するプロンプトを用い、外部リトリーバーを回避する可能性がある(Eq. 4/5)。
- 実行可能なプログラムとインタプリタを用いたリファインメントループがエラーフィードバックを生成し、LLM にコードを修正させ、例外なしに実行されるか、反復制限に達するまで続ける(Eq. 6)。
- アプローチは DS-1000、HumanEval、TransCoder ベンチマークで貪欲デコードを用いて評価し、DocPrompting および Self-Debugging ベースラインと比較する。
- GPT-4 でスケールすることが示され、いくつかのライブラリと HumanEval で性能が向上し、反復的なリファインメントが追加の改善をもたらす。
実験結果
リサーチクエスチョン
- RQ1二段階のLLM主導プロセスは、自己導出知識を生成し、解釈器を介してコードをリファインすることで、取得ベースの prompting ベースラインを上回ることができるか?
- RQ2自己生成された知識は、取得された知識よりも高品質で、より汎用性の高いコードを生み出すか?
- RQ3自己リファインメントループが生成された知識とどのように相互作用して、コーディングタスク全体の性能を向上させるか?
- RQ4SelfEvolve は、DS-1000、HumanEval、TransCoder などのデータセットに対して、GPT-4 のようなより強力なモデルへどの程度スケール可能か?
- RQ5リファインメントループの反復深さが、タスク難易度の異なる場合に性能へ与える影響はどの程度か?
主な発見
- SelfEvolve は DS-1000 で強力なベースラインを上回り、Self-Debugging および DocPrompting よりも pass@1 が高い。
- HumanEval では、ChatGPT を用いた SelfEvolve が pass@1 および pass@10 で大幅な向上をもたらし、GPT-4 レベルに近づく。
- TransCoder ベースの C++ から Python への翻訳で、ChatGPT を用いた SelfEvolve は、 prompting ベースラインの中で最も高い計算精度と pass@1 を達成した。
- GPT-4 を用いたアンサンブルは DS-1000 ライブラリ (Scipy, Pytorch, Sklearn, Matplotlib) および HumanEval の性能を向上させ、自己リファインメントモジュールから追加の改善をもたらす。
- 人間の評価では、自己生成知識が取得知識よりも高い精度と再現率を示し、問題の意味論へのより良い一致を示している。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。