Table of Contents
Fetching ...

Controlling the Mutation in Large Language Models for the Efficient Evolution of Algorithms

Haoran Yin, Anna V. Kononova, Thomas Bäck, Niki van Stein

TL;DR

The paper addresses inefficiencies in LLM-driven evolutionary algorithm design caused by uncontrolled mutation in LLaMEA. It proposes a dynamic mutation-rate mechanism inspired by genetic algorithms, using a heavy-tailed distribution $fmut_{\beta}$ and engineered prompts to adapt mutation strength during evolution. Through experiments with GPT-3.5-turbo and GPT-4o on single-objective continuous optimization, it finds that GPT-4o can follow mutation instructions and, when combined with dynamic prompts, yields faster convergence, whereas GPT-3.5-turbo often fails to adhere to mutation controls. The results establish a starting point for more controlled LLM-based mutations in automated metaheuristic design and point to future work in automated prompt engineering and broader model evaluations.

Abstract

The integration of Large Language Models (LLMs) with evolutionary computation (EC) has introduced a promising paradigm for automating the design of metaheuristic algorithms. However, existing frameworks, such as the Large Language Model Evolutionary Algorithm (LLaMEA), often lack precise control over mutation mechanisms, leading to inefficiencies in solution space exploration and potentially suboptimal convergence. This paper introduces a novel approach to mutation control within LLM-driven evolutionary frameworks, inspired by theory of genetic algorithms. Specifically, we propose dynamic mutation prompts that adaptively regulate mutation rates, leveraging a heavy-tailed power-law distribution to balance exploration and exploitation. Experiments using GPT-3.5-turbo and GPT-4o models demonstrate that GPT-3.5-turbo fails to adhere to the specific mutation instructions, while GPT-4o is able to adapt its mutation based on the prompt engineered dynamic prompts. Further experiments show that the introduction of these dynamic rates can improve the convergence speed and adaptability of LLaMEA, when using GPT-4o. This work sets the starting point for better controlled LLM-based mutations in code optimization tasks, paving the way for further advancements in automated metaheuristic design.

Controlling the Mutation in Large Language Models for the Efficient Evolution of Algorithms

TL;DR

The paper addresses inefficiencies in LLM-driven evolutionary algorithm design caused by uncontrolled mutation in LLaMEA. It proposes a dynamic mutation-rate mechanism inspired by genetic algorithms, using a heavy-tailed distribution and engineered prompts to adapt mutation strength during evolution. Through experiments with GPT-3.5-turbo and GPT-4o on single-objective continuous optimization, it finds that GPT-4o can follow mutation instructions and, when combined with dynamic prompts, yields faster convergence, whereas GPT-3.5-turbo often fails to adhere to mutation controls. The results establish a starting point for more controlled LLM-based mutations in automated metaheuristic design and point to future work in automated prompt engineering and broader model evaluations.

Abstract

The integration of Large Language Models (LLMs) with evolutionary computation (EC) has introduced a promising paradigm for automating the design of metaheuristic algorithms. However, existing frameworks, such as the Large Language Model Evolutionary Algorithm (LLaMEA), often lack precise control over mutation mechanisms, leading to inefficiencies in solution space exploration and potentially suboptimal convergence. This paper introduces a novel approach to mutation control within LLM-driven evolutionary frameworks, inspired by theory of genetic algorithms. Specifically, we propose dynamic mutation prompts that adaptively regulate mutation rates, leveraging a heavy-tailed power-law distribution to balance exploration and exploitation. Experiments using GPT-3.5-turbo and GPT-4o models demonstrate that GPT-3.5-turbo fails to adhere to the specific mutation instructions, while GPT-4o is able to adapt its mutation based on the prompt engineered dynamic prompts. Further experiments show that the introduction of these dynamic rates can improve the convergence speed and adaptability of LLaMEA, when using GPT-4o. This work sets the starting point for better controlled LLM-based mutations in code optimization tasks, paving the way for further advancements in automated metaheuristic design.

Paper Structure

This paper contains 11 sections, 3 equations, 6 figures.

Figures (6)

  • Figure 1: The distribution of Equation \ref{['eq:fmut']}. The area under the curves are all 1.
  • Figure 2: LLaMEA with controlled mutation via dynamic prompts.
  • Figure 3: MSE and TDW-scores of prompts. For both figures, the $x$-axis is the requested mutation rates, the $y$-axis is the prompts, the first five columns from left show the corresponding MSE of different prompts with requested mutation rate, and the last column on the right shows the TDW-score of prompts. The smaller the value, the better the prompt.
  • Figure 4: The distribution of code difference of the codes generated with different prompts and requested mutation rates, and scatterplot of the ratio of actual delivered code difference to requested mutation rate for LLaMEA. Results of different mutation rates are separated by gray dotted lines and marked by red text. The red dashed line represents the requested mutation rate, while the green dotted-dashed line shows that the difference in the delivered code for points on this line equals the requested mutation rate. Each data column contains mutated codes from 100 codes generated over 3 runs.
  • Figure 5: Mean convergence curves (best-so-far algorithm scores) over the 5 different runs for each selected prompt and LLM. Baselines are the raw data from van2024llamea. Shaded areas denote the standard deviation of the best-so-far.
  • ...and 1 more figures