CDEoH: Category-Driven Automatic Algorithm Design With Large Language Models
Authors: Yu-Nian Wang, Shen-Huan Lyu, Ning Chen, Jia-Le Xu, Baoliu Ye, Qingfu Zhang
Organizations: Key Laboratory of Water Big Data Technology of Ministry of Water Resources, College of Computer Science and Software Engineering, Hohai University, Nanjing, China · Department of Computer Science, City University of Hong Kong, Hong Kong, China · State Key Laboratory for Novel Software Technology, Nanjing University, Nanjing, China
With the rapid advancement of large language models (LLMs), LLM-based heuristic search methods have demonstrated strong capabilities in automated algorithm generation. However, their evolutionary processes often suffer from instability and premature convergence. Existing approaches mainly address this issue through prompt engineering or by jointly evolving thought and code, while largely overlooking the critical role of algorithmic category diversity in maintaining evolutionary stability. To this end, we propose Category Driven Automatic Algorithm Design with Large Language Models (CDEoH), which explicitly models algorithm categories and jointly balances performance and category diversity in population management, enabling parallel exploration across multiple algorithmic paradigms. Extensive experiments on representative combinatorial optimization problems across multiple scales demonstrate that CDEoH effectively mitigates convergence toward a single evolutionary direction, significantly enhancing evolutionary stability and achieving consistently superior average performance across tasks and scales.
Figures & tables
Figure 1: (a) Existing LLM-based automatic algorithm design methods adopt iterative search frameworks to optimize algorithms, where individuals in the population are not distinguished by category labels and erroneous algorithms are directly discarded. (b) CDEoH explicitly incorporates category labels to distinguish different algorithmic paradigms and employs a reflection mechanism to repair erroneous algorithms.
Figure 2: One evolutionary run of CDEoH on the online bin packing problem. We list the algorithm categories and present the detailed thoughts and code of the best-performing algorithm.
Method
1kC100
1kC500
5kC100
5kC500
10kC100
10kC500
EoH
2.476
0.991
2.406
0.497
1.071
0.448
FunSearch
3.516
0.991
3.878
0.447
1.820
0.423
ReEvo
3.171
0.991
1.611
0.497
0.478
0.075
CDEoH
2.378
0.744
1.054
0.099
0.483
0.075
Table 1: OBP results under different problem settings. The relative gap between the number of bins used by different heuristics and the lower bound on instances generated from a Weibull distribution (lower is better). In each column, the best results are highlighted in bold, and the second-best results are shaded.
Method
size50
size100
size200
size500
EoH
10.060
13.097
15.640
21.448
FunSearch
14.921
22.796
17.680
22.513
ReEvo
12.053
15.249
17.024
22.248
CDEoH
9.226
12.328
15.922
17.134
Table 2: TSP results under different problem settings. The table compares the relative distance between the tour lengths generated by each heuristic and those produced by the LKH algorithm (lower is better). In each column, the best results are highlighted in bold, and the second-best results are shaded.
Method
10kC100
10kC500
1kC100
1kC500
5kC100
5kC500
nocategory
0.458
0.075
3.019
0.991
1.083
0.248
noreflection
0.368
0.075
2.969
0.991
1.163
0.248
CDEoH
0.483
0.075
2.378
0.744
1.054
0.099
Table 3: Results of the ablation study on the online bin packing problem. The table reports comparisons of CDEoH with respect to the category mechanism and the reflection mechanism.
Designing heuristics for combinatorial optimization problems (COPs) is a fundamental yet challenging task that traditionally requires extensive domain expertise. Recently, Large Language Model (LLM)-based Automated Heuristic Design (AHD) has shown promise in autonomously generating heuristic components with minimal human intervention. However, most existing LLM-based AHD methods enforce fixed algorithmic templates to ensure executability, which confines the search to component-level tuning and limits system-level algorithmic expressiveness. To enable open-ended solver synthesis beyond rigid templates, we propose Automated Algorithm Design via Evolutionary Program Trees (A2DEPT), which treats LLMs as system-level algorithm architects. A2DEPT explores the vast program space via a tree-structured evolutionary search with hybrid selection and hierarchical operators, enabling iterative refinement of complete algorithms. To make open-ended generation practical, we enforce executability with a lightweight program-maintenance loop that performs feedback-driven repair. In experiments, A2DEPT consistently outperforms representative LLM-based baselines on both standard and highly constrained benchmarks. On the standard benchmarks, it reduces the mean normalized optimality gap by 9.8% relative to the strongest competing AHD baseline.
Bin Chen, Shouliang Zhu, Beidan Liu +4
The Institute of Intelligent Computing, University of Electronic Science and Technology of China, Chengdu 611731, China · College of Systems Engineering, National University of Defense Technology, Changsha 410073, China · Academy of Military Medical Sciences, Beijing 100071, China
The integration of Large Language Models (LLMs) with evolutionary computation has emerged as a powerful paradigm for automated heuristic design in combinatorial optimization. However, existing approaches suffer from mode collapse, converging to homogeneous populations that lack semantic diversity and fail to explore the full algorithmic space. We propose Quality-Diversity Evolution (QDEvo), a multi-objective framework that integrates Quality-Diversity optimization with LLM-driven heuristic search, maintaining an unbounded archive of semantically diverse algorithms using pre-trained code embeddings and incorporating hierarchical self-reflection to guide the evolutionary process. Extensive experiments across standard benchmarks and real-world industrial applications demonstrate that QDEvo significantly outperforms state-of-the-art methods in both Hypervolume and Inverted Generational Distance metrics. Our framework enables the discovery of heuristics that are simultaneously high-performing, computationally efficient, and semantically diverse, providing practitioners with a rich portfolio of solutions for complex optimization problems.
Nam Do Khanh, Nhat Nguyen Tran Minh, Dat Pham Vu Tuan +2
Hanoi University of Science and Technology Hanoi, Vietnam · George Mason University Fairfax, Virginia, USA
Large Language Models (LLMs) have advanced Automatic Heuristic Design (AHD) by enabling heuristic generation through reasoning and code synthesis. In LLM-based AHD, the LLM reasons about algorithm design and generates executable heuristic code. Existing architectures adopt two main paradigms: Natural Evolution applies crossover and mutation to this code to explore diverse strategies, but discards the reasoning traces behind the design decisions, weakening knowledge retention; Metacognitive Evolution retains these reasoning traces and refines them through reflection, but lacks population-level recombination, limiting exploration. These limitations reduce search efficiency, stability, and solution quality on complex problems. To address this gap, we propose MeEvo, an AHD framework that cyclically couples Natural Evolution and Metacognitive Evolution with operator balance that shifts from exploration to exploitation. Natural Evolution explores heuristic code while recording LLM-generated reasoning traces, fitness values, errors and best heuristic into a shared history; Metacognitive Evolution then reflects on this history to generate improved heuristics that feed into the next Natural Evolution cycle. This design enables population-driven exploration and reflection-driven refinement to reinforce each other. Experiments on five optimization problems show that MeEvo achieves stronger performance and lower variance than tested LLM-based AHD architectures, especially on complex constrained tasks.
Zishang Qiu, Xinan Chen, Rong Qu +1
School of Computer Science, University of Nottingham Ningbo China, Ningbo, China · School of Computer Science, University of Nottingham, Nottingham, UK