Table of Contents
Fetching ...

HSEvo: Elevating Automatic Heuristic Design with Diversity-Driven Harmony Search and Genetic Algorithm Using LLMs

Pham Vu Tuan Dat, Long Doan, Huynh Thi Thanh Binh

TL;DR

This work tackles automatic heuristic design for combinatorial optimization by examining the properties of heuristic search spaces and introducing diversity-aware mechanisms. It presents two entropy-based metrics, SWDI and CDI, and analyzes existing LLM-EPS approaches (FunSearch, EoH, ReEvo) to understand exploration-exploitation dynamics. The authors then propose HSEvo, a harmony-search–driven LLM-EPS framework incorporating flash reflection, crossover, elitist mutation, and a diversity-tuning harmony-search loop. Empirical results on BPO, TSP, and OP demonstrate that HSEvo achieves strong objective performance while maintaining high diversity and cost efficiency, underscoring the critical role of diversity in LLM-assisted heuristic design.

Abstract

Automatic Heuristic Design (AHD) is an active research area due to its utility in solving complex search and NP-hard combinatorial optimization problems in the real world. The recent advancements in Large Language Models (LLMs) introduce new possibilities by coupling LLMs with evolutionary computation to automatically generate heuristics, known as LLM-based Evolutionary Program Search (LLM-EPS). While previous LLM-EPS studies obtained great performance on various tasks, there is still a gap in understanding the properties of heuristic search spaces and achieving a balance between exploration and exploitation, which is a critical factor in large heuristic search spaces. In this study, we address this gap by proposing two diversity measurement metrics and perform an analysis on previous LLM-EPS approaches, including FunSearch, EoH, and ReEvo. Results on black-box AHD problems reveal that while EoH demonstrates higher diversity than FunSearch and ReEvo, its objective score is unstable. Conversely, ReEvo's reflection mechanism yields good objective scores but fails to optimize diversity effectively. With this finding in mind, we introduce HSEvo, an adaptive LLM-EPS framework that maintains a balance between diversity and convergence with a harmony search algorithm. Through experimentation, we find that HSEvo achieved high diversity indices and good objective scores while remaining cost-effective. These results underscore the importance of balancing exploration and exploitation and understanding heuristic search spaces in designing frameworks in LLM-EPS.

HSEvo: Elevating Automatic Heuristic Design with Diversity-Driven Harmony Search and Genetic Algorithm Using LLMs

TL;DR

This work tackles automatic heuristic design for combinatorial optimization by examining the properties of heuristic search spaces and introducing diversity-aware mechanisms. It presents two entropy-based metrics, SWDI and CDI, and analyzes existing LLM-EPS approaches (FunSearch, EoH, ReEvo) to understand exploration-exploitation dynamics. The authors then propose HSEvo, a harmony-search–driven LLM-EPS framework incorporating flash reflection, crossover, elitist mutation, and a diversity-tuning harmony-search loop. Empirical results on BPO, TSP, and OP demonstrate that HSEvo achieves strong objective performance while maintaining high diversity and cost efficiency, underscoring the critical role of diversity in LLM-assisted heuristic design.

Abstract

Automatic Heuristic Design (AHD) is an active research area due to its utility in solving complex search and NP-hard combinatorial optimization problems in the real world. The recent advancements in Large Language Models (LLMs) introduce new possibilities by coupling LLMs with evolutionary computation to automatically generate heuristics, known as LLM-based Evolutionary Program Search (LLM-EPS). While previous LLM-EPS studies obtained great performance on various tasks, there is still a gap in understanding the properties of heuristic search spaces and achieving a balance between exploration and exploitation, which is a critical factor in large heuristic search spaces. In this study, we address this gap by proposing two diversity measurement metrics and perform an analysis on previous LLM-EPS approaches, including FunSearch, EoH, and ReEvo. Results on black-box AHD problems reveal that while EoH demonstrates higher diversity than FunSearch and ReEvo, its objective score is unstable. Conversely, ReEvo's reflection mechanism yields good objective scores but fails to optimize diversity effectively. With this finding in mind, we introduce HSEvo, an adaptive LLM-EPS framework that maintains a balance between diversity and convergence with a harmony search algorithm. Through experimentation, we find that HSEvo achieved high diversity indices and good objective scores while remaining cost-effective. These results underscore the importance of balancing exploration and exploitation and understanding heuristic search spaces in designing frameworks in LLM-EPS.

Paper Structure

This paper contains 34 sections, 7 equations, 12 figures, 7 tables.

Figures (12)

  • Figure 1: Diversity indices and objective scores of ReEvo framework on BPO problem through different runs.
  • Figure 2: CDI and objective scores of previous LLM-EPS on different AHD problems.
  • Figure 3: Overview of the HSEvo framework.
  • Figure 4: An example of how Harmony search component works in HSEvo.
  • Figure 5: Diversity indices and objective scores of HSEvo framework on BPO problem through different runs.
  • ...and 7 more figures