Logo del repository
  1. Home
 
Opzioni

Exploring the Effect of Genetic Improvement for Large Language Models-Generated Code

Giovanni Pinna
•
Damiano Ravalico
•
Luigi Rovito
altro
Andrea De Lorenzo
2025
  • journal article

Periodico
SN COMPUTER SCIENCE
Abstract
In recent years, the field of Natural Language Processing (NLP) has made considerable progress with the development of neural network-based models, leading to the creation of various Large Language Models (LLMs). These models have demonstrated strong performance in various NLP tasks, such as language translation, sentiment analysis, and named entity recognition. One notable application of LLMs is their ability to generate code automatically from simple problem descriptions. However, even advanced LLMs frequently generate incorrect code. To address this issue, we extend a recently proposed method that aims to improve the correctness of code generated by LLMs using an evolutionary approach known as Genetic Improvement (GI). Our method involves constructing a dynamic grammar based on the LLM-generated code and using a problem-agnostic fitness function. In our experiments, we evaluated the proposed method on 25 well-known and widely-used problems across four different LLMs, both open-source and proprietary models. We demonstrate that our approach significantly improves the accuracy of code generated by LLMs. Specifically, for problems that the LLM alone does not fully solve, we show that GI significantly improves the initial LLM-generated solution in 50% to 75% of cases across the tested models. Our proposed GI approach remains effective as long as the initial LLM-generated code, despite some errors, provides a solid foundation for constructing a correct program.
DOI
10.1007/s42979-025-04281-x
Archivio
https://hdl.handle.net/11368/3115302
info:eu-repo/semantics/altIdentifier/scopus/2-s2.0-105013896654
https://link.springer.com/article/10.1007/s42979-025-04281-x
Diritti
open access
license:creative commons
license uri:http://creativecommons.org/licenses/by/4.0/
FVG url
https://arts.units.it/bitstream/11368/3115302/1/s42979-025-04281-x.pdf
Soggetti
  • Evolutionary computat...

  • Large language model

  • Code generation

  • Genetic improvement

  • Grammatical evolution...

  • Genetic programming

google-scholar
Get Involved!
  • Source Code
  • Documentation
  • Slack Channel
Make it your own

DSpace-CRIS can be extensively configured to meet your needs. Decide which information need to be collected and available with fine-grained security. Start updating the theme to match your nstitution's web identity.

Need professional help?

The original creators of DSpace-CRIS at 4Science can take your project to the next level, get in touch!

Realizzato con Software DSpace-CRIS - Estensione mantenuta e ottimizzata da 4Science

  • Impostazioni dei cookie
  • Informativa sulla privacy
  • Accordo con l'utente finale
  • Invia il tuo Feedback