Recent advancements in Natural Language Processing (NLP) have enabled Large Language Models (LLMs) to generate source code from textual problem descriptions. However, even state-of-the-art LLMs frequently produce syntactically correct which is, however, semantically incorrect. The LLM generated code might have a correct general structure, while treating incorrectly some corner cases. Furthermore, existing test cases might be difficult to use to help the LLM guide the construction of a semantically correct solution. To address this limitation, two recent studies propose the application of Genetic Improvement (GI) techniques, particularly Grammatical Evolution (GE), to automatically enhance the correctness of LLM-generated code. These approaches demonstrate that evolutionary computation can substantially improve the functional validity of code produced by both open-source and proprietary LLMs.
Improving LLM-Generated Code via Genetic Improvement: A Summary of Recent Advances
Giovanni Pinna
;Damiano Ravalico;Luigi Rovito;Luca Manzoni;Andrea De Lorenzo
2025-01-01
Abstract
Recent advancements in Natural Language Processing (NLP) have enabled Large Language Models (LLMs) to generate source code from textual problem descriptions. However, even state-of-the-art LLMs frequently produce syntactically correct which is, however, semantically incorrect. The LLM generated code might have a correct general structure, while treating incorrectly some corner cases. Furthermore, existing test cases might be difficult to use to help the LLM guide the construction of a semantically correct solution. To address this limitation, two recent studies propose the application of Genetic Improvement (GI) techniques, particularly Grammatical Evolution (GE), to automatically enhance the correctness of LLM-generated code. These approaches demonstrate that evolutionary computation can substantially improve the functional validity of code produced by both open-source and proprietary LLMs.Pubblicazioni consigliate
I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.


