Self-Edit: Fault-Aware Code Editor for Code Generation
Kechi Zhang, Zhuo Li, Jia Li et al. · Annual Meeting of the Association for Computational Linguistics (ACL) · 2023
Large language models (LLMs) have demonstrated an impressive ability to generate codes on competitive programming tasks.However, with limited sample numbers, LLMs still suffer from poor accuracy.Inspired by the process of human programming, we propose a generateand-edit approach named Self-Edit that utilizes execution results of the generated code from LLMs to improve the code quality on the competitive programming task.We execute the generated code on the example test case provided in the question and wrap execution results into a supplementary comment.Utilizing this comment as guidance, our fault-aware code editor is employed to correct errors in the generated code.We perform extensive evaluations across two competitive programming datasets with nine different LLMs.Compared to directly generating from LLMs, our approach can improve the average of pass@1 by 89% on APPS-dev, 31% on APPS-test, and 48% on HumanEval over nine popular code generation LLMs with parameter sizes ranging from 110M to 175B.Compared to other post-processing methods, our method demonstrates superior accuracy and efficiency.
Cited by 55 works. doi:10.18653/v1/2023.acl-long.45 Open-access PDF
Authors
References
- Aion Framework: Dimensional Emergence of AI Consciousness, Observer-Induced Collapse, and Cosmological Portal Dynamics
- Transformers: State-of-the-Art Natural Language Processing
- A Direction-Aware Study of LLM-Based Code Translation Across Eight Programming Languages
- A systematic evaluation of large language models of code
- Socratic guiding questions in synthetic arithmetic data: matched LoRA runs (revision v2)
- Learning to Generate Pseudo-Code from Source Code Using Statistical Machine Translation
- CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
- Mapping Language to Code in Programmatic Context
- TRANX: A Transition-based Neural Abstract Syntax Parser for Semantic Parsing and Code Generation
- InCoder: A Generative Model for Code Infilling and Synthesis