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.
File in questo prodotto:
Non ci sono file associati a questo prodotto.
Pubblicazioni consigliate

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11368/3122363
 Avviso

Attenzione! I dati visualizzati non sono stati sottoposti a validazione da parte dell'ateneo

Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus ND
  • ???jsp.display-item.citation.isi??? ND
social impact