PreprintCited by 517Software Engineering ResearchTeaching and Learning ProgrammingTopic Modeling

Program Synthesis with Large Language Models

Open access
Austin, Jacob, Odena, Augustus, Nye, Maxwell, Bosma, Maarten, Michalewski, Henryk, Dohan, David, Jiang, Ellen, Cai, Carrie +3 more·2021·arXiv

Abstract

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.

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

DataCite · 10.48550/arxiv.2108.07732

Cites

92 of 93 references verified0 citation errors · 0 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • Large pools of test cases can originate from human-generated documentation or GPT-generated unit tests.

    “In practice, large pools of test cases, Dj , can either originate from human generated documentation (Nassif et al., 2021;Lemieux et al., 2023) or GPTgenerated unit tests (Austin et al., 2021).”

    From Does Few-Shot Learning Help LLM Performance in Code Synthesis? (2024) · cites this paper as Austin et al., 2021

    Austin et al. do not describe GPT-generated unit tests as the source of their test cases. Section 2.1 (p. 4) says crowdworkers wrote three test cases for each MBPP problem; Section 3 (p. 5) describes the model generating code that was checked against those tests, not generating the tests. (LLM, conf=0.84)

    Checked by a reasoning model — may be wrong.

    Experimental — accuracy not yet measured
  • Code data substantially enhances program synthesis capabilities.

    “Code data (e.g., from Stack Exchange and GitHub) substantially enhances program synthesis capabilities [37,38].”

    From A Survey of Large Language Models (2026) · cites this paper as [38]

    Section 3 (p. 5) says the models were trained partly on websites containing code, and the Introduction (p. 2) explains how training on code can help models learn programming conventions. But the paper does not establish that code data substantially improved synthesis relative to training without it. It also says source-code files were not specifically included, so GitHub code is not supported as an example of this paper’s training data. (LLM, conf=0.84)

    Experimental — accuracy not yet measured
  • Neural code synthesis approaches to code completion generate suggestions by using a language model to predict the completion from the prompt.

    “Neural code synthesis approaches to code completion generate suggestions by using a language model to predict what the user might type next (the completion) from the context of what they are working on at the moment (the prompt) [2].”

    From Productivity Assessment of Neural Code Completion (2022) · cites this paper as [2]

    The Methods section (p. 5) says the authors feed a prompt to a pretrained language model for completion and generate code samples. However, the paper studies synthesis from problem descriptions and examples; it does not establish the cited sentence’s more specific account of predicting what a user would type next from their current editing context. (LLM, conf=0.84)

    Experimental — accuracy not yet measured
  • Similar studies in the code space are limited to the number of few-shot examples in the prompt, and the effect of length of prompt on performance.

    “Similar studies in the code space are limited to the number of few-shot examples in the prompt, and the effect of length of prompt on performance [9,15].”

    From Investigating Explainability of Generative AI for Code through Scenario-based Design (2022) · cites this paper as [9]

    Section 4.2 (p. 7) examines performance by the number of prompting examples, and Section 4.3 (p. 8) discusses how long prompts can hurt synthesis performance. But the study is not limited to those questions: the Introduction (p. 3) also lists model size, example selection, and sampling technique among the factors analyzed. (LLM, conf=0.85)

    Experimental — accuracy not yet measured
  • Existing works have used the Computational Accuracy metric to evaluate generative code models, but not other metrics regarding characteristics of generated artifacts and run-time efficiency.

    “For example, for the Performance category, existing works have used the Computational Accuracy metric to evaluate generative code models [9,15,33,88], but not other metrics we uncovered regarding the characteristics of the generated artifacts and run-time efficiency.”

    From Investigating Explainability of Generative AI for Code through Scenario-based Design (2022) · cites this paper as [9]

    Section 3 (p. 5) says the paper evaluates generated code by executing it against tests for functional correctness, supporting the computational-accuracy part. But Section 4.7 (p. 10) also calculates BLEU scores comparing generated samples with reference programs, so the claim that it uses no other metric concerning generated artifacts is too broad. The cited passages do not show an evaluation metric for run-time efficiency. (LLM, conf=0.87)

    Experimental — accuracy not yet measured

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

Part of this paper’s reference list could not be split into single entries.

Flagged first, then by citations

Research works printed but not linked: 1

  1. [10]10. Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde, Jared Kaplan, Harri Edwards, Yura Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidy Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Such, Dave Cummings, Matthias Plappert, Fotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, Will Guss, Alex Nichol, Igor Babuschkin, Suchir Balaji, Shantanu Jain, Andrew Carr, Jan Leike, Josh Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. Evaluating large language models trained on code, July 2021. URL http://arxiv.org/abs/2107.03374 . · arXiv

Cited by

Sorted by citations

Authors
Austin, J., Odena, A., Nye, M., Bosma, M., Michalewski, H., Dohan, D., Jiang, E., Cai, C., Terry, M., Le, Q., & Sutton, C.
Venue
arXiv
Publisher
arXiv
Published
2021
ISSN
2331-8422 (ISSN-L)
OpenAlex
W3195140297
Cited by
388
References
93
Citations by year
2026: 44 · 2025: 129 · 2024: 92 · 2023: 85 · 2022: 21 · 2021: 15 · 2020: 1 · 2014: 1
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
  • TIB Data Manager
Funders
  • National Natural Science Foundation of China (62472339, 62302375)
  • Hankyong National University
  • Ministry of Industry and Information Technology of the People's Republic of China
  • HORIZON EUROPE Framework Programme (101070305)
  • Fundação para a Ciência e a Tecnologia (UIDB/00319, 00319, UIDB/00319/2020, UIDB/05757/2020)
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Computer Science Applications › Teaching and Learning Programming
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
Keywords
program synthesis, large language models, Python code generation, MBPP, few-shot learning, fine-tuning, model size scaling, human feedback, error analysis, semantic grounding

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review