Abstract
Heuristic design is a critical yet labor-intensive task in optimization. This paper introduces Evolution of Heuristic (EoH), a framework that integrates Large Language Models (LLMs) into an evolutionary search loop. Unlike previous methods that evolve code directly, EoH evolves natural language "thoughts" alongside executable code. This dual-representation approach allows for more creative algorithmic leaps and extreme efficiency, outperforming human-crafted baselines and state-of-the-art automated methods like FunSearch with significantly fewer computational resources.
Introduction
Designing effective heuristics for complex combinatorial optimization problems—such as bin packing or the traveling salesman problem—traditionally requires deep domain expertise and extensive trial-and-error. While Automatic Heuristic Design (AHD) has sought to automate this "black art," early methods like Genetic Programming were often constrained by rigid building blocks. Recent LLM-based approaches, notably Google DeepMind's FunSearch, demonstrated the potential of evolving code but at a massive computational cost. EoH addresses this by introducing a more human-like reasoning process into the evolutionary loop.
Methodology: The Power of Dual Representation
The core innovation of EoH is the simultaneous evolution of "thoughts" (natural language descriptions of logic) and "codes" (Python implementations).
As shown in the figure above, EoH distinguishes itself by using the LLM to bridge the gap between high-level conceptual ideas and low-level implementation. The framework employs five specific prompt strategies:
- Exploration (E1 & E2): Generating entirely new concepts or combining logic from existing high-performing heuristics.
- Modification (M1, M2, M3): Iteratively refining heuristics by improving performance, tuning parameters, or streamlining code.
The Evolutionary Process in Action
By forcing the LLM to articulate a "thought" before generating code, EoH mimics human problem-solving. This semantic layer helps maintain logical consistency and enables the discovery of complex strategies that code-only evolution might miss.
In the Online Bin Packing example, the system starts with basic initializations and rapidly evolves through complex ideas like "utilization of cubic root" and "hybrid adjustment terms." This process led to a final heuristic that significantly outperformed the standard human-designed "Best Fit" algorithm.
Experimental Results
The authors evaluated EoH across three benchmark problems:
- Online Bin Packing: EoH achieved a gap to the lower bound of 0.61%, surpassing FunSearch (0.74%) and the human "Best Fit" baseline (3.95%).
- Traveling Salesman Problem (TSP): When designing strategies for Guided Local Search, EoH matched optimal solutions for TSP20 and TSP50, outperforming specialized neural solvers.
- Flow Shop Scheduling (FSSP): On Taillard instances, EoH reached an average gap of 0.23%, beating both classic heuristics (2.71%) and deep learning approaches (2.48%).
Remarkably, EoH achieved these results using only ~2,000 LLM queries, a 500x reduction compared to the ~1 million queries reported for FunSearch.
Conclusion and Future Directions
EoH demonstrates that natural language "thoughts" are a powerful medium for algorithmic evolution. By combining the creative reasoning of LLMs with the systematic search of Evolutionary Computation, the framework makes high-performance automated design accessible without massive compute budgets. Future work includes developing domain-specific LLMs for algorithm design and exploring interactive "human-in-the-loop" systems to further refine the evolved logic.
Summary updated