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

By Ansong Ni, Srini Iyer, Dragomir R. Radev, Ves Stoyanov, Wen-tau Yih, Sida I. Wang, Xi Victoria Lin. International Conference on Machine Learning, 2023

351 citations recorded by the source corpus.

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.

Subfields: Artificial Intelligence, Information Systems

View Paper: https://www.semanticscholar.org/paper/59fe7cb560651281cfc5db6b8940da0e3ba9dea6

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Jianfeng Gao
  2. Mohit Bansal
  3. Percy Liang
  4. Luke S. Zettlemoyer
  5. Xinyun Chen
  6. Weizhu Chen
  7. Denny Zhou
  8. Karthik Narasimhan

In Information Systems

  1. Denny Zhou
  2. Xinyun Chen
  3. Zhihong Shao
  4. Karthik Narasimhan
  5. Maxwell Lin
  6. Yelong Shen
  7. Zhibin Gou
  8. Raymond J. Mooney

Citations in the corpus