Table of Contents
Fetching ...

Experience-Guided Reflective Co-Evolution of Prompts and Heuristics for Automatic Algorithm Design

Yihong Liu, Junyi Li, Wayne Xin Zhao, Hongyu Lu, Ji-Rong Wen

TL;DR

EvoPH introduces Experience-Guided Reflective Co-Evolution of Prompts and Heuristics, a framework that couples island-based MAP-elites with prompt evolution to co-design heuristics for automatic algorithm design. By storing execution experiences and using them to adapt both mutation operators and LLM prompts, EvoPH mitigates stagnation and accelerates discovery across TSP and BPP benchmarks. The approach yields substantial improvements over prior methods in relative error across diverse initial heuristics, with ablation tests confirming the synergistic value of strategy sampling, prompt adaptation, and island cooperation. The framework demonstrates strong robustness and generalization, offering a pathway to broader application in COPs and practical algorithm design tasks.

Abstract

Combinatorial optimization problems are traditionally tackled with handcrafted heuristic algorithms, which demand extensive domain expertise and significant implementation effort. Recent progress has highlighted the potential of automatic heuristics design powered by large language models (LLMs), enabling the automatic generation and refinement of heuristics. These approaches typically maintain a population of heuristics and employ LLMs as mutation operators to evolve them across generations. While effective, such methods often risk stagnating in local optima. To address this issue, we propose the Experience-Guided Reflective Co-Evolution of Prompt and Heuristics (EvoPH) for automatic algorithm design, a novel framework that integrates the island migration model with the elites selection algorithm to simulate diverse heuristics populations. In EvoPH, prompts are co-evolved with heuristic algorithms, guided by performance feedback. We evaluate our framework on two problems, i.e., Traveling Salesman Problem and Bin Packing Problem. Experimental results demonstrate that EvoPH achieves the lowest relative error against optimal solutions across both datasets, advancing the field of automatic algorithm design with LLMs.

Experience-Guided Reflective Co-Evolution of Prompts and Heuristics for Automatic Algorithm Design

TL;DR

EvoPH introduces Experience-Guided Reflective Co-Evolution of Prompts and Heuristics, a framework that couples island-based MAP-elites with prompt evolution to co-design heuristics for automatic algorithm design. By storing execution experiences and using them to adapt both mutation operators and LLM prompts, EvoPH mitigates stagnation and accelerates discovery across TSP and BPP benchmarks. The approach yields substantial improvements over prior methods in relative error across diverse initial heuristics, with ablation tests confirming the synergistic value of strategy sampling, prompt adaptation, and island cooperation. The framework demonstrates strong robustness and generalization, offering a pathway to broader application in COPs and practical algorithm design tasks.

Abstract

Combinatorial optimization problems are traditionally tackled with handcrafted heuristic algorithms, which demand extensive domain expertise and significant implementation effort. Recent progress has highlighted the potential of automatic heuristics design powered by large language models (LLMs), enabling the automatic generation and refinement of heuristics. These approaches typically maintain a population of heuristics and employ LLMs as mutation operators to evolve them across generations. While effective, such methods often risk stagnating in local optima. To address this issue, we propose the Experience-Guided Reflective Co-Evolution of Prompt and Heuristics (EvoPH) for automatic algorithm design, a novel framework that integrates the island migration model with the elites selection algorithm to simulate diverse heuristics populations. In EvoPH, prompts are co-evolved with heuristic algorithms, guided by performance feedback. We evaluate our framework on two problems, i.e., Traveling Salesman Problem and Bin Packing Problem. Experimental results demonstrate that EvoPH achieves the lowest relative error against optimal solutions across both datasets, advancing the field of automatic algorithm design with LLMs.

Paper Structure

This paper contains 26 sections, 4 equations, 6 figures, 2 tables.

Figures (6)

  • Figure 1: EvoPH comprises two interacting processes. Heuristics Evolution generates, evaluates, and stores candidate algorithms, providing feedback for further search. Prompt Evolution adaptively refines LLM prompts and strategy selection based on this feedback.
  • Figure 2: Proportion of generating executable code over 20 iterations of the EvoPH with and without the prompt evolution module.
  • Figure 3: Variation in the lowest relative error of different initial algorithms with evolution iterations.
  • Figure 4: Comparison of prompts before and after evolution.
  • Figure 5: Comparison of heuristic algorithm before and after evolution.
  • ...and 1 more figures