Fully Autonomous Programming with Large Language Models
arXiv:2304.10423 · doi:10.1145/3583131.3590481
Abstract
Current approaches to program synthesis with Large Language Models (LLMs) exhibit a "near miss syndrome": they tend to generate programs that semantically resemble the correct answer (as measured by text similarity metrics or human evaluation), but achieve a low or even zero accuracy as measured by unit tests due to small imperfections, such as the wrong input or output format. This calls for an approach known as Synthesize, Execute, Debug (SED), whereby a draft of the solution is generated first, followed by a program repair phase addressing the failed tests. To effectively apply this approach to instruction-driven LLMs, one needs to determine which prompts perform best as instructions for LLMs, as well as strike a balance between repairing unsuccessful programs and replacing them with newly generated ones. We explore these trade-offs empirically, comparing replace-focused, repair-focused, and hybrid debug strategies, as well as different template-based and model-based prompt-generation techniques. We use OpenAI Codex as the LLM and Program Synthesis Benchmark 2 as a database of problem descriptions and tests for evaluation. The resulting framework outperforms both conventional usage of Codex without the repair phase and traditional genetic programming approaches.
arXiv commentAccepted for publication in the Genetic and Evolutionary Computation Conference (GECCO 2023)
References in corpus (13)
- Training language models to follow instructions with human feedback
- A Survey of Deep Learning Techniques for Autonomous Driving
- Evaluating Large Language Models Trained on Code
- CodeSearchNet Challenge: Evaluating the State of Semantic Code Search
- CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generation
- CodeBLEU: a Method for Automatic Evaluation of Code Synthesis
- An Analysis of the Automatic Bug Fixing Performance of ChatGPT
- Repair Is Nearly Generation: Multilingual Program Repair with LLMs
- Repository-Level Prompt Generation for Large Language Models of Code
- Synthesize, Execute and Debug: Learning to Repair for Neural Program Synthesis
- CrossCodeBench: Benchmarking Cross-Task Generalization of Source Code Models
- Less is More: Summary of Long Instructions is Better for Program Synthesis
- Autoencoders as Tools for Program Synthesis