Program Synthesis with Large Language Models

By Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie J. Cai, Michael Terry, Quoc V. Le and 1 more. 2021

4,124 citations recorded by the source corpus.

This paper explores the limits of the current generation of large language models for program synthesis in general purpose programming languages. We evaluate a collection of such models (with between 244M and 137B parameters) on two new benchmarks, MBPP and MathQA-Python, in both the few-shot and fine-tuning regimes. Our benchmarks are designed to measure the ability of these models to synthesize short Python programs from natural language descriptions. The Mostly Basic Programming Problems (MBPP) dataset contains 974 programming tasks, designed to be solvable by entry-level programmers. The MathQA-Python dataset, a Python version of the MathQA benchmark, contains 23914 problems that evaluate the ability of the models to synthesize code from more complex text. On both datasets, we find that synthesis performance scales log-linearly with model size. Our largest models, even without finetuning on a code dataset, can synthesize solutions to 59.6 percent of the problems from MBPP using few-shot learning with a well-designed prompt. Fine-tuning on a held-out portion of the dataset improves performance by about 10 percentage points across most model sizes. On the MathQA-Python dataset, the largest fine-tuned model achieves 83.8 percent accuracy. Going further, we study the model's ability to engage in dialog about code, incorporating human feedback to improve its solutions. We find that natural language feedback from a human halves the error rate compared to the model's initial prediction. Additionally, we conduct an error analysis to shed light on where these models fall short and what types of programs are most difficult to generate. Finally, we explore the semantic grounding of these models by fine-tuning them to predict the results of program execution. We find that even our best models are generally unable to predict the output of a program given a specific input.

Subfields: Artificial Intelligence, Information Systems, Software, Prompting & Reasoning

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. Mohit Bansal
  2. Luke S. Zettlemoyer
  3. Percy Liang
  4. Jianfeng Gao
  5. Quoc V. Le
  6. Graham Neubig
  7. Yoshua Bengio
  8. Yejin Choi

In Information Systems

  1. Percy Liang
  2. Charles Sutton
  3. Uri Alon
  4. Miltiadis Allamanis
  5. Graham Neubig
  6. Wen-tau Yih
  7. Xinyun Chen
  8. Chun Xia

In Software

  1. Josh Tenenbaum
  2. Rishabh Singh
  3. Armando Solar-Lezama
  4. Oleksandr Polozov
  5. Percy Liang
  6. Pushmeet Kohli
  7. Charles Sutton
  8. Chun Xia

In Prompting & Reasoning

  1. Denny Zhou
  2. Luke S. Zettlemoyer
  3. Wenhu Chen
  4. Xinyun Chen
  5. Sean Welleck
  6. Jason Wei
  7. Percy Liang
  8. Graham Neubig

Citations in the corpus