SelfEvolve: A Code Evolution Framework via Large Language Models

要約

大規模言語モデル (LLM) は、公開されているコード データで事前トレーニングされた後、すでにコード生成に革命をもたらしました。
ただし、取得した知識で LLM を強化し、コード生成の品質を向上させるさまざまな方法が提案されていますが、これらの検索ベースの方法のパフォーマンスは、使用される取得者の強度によって制限されます。
さらに、LLM は優れた創発能力を示しますが、1 ターンで正しいコードを生成するのは依然として困難です。
これらの課題に対処するために、私たちは \autoknow と呼ばれる新しい 2 段階のパイプラインを提案します。これは、LLM を知識プロバイダーと内省的プログラマーの両方として活用します。
検索ベースのメソッドとは異なり、 \autoknow~ は入力プロンプトから知識を取得し、生成された知識に基づいて中間コードを生成します。
その後、\autoknow~LLM に、生成されたコードのデバッグを実行する専門プログラマーとして機能するように依頼します。
これは、正確性を検証するための特別なテスト ケースを必要とせずに、インタープリタからエラー メッセージを受信することによって実現されます。
データ サイエンス コード用の DS-1000、ソフトウェア エンジニアリング コード用の HumanEval、C++ から Python への変換用の TransCoder を含む 3 つのコード生成データセットで autoknow を評価します。
私たちの実証実験では、\autoknow~ がすべてのデータセットで強力なベースラインを大幅に上回るパフォーマンスを示しています。
また、\autoknow の 2 つの段階の有効性を検証するために徹底的な分析実験を実施し、両方の段階が他のプロンプトベースの方法よりも優れていることを発見しました。
さらなるスケーラビリティ分析により、\autoknow~ を 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.

arxiv情報

著者 Shuyang Jiang,Yuhao Wang,Yu Wang
発行日 2023-06-05 14:12:46+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL, cs.SE パーマリンク