Table of Contents
Fetching ...

Large Language Models as Surrogate Models in Evolutionary Algorithms: A Preliminary Study

Hao Hao, Xiaoqun Zhang, Aimin Zhou

TL;DR

This work investigates using large language models as surrogate predictors in surrogate-assisted evolutionary algorithms by casting selection as regression or classification tasks via prompt engineering, thereby avoiding offline training. The proposed LAEA framework integrates LLMs into the EA loop, enabling inference-based evaluation of candidate solutions and using historical data to guide search. Empirical studies across 2D and higher-dimensional benchmarks show that carefully chosen open-source LLMs (e.g., Llama3-8B*, Mixtral-8x7B) can achieve competitive performance with traditional surrogates, particularly in regression settings, while highlighting notable time and data-scale trade-offs. The findings suggest LLMs offer a promising, flexible direction for surrogate modeling in EAs, with avenues for improving numerical handling and inference efficiency in future work.

Abstract

Large Language Models (LLMs) have achieved significant progress across various fields and have exhibited strong potential in evolutionary computation, such as generating new solutions and automating algorithm design. Surrogate-assisted selection is a core step in evolutionary algorithms to solve expensive optimization problems by reducing the number of real evaluations. Traditionally, this has relied on conventional machine learning methods, leveraging historical evaluated evaluations to predict the performance of new solutions. In this work, we propose a novel surrogate model based purely on LLM inference capabilities, eliminating the need for training. Specifically, we formulate model-assisted selection as a classification and regression problem, utilizing LLMs to directly evaluate the quality of new solutions based on historical data. This involves predicting whether a solution is good or bad, or approximating its value. This approach is then integrated into evolutionary algorithms, termed LLM-assisted EA (LAEA). Detailed experiments compared the visualization results of 2D data from 9 mainstream LLMs, as well as their performance on optimization problems. The experimental results demonstrate that LLMs have significant potential as surrogate models in evolutionary computation, achieving performance comparable to traditional surrogate models only using inference. This work offers new insights into the application of LLMs in evolutionary computation. Code is available at: https://github.com/hhyqhh/LAEA.git

Large Language Models as Surrogate Models in Evolutionary Algorithms: A Preliminary Study

TL;DR

This work investigates using large language models as surrogate predictors in surrogate-assisted evolutionary algorithms by casting selection as regression or classification tasks via prompt engineering, thereby avoiding offline training. The proposed LAEA framework integrates LLMs into the EA loop, enabling inference-based evaluation of candidate solutions and using historical data to guide search. Empirical studies across 2D and higher-dimensional benchmarks show that carefully chosen open-source LLMs (e.g., Llama3-8B*, Mixtral-8x7B) can achieve competitive performance with traditional surrogates, particularly in regression settings, while highlighting notable time and data-scale trade-offs. The findings suggest LLMs offer a promising, flexible direction for surrogate modeling in EAs, with avenues for improving numerical handling and inference efficiency in future work.

Abstract

Large Language Models (LLMs) have achieved significant progress across various fields and have exhibited strong potential in evolutionary computation, such as generating new solutions and automating algorithm design. Surrogate-assisted selection is a core step in evolutionary algorithms to solve expensive optimization problems by reducing the number of real evaluations. Traditionally, this has relied on conventional machine learning methods, leveraging historical evaluated evaluations to predict the performance of new solutions. In this work, we propose a novel surrogate model based purely on LLM inference capabilities, eliminating the need for training. Specifically, we formulate model-assisted selection as a classification and regression problem, utilizing LLMs to directly evaluate the quality of new solutions based on historical data. This involves predicting whether a solution is good or bad, or approximating its value. This approach is then integrated into evolutionary algorithms, termed LLM-assisted EA (LAEA). Detailed experiments compared the visualization results of 2D data from 9 mainstream LLMs, as well as their performance on optimization problems. The experimental results demonstrate that LLMs have significant potential as surrogate models in evolutionary computation, achieving performance comparable to traditional surrogate models only using inference. This work offers new insights into the application of LLMs in evolutionary computation. Code is available at: https://github.com/hhyqhh/LAEA.git
Paper Structure (21 sections, 3 equations, 8 figures, 4 tables, 2 algorithms)

This paper contains 21 sections, 3 equations, 8 figures, 4 tables, 2 algorithms.

Figures (8)

  • Figure 1: The framework of LLM-assisted evolutionary algorithm (LAEA). The left side illustrates the basic structure of a surrogate-assisted evolutionary algorithm, where selection can be either a classification or regression task. The right side depicts the four steps of utilizing LLMs as surrogate models: preprocessing, generating prompts, inference, and post-processing.
  • Figure 2: Regression task prompt
  • Figure 3: Classification task prompt
  • Figure 4: Visualization results of label predictions by LLMs for 2-dimensional test problem. The first column represents the real data distribution, where blue $\bullet$ and red $\times$ indicate class "1" and class "0", respectively. Yellow and purple shading represent the distribution of true labels for the test data. Columns 2 through 10 present the prediction results of nine LLMs, with classification accuracy ($acc$) annotated in the bottom right corner of each test plot.
  • Figure 5: Box plots of $acc$ for nine LLMs on four 2D test problems. The blue boxes represent the $acc$ of LLMs used as classification models, while the orange boxes represent the $acc$ of LLMs used as regression models.
  • ...and 3 more figures