LEVER: Learning to Verify Language-to-Code Generation with Execution
Ansong Ni, Srini Iyer, Dragomir Radev, Ves Stoyanov, Wen-tau Yih, Sida, I. Wang, Xi Victoria Lin

TL;DR
LEVER enhances language-to-code generation by training verifiers to assess program correctness based on execution results, leading to improved accuracy and state-of-the-art performance across multiple datasets.
Contribution
This work introduces LEVER, a novel verification-based reranking method that leverages execution results to improve code generation quality from language models.
Findings
LEVER improves code generation accuracy by 4.6% to 10.9%.
Achieves new state-of-the-art results on four diverse datasets.
Effective across table QA, math QA, and Python programming tasks.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
Taxonomy
TopicsSoftware Engineering Research · Topic Modeling · Natural Language Processing Techniques
MethodsPruning · Test · Balanced Selection
