LEVER: Learning to Verify Language-to-Code Generation with Execution

要約

コードでトレーニングされた大規模な言語モデル (コード LLM) の出現により、言語からコードへの生成が大幅に進歩しました。
この分野の最先端のアプローチでは、LLM デコードと、テスト ケースまたは実行結果に基づくヒューリスティックを使用したサンプル プルーニングおよび再ランキングを組み合わせています。
しかし、実際の多くの言語からコードへのアプリケーションのテスト ケースを取得することは困難であり、ヒューリスティックでは、プログラムの正しさを示すデータ型や値の範囲などの実行結果の意味論的特徴を十分に捉えることができません。

この研究では、生成されたプログラムとその実行結果を検証する方法を学習することで、言語からコードへの生成を改善するシンプルなアプローチである LEVER を提案します。
具体的には、自然言語入力、プログラム自体、およびその実行結果に基づいて、LLM からサンプリングされたプログラムが正しいかどうかを判断する検証者を訓練します。
サンプリングされたプログラムは、検証スコアと LLM 生成確率を組み合わせて再ランク付けされ、同じ実行結果を持つプログラムよりも優先されます。
テーブル QA、数学 QA、および基本的な Python プログラミングのドメインにわたる 4 つのデータセットで、LEVER はベース コード LLM を一貫して改善し (code-davinci-002 で 4.6% から 10.9%)、新しい最先端の結果を達成しました。
それらすべて。

要約(オリジナル)

The advent of large language models trained on code (code LLMs) has led to significant progress in language-to-code generation. State-of-the-art approaches in this area combine LLM decoding with sample pruning and reranking using test cases or heuristics based on the execution results. However, it is challenging to obtain test cases for many real-world language-to-code applications, and heuristics cannot well capture the semantic features of the execution results, such as data type and value range, which often indicates the correctness of the program. In this work, we propose LEVER, a simple approach to improve language-to-code generation by learning to verify the generated programs with their execution results. Specifically, we train verifiers to determine whether a program sampled from the LLMs is correct or not based on the natural language input, the program itself and its execution results. The sampled programs are reranked by combining the verification score with the LLM generation probability, and marginalizing over programs with the same execution results. On four datasets across the domains of table QA, math QA and basic Python programming, LEVER consistently improves over the base code LLMs(4.6% to 10.9% with code-davinci-002) and achieves new state-of-the-art results on all of them.

arxiv情報

著者 Ansong Ni,Srini Iyer,Dragomir Radev,Ves Stoyanov,Wen-tau Yih,Sida I. Wang,Xi Victoria Lin
発行日 2023-07-05 08:00:15+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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