Teaching Large Language Models to Self-Debug

要約

タイトル:大規模言語モデルに自己デバッグを教える

要約:

– 大規模言語モデル(LLM)はコード生成において印象的な性能を発揮している。
– 複雑なプログラミングタスクでは、一度に正しい解を生成することは困難であるため、以前の研究ではプログラム修復アプローチを設計し、コード生成の性能を改善している。
– 本研究では、大規模言語モデルに自己デバッグを教える「Self-Debugging」を提案する。
– Self-Debuggingは、少数のショットデモンストレーションを通じて、予測されたプログラムをデバッグすることができるようにする。
– 特に、Self-Debuggingは、ラバーダックデバッグを実行する大規模言語モデルを教えることができることを示している。すなわち、コードの正確さやエラーメッセージに関するフィードバックがなくても、モデルは自然言語で生成されたコードを説明することにより、自分の間違いを特定することができる。
– Self-Debuggingは、テキストからSQLへの生成のためのSpiderデータセット、C++からPythonへの翻訳のためのTransCoder、テキストからPythonへの生成のためのMBPPなど、いくつかのコード生成ベンチマークで、最新の性能を実現している。
– 単体テストを用いて予測の正確さを検証する必要がないSpiderベンチマークでは、Self-Debuggingによるコード説明を伴うものは、基準線を2〜3%改善し、最も難しいラベルの問題で9%の予測精度を向上させた。
– 単体テストを用いてTransCoderとMBPPでSelf-Debuggingは、基準精度を12%まで改善している。
– 同時に、フィードバックメッセージを活用し、失敗した予測を再利用することで、自己デバッグはサンプル効率を著しく改善し、10倍以上の候補プログラムを生成する基準モデルと同等以上の性能を発揮している。

要約(オリジナル)

Large language models (LLMs) have achieved impressive performance on code generation. However, for complex programming tasks, generating the correct solution in one go becomes challenging, thus some prior works have designed program repair approaches to improve code generation performance. In this work, we propose Self-Debugging, which teaches a large language model to debug its predicted program via few-shot demonstrations. In particular, we demonstrate that Self-Debugging can teach the large language model to perform rubber duck debugging; i.e., without any feedback on the code correctness or error messages, the model is able to identify its mistakes by explaining the generated code in natural language. Self-Debugging achieves the state-of-the-art performance on several code generation benchmarks, including the Spider dataset for text-to-SQL generation, TransCoder for C++-to-Python translation, and MBPP for text-to-Python generation. On the Spider benchmark where there are no unit tests to verify the correctness of predictions, Self-Debugging with code explanation consistently improves the baseline by 2-3%, and improves the prediction accuracy on problems of the hardest label by 9%. On TransCoder and MBPP where unit tests are available, Self-Debugging improves the baseline accuracy by up to 12%. Meanwhile, by leveraging feedback messages and reusing failed predictions, Self-Debugging notably improves sample efficiency, and can match or outperform baseline models that generate more than 10x candidate programs.

arxiv情報

著者 Xinyun Chen,Maxwell Lin,Nathanael Schärli,Denny Zhou
発行日 2023-04-11 10:43:43+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, OpenAI

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