Table of Contents
Fetching ...

Algorithm Evolution Using Large Language Model

Fei Liu, Xialiang Tong, Mingxuan Yuan, Qingfu Zhang

TL;DR

The paper tackles the problem of automatic optimization-algorithm design by introducing Algorithm Evolution using Large Language Model (AEL), which uses an evolutionary framework to automatically generate optimization algorithms via LLMs without domain-model training. AEL represents each algorithm as an individual and evolves a population through initialization, selection, crossover, mutation, and population management, demonstrated on a constructive heuristic for the Traveling Salesman Problem. Results show that AEL-generated algorithms outperform hand-crafted greedy baselines and LLM-prompted algorithms, with GPT-4-based runs offering the strongest performance and better generalization than a trained domain model. This approach reduces the need for expert knowledge and domain modeling, while exhibiting scalability across problem sizes, and opens avenues for integrating more advanced optimization frameworks and multi-objective extensions.

Abstract

Optimization can be found in many real-life applications. Designing an effective algorithm for a specific optimization problem typically requires a tedious amount of effort from human experts with domain knowledge and algorithm design skills. In this paper, we propose a novel approach called Algorithm Evolution using Large Language Model (AEL). It utilizes a large language model (LLM) to automatically generate optimization algorithms via an evolutionary framework. AEL does algorithm-level evolution without model training. Human effort and requirements for domain knowledge can be significantly reduced. We take constructive methods for the salesman traveling problem as a test example, we show that the constructive algorithm obtained by AEL outperforms simple hand-crafted and LLM-generated heuristics. Compared with other domain deep learning model-based algorithms, these methods exhibit excellent scalability across different problem sizes. AEL is also very different from previous attempts that utilize LLMs as search operators in algorithms.

Algorithm Evolution Using Large Language Model

TL;DR

The paper tackles the problem of automatic optimization-algorithm design by introducing Algorithm Evolution using Large Language Model (AEL), which uses an evolutionary framework to automatically generate optimization algorithms via LLMs without domain-model training. AEL represents each algorithm as an individual and evolves a population through initialization, selection, crossover, mutation, and population management, demonstrated on a constructive heuristic for the Traveling Salesman Problem. Results show that AEL-generated algorithms outperform hand-crafted greedy baselines and LLM-prompted algorithms, with GPT-4-based runs offering the strongest performance and better generalization than a trained domain model. This approach reduces the need for expert knowledge and domain modeling, while exhibiting scalability across problem sizes, and opens avenues for integrating more advanced optimization frameworks and multi-objective extensions.

Abstract

Optimization can be found in many real-life applications. Designing an effective algorithm for a specific optimization problem typically requires a tedious amount of effort from human experts with domain knowledge and algorithm design skills. In this paper, we propose a novel approach called Algorithm Evolution using Large Language Model (AEL). It utilizes a large language model (LLM) to automatically generate optimization algorithms via an evolutionary framework. AEL does algorithm-level evolution without model training. Human effort and requirements for domain knowledge can be significantly reduced. We take constructive methods for the salesman traveling problem as a test example, we show that the constructive algorithm obtained by AEL outperforms simple hand-crafted and LLM-generated heuristics. Compared with other domain deep learning model-based algorithms, these methods exhibit excellent scalability across different problem sizes. AEL is also very different from previous attempts that utilize LLMs as search operators in algorithms.
Paper Structure (26 sections, 7 figures, 1 table, 1 algorithm)

This paper contains 26 sections, 7 figures, 1 table, 1 algorithm.

Figures (7)

  • Figure 1: A comparison of three different algorithm design approaches (a) Human, (b) Domain Model, and (c) AEL, and the their results on TSP. The x-axis represents the problem size. The y-axis represents the gap (%) to the baseline. All results are averaged on 64 randomly generated instances. (a) Human (Greedy): an algorithm designed by humans with trial and error (a greedy algorithm). (b) Domain Model: an algorithm learned by a specific deep neural network trained on TSP50. (c) AEL: algorithms created by our proposed AEL evolved on TSP50. We also compare the algorithms directly generated by instructing LLM (LLM). The used LLMs are denoted in brackets. Refer to the experimental section for more details.
  • Figure 2: An illustration of the AEL framework. The left-hand side flowchart adopts a standard evolutionary framework, comprising prompt engineering of LLM for initialization, crossover, and mutation to create/evolve new algorithms. On the right-hand side, there are two examples demonstrating algorithm crossover and algorithm mutation, specifically in their application to selecting the next node in a route.
  • Figure 3: An example of individual representation of the greedy algorithm. Algorithm Description is a brief algorithm description in two sentences. Code Block includes a Python function named "select_next_node" with a pre-defined input and output. The fitness value is a real number, which is not depicted.
  • Figure 4: Prompts used in the initialization, crossover, and mutation of AEL for TSP: A description of task, Parent algorithm(s), Prompt-specific hints, An expected output, and Other hints.
  • Figure 5: The convergence curve of AEL using GPT-4 on TSP50, where each sample represents an algorithm created in the evolution. The orange and red lines represent the mean and best objective values and the dotted black line represents the greedy algorithm.
  • ...and 2 more figures