Enhancing Large Language Models-Based Code Generation by Leveraging Genetic Improvement

被引:5
作者
Pinna, Giovanni [1 ]
Ravalico, Damiano [1 ]
Rovito, Luigi [1 ]
Manzoni, Luca [1 ]
De Lorenzo, Andrea [1 ]
机构
[1] Univ Trieste, I-34127 Trieste, TS, Italy
来源
GENETIC PROGRAMMING, EUROGP 2024 | 2024年 / 14631卷
关键词
Evolutionary Computation; Evolutionary Algorithms; Large Language Models; Artificial Intelligence; Machine Learning; Neural Networks; Code Generation; Genetic Improvement; Grammatical Evolution; Genetic Programming;
D O I
10.1007/978-3-031-56957-9_7
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
In recent years, the rapid advances in neural networks for Natural Language Processing (NLP) have led to the development of Large Language Models (LLMs), able to substantially improve the state-of-the-art in many NLP tasks, such as question answering and text summarization. Among them, one particularly interesting application is automatic code generation based only on the problem description. However, it has been shown that even the most effective LLMs available often fail to produce correct code. To address this issue, we propose an evolutionary-based approach using Genetic Improvement (GI) to improve the code generated by an LLM using a collection of user-provided test cases. Specifically, we employ Grammatical Evolution (GE) using a grammar that we automatically specialize-starting from a general one-for the output of the LLM. We test 25 different problems and 5 different LLMs, showing that the proposed method is able to improve in a statistically significant way the code generated by LLMs. This is a first step in showing that the combination of LLMs and evolutionary techniques can be a fruitful avenue of research.
引用
收藏
页码:108 / 124
页数:17
相关论文
共 57 条
[1]  
2023, Arxiv, DOI [arXiv:2303.08774, DOI 10.48550/ARXIV.2303.08774, 10.48550/arXiv.2303.08774]
[2]   PyGGI 2.0: Language Independent Genetic Improvement Framework [J].
An, Gabin ;
Blot, Aymeric ;
Petke, Justyna ;
Yoo, Shin .
ESEC/FSE'2019: PROCEEDINGS OF THE 2019 27TH ACM JOINT MEETING ON EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, 2019, :1100-1104
[3]  
Austin J., 2021, arXiv, DOI DOI 10.48550/ARXIV.2108.07732
[4]  
Brown TB, 2020, Arxiv, DOI [arXiv:2005.14165, DOI 10.48550/ARXIV.2005.14165]
[5]  
Bahrini Aram, 2023, 2023 Systems and Information Engineering Design Symposium (SIEDS), P274, DOI 10.1109/SIEDS58326.2023.10137850
[6]   SYNTAX-DIRECTED, SEMANTICS-SUPPORTED PROGRAM SYNTHESIS [J].
BIBEL, W .
ARTIFICIAL INTELLIGENCE, 1980, 14 (03) :243-261
[7]  
Blot A., 2022, arXiv, DOI [DOI 10.48550/ARXIV.2208.02811, 10.48550/arXiv.2208.02811]
[8]   Automatic code generation from design patterns [J].
Budinsky, FJ ;
Finnie, MA ;
Vlissides, JM ;
Yu, PS .
IBM SYSTEMS JOURNAL, 1996, 35 (02) :151-171
[9]  
Chen M., 2021, arXiv
[10]  
Chen TQ, 2018, PROCEEDINGS OF THE 13TH USENIX SYMPOSIUM ON OPERATING SYSTEMS DESIGN AND IMPLEMENTATION, P579