Understanding the Importance of Evolutionary Search in Automated Heuristic Design with Large Language Models

Rui Zhang, Fei Liu, Xi Lin, Zhenkun Wang, Zhichao Lu, Qingfu Zhang

Abstract

Automated Heuristic Design (AHD) aims to create algorithms for complex optimization problems without human intervention. While Large Language Models (LLMs) have shown promise in this domain through Evolutionary Program Search (EPS), the relative contributions of the LLM's generative capabilities versus the evolutionary search framework have remained unclear. This paper introduces a unified benchmark to evaluate nine LLMs across four optimization problems, comparing established EPS methods like FunSearch, EoH, and ReEvo against a simple (1+1)-EPS baseline. The findings reveal that standalone LLMs are largely ineffective at algorithm design; rather, the evolutionary search framework is the critical component for achieving state-of-the-art performance.

Introduction

The field of Automated Heuristic Design (AHD) is undergoing a paradigm shift. Traditionally, designing heuristics for NP-hard problems like the Traveling Salesman Problem (TSP) or Bin Packing required significant domain expertise. Recently, researchers have turned to Large Language Models (LLMs) to automate this process, treating it as an Evolutionary Program Search (EPS) task. In this setup, an LLM proposes code snippets, and an evolutionary framework iteratively refines them.

However, the rapid development of this field has led to a "Wild West" of methodologies. Inconsistent benchmarks, varying LLM selections, and comparisons against weak baselines have made it difficult to discern whether progress is driven by smarter models or better search strategies. This study seeks to provide a rigorous reality check by asking: Are LLMs doing the heavy lifting, or is the evolutionary framework the true engine of success?

Methodology and Unified Benchmarking

To provide a fair comparison, the authors developed a unified framework, llm-eps, to evaluate three prominent EPS methods:

  1. FunSearch: Utilizes an "island model" to maintain a diverse pool of programs.
  2. Evolution of Heuristic (EoH): Focuses on iterative refinement and mutation.
  3. ReEvo: A contemporary approach to LLM-based evolution.

As a control, the researchers introduced (1+1)-EPS, a "dead simple" baseline inspired by the (1+1) Evolutionary Strategy. This baseline starts with a single heuristic, asks the LLM to mutate it once, and retains the new version only if it shows improvement. Unlike more complex methods, it uses basic one-shot prompting without multi-step reasoning or reflection.

Experimental Scope

The study tested these methods across nine LLMs, ranging from open-source models like CodeLlama (7B, 34B) and DeepSeek-Coder (6.7B, 33B) to state-of-the-art closed-source models like GPT-4 and Claude 3 Opus. These were evaluated on four distinct problems:

  • Admissible Set (AS): A mathematical challenge related to the cap set problem.
  • Online Bin Packing: Tested on both standard Operations Research (OR) and Weibull distribution datasets.
  • Traveling Salesman Problem (TSP): The classic combinatorial optimization benchmark.

Key Insights

1. Search is Non-Negotiable

The most striking finding is that standalone LLMs are surprisingly poor at AHD. Even when given a massive query budget of 10,000 attempts, a standalone GPT-4 often fails to outperform a simple (1+1) search using only 500 queries. This suggests that the iterative feedback loop of an evolutionary process is far more important than the raw generative power of the model in isolation.

2. The "Greedy Trap" and Diversity

While the simple (1+1)-EPS baseline proved surprisingly competitive on problems like Bin Packing, it often plateaued early. The study found that more complex methods like FunSearch are necessary for long-term progress. By maintaining a diverse population of solutions, these methods avoid the "greedy trap" where the search gets stuck in local optima, eventually discovering more novel and high-performing heuristics.

3. Model Size vs. Domain Specialization

In the realm of algorithm design, bigger is not always better. A model’s performance on general benchmarks (like HumanEval) does not perfectly correlate with its success in AHD. Smaller models specifically fine-tuned for code, such as DeepSeek-Coder, frequently outperformed much larger general-purpose models. This indicates that code-specific reasoning is more valuable for EPS than general linguistic breadth.

Quantitative Results

The performance was measured by the gap ($\Delta_d$) to the best-known optimum, where a lower percentage indicates better performance.

  • The Admissible Set Problem: Standalone GPT-3.5 showed a performance gap of approximately 10%. By simply applying the (1+1)-EPS search framework to the same model, the gap was reduced to 7.5%.
  • Traveling Salesman Problem: The specialized EoH method achieved a gap as low as 0.12% when paired with Claude 3 Opus. This significantly outperformed both the (1+1)-EPS baseline (3.87%) and standalone sampling (9.64%), highlighting the synergy between advanced search strategies and high-tier models.

Limitations and Future Work

Despite the success of these methods, significant barriers remain. The computational and financial costs are high; a single full search can take up to 10 days on a Tesla V100 GPU or exceed $200 in API fees. Future research must focus on "sample efficiency"—achieving high-quality heuristics with fewer LLM calls.

Furthermore, most current AHD research focuses on generating single priority functions. The next frontier involves designing complex, multi-component algorithms. To facilitate this, the authors have open-sourced the llm-eps framework, providing a standardized foundation for the community to build upon.

Conclusion

This research clarifies the roles of LLMs and evolutionary search in automated algorithm design. While LLMs provide the creative "mutations," the evolutionary framework provides the necessary selection pressure and memory to navigate the vast space of possible heuristics. For practitioners, the message is clear: the choice of search strategy is just as critical as the choice of the model itself.

Summary updated

BibTeX
@inproceedings{zhang2024understanding,
  author = {Rui Zhang and Fei Liu and Xi Lin and Zhenkun Wang and Zhichao Lu and Qingfu Zhang},
  title = {{Understanding the Importance of Evolutionary Search in Automated Heuristic Design with Large Language Models}},
  booktitle = {PPSN},
  year = {2024},
  doi = {10.1007/978-3-031-70068-2\_12},
}
Figure