Large Language Model Based Code Completion is an Effective Genetic Improvement Mutation

In this work, we introduce a novel large language model (LLM)-based masking mutation operator for Genetic Improvement (GI), which leverages code completion capabilities of large language models to replace masked code segments with contextually relevant modifications. Our approach was tested on five open-source Java projects, where we compared its effectiveness against both traditional GI mutations and an existing LLM-based replacement mutation operator using random and local search algorithms. Results show that the masking mutation operator creates a search space with more compiling and test-passing patches, reducing model response time by up to 60.7 % compared to the replacement mutation. Additionally, it outperforms the replacement mutation in achieving the highest runtime improvement on four out of five projects and discovers more runtime-improving patches across all projects. However, combining the masking mutation with traditional GI mutations yielded inconsistent results, suggesting further investigation is needed. This study highlights the promise of LLM-based code completion to boost the efficiency and effectiveness of GI for automated software optimisation.

Authors

Institutions

Publication Details

Published
2025-04-27
DOI
https://doi.org/10.1109/gi66624.2025.00011
Citations
2
Primary Topic
Genomics and Phylogenetic Studies
Type
article
Field-Weighted Citation Impact
1.61
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Large Language Model Based Code Completion is an Effective Genetic Improvement Mutation

Justyna Petke, Carol Hanna, Jingyuan Wang
2 citations
Genomics and Phylogenetic Studies
1.61
article

Large Language Model Based Code Completion is an Effective Genetic Improvement Mutation

Justyna Petke, Carol Hanna, Jingyuan Wang
article en
2 citations

Abstract

In this work, we introduce a novel large language model (LLM)-based masking mutation operator for Genetic Improvement (GI), which leverages code completion capabilities of large language models to replace masked code segments with contextually relevant modifications. Our approach was tested on five open-source Java projects, where we compared its effectiveness against both traditional GI mutations and an existing LLM-based replacement mutation operator using random and local search algorithms. Results show that the masking mutation operator creates a search space with more compiling and test-passing patches, reducing model response time by up to 60.7 % compared to the replacement mutation. Additionally, it outperforms the replacement mutation in achieving the highest runtime improvement on four out of five projects and discovers more runtime-improving patches across all projects. However, combining the masking mutation with traditional GI mutations yielded inconsistent results, suggesting further investigation is needed. This study highlights the promise of LLM-based code completion to boost the efficiency and effectiveness of GI for automated software optimisation.

University College London (GB)
Openalex Percentile: Top 17%
Genomics and Phylogenetic Studies
1.61
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Large Language Model Based Code Completion is an Effective Genetic Improvement Mutation — Justyna Petke, Carol Hanna, et al. · (2025) | TGRS Research Map | TGRS