NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CDEoH: Category-Driven Automatic Algorithm Design With Large Language Models

Yu-Nian Wang, Shen-Huan Lyu, Ning Chen, Jia-Le Xu, Baoliu Ye, Qingfu ZhangarXiv 2026

TL;DR

CDEoH introduces a category-driven evolutionary framework that uses Large Language Models (LLMs) to automatically design high-performing heuristic algorithms. By explicitly classifying and managing distinct algorithmic paradigms (like greedy or dynamic programming) during population selection, it prevents premature convergence and maintains structural diversity, outperforming state-of-the-art LLM-based search methods on complex combinatorial optimization problems.

What Problem Does This Paper Address?

Designing effective heuristic algorithms for NP-hard optimization problems—such as routing or bin packing—traditionally requires extensive human expertise and tedious trial-and-error. While recent Automatic Heuristic Design (AHD) methods successfully combine LLMs with evolutionary computation (e.g., FunSearch, EoH), they suffer from a common pitfall: premature convergence.

During the evolutionary process, the population often rapidly homogenizes around a single, moderately successful algorithmic paradigm (like a specific greedy variant). Once the population loses diversity, the search gets trapped in local optima. Existing methods try to mitigate this implicitly via prompt engineering or multi-island population structures, but they lack a mechanism to explicitly track, preserve, and explore fundamentally different algorithmic categories.

Methods

CDEoH (Category-Driven Evolutionary Algorithm Design) addresses this gap by explicitly modeling algorithm categories within a single, low-cost evolutionary population. It introduces three core mechanisms:

  1. Algorithm Category Induction: For every candidate algorithm generated by the LLM (which includes both a high-level "thought" rationale and concrete Python code), CDEoH queries the LLM a second time to act as a semantic classifier. The LLM assigns a discrete category label characterizing its underlying paradigm (e.g., "Harmonic Fill Balance", "Gaussian Fit Priority").
  2. Category-Based Two-Stage Selection Strategy: To balance raw performance with structural diversity when transitioning to the next generation:
  3. Stage 1 (Category-wise Elitism): The top-performing algorithm from each identified category is automatically preserved. This ensures that unique paradigms are not prematurely discarded just because they haven't been fully optimized yet.
  4. Stage 2 (Performance-Diversity Selection): The remaining slots in the population are filled by ranking candidates using a joint score that normalizes algorithmic performance and explicitly penalizes category over-concentration (favoring rare or newly discovered categories).
  5. Reflection Mechanism for Error Repair: LLMs frequently introduce syntax or logical bugs (hallucinations). Instead of throwing away erroneous code, CDEoH feeds the code and the runtime error message back to the LLM, giving it a chance to self-correct and salvage potentially brilliant algorithmic ideas.
Comparison between existing iterative search frameworks and the proposed category-driven CDEoH framework.

Datasets

The authors evaluated CDEoH on two classic combinatorial optimization benchmarks across multiple scales:

  • Online Bin Packing (OBP): Items arrive sequentially and must be packed into fixed-capacity bins while minimizing total bin usage. The benchmark includes instances generated from a Weibull distribution with bin capacities of 100 and 500, and item counts scaling from 1,000 to 10,000.
  • Traveling Salesman Problem (TSP): Constructive heuristics were evaluated on 16 instances with city counts ranging from 50 to 500, utilizing both uniform $[0,1]$ and Gaussian coordinate distributions.

Key Insights and Ideas

  • Algorithmic Paradigms Have Different Ceilings: Different categories of heuristics inherently possess different performance limits. Purely performance-driven selection will discard a mediocre instance of a high-ceiling paradigm in favor of a highly optimized instance of a low-ceiling paradigm. Explicit categorization protects these high-ceiling paradigms early on.
  • LLMs as Semantic Classifiers for Code: Rather than relying on complex vector embeddings or code parsers to measure diversity, CDEoH leverages the LLM’s innate semantic understanding to classify code into human-readable algorithmic categories.
  • Salvaging "Flawed Diamonds": Code that fails to execute often contains excellent high-level conceptual strategies. The reflection mechanism acts as a vital safety net, ensuring that structural innovation isn't penalized by minor implementation bugs.
An evolutionary run of CDEoH on the online bin packing problem, showing how the algorithm transitions through distinct categories to discover the final heuristic.

Key Results

CDEoH was compared against leading LLM-based AHD baselines, including EoH, FunSearch, and ReEvo, using DeepSeek-Chat as the base model.

  • Online Bin Packing: CDEoH consistently minimized the relative gap to the theoretical lower bound. In the tightest constraint settings (e.g., 5kC500), CDEoH achieved a relative gap of 0.099, drastically outperforming EoH (0.497) and FunSearch (0.447).
  • Traveling Salesman Problem: CDEoH demonstrated superior scalability. On large-scale instances (size500), CDEoH achieved an average relative gap of 17.134 against the exact LKH solver, outperforming EoH (21.448) and ReEvo (22.248).

Limitations and Future Work

While highly effective, the authors note that CDEoH does not achieve the absolute best performance in every single parameter configuration. On extremely large-scale instances, the added structural constraints of category modeling can occasionally restrict the search space too tightly. Furthermore, relying entirely on LLMs for category induction introduces a dependency on the model's semantic accuracy, leaving it vulnerable to misclassification.

Future work will focus on refining these selection mechanisms, exploring hierarchical or finer-grained category modeling, and investigating hybrid category induction methods that do not rely solely on LLMs.

Summary updated

BibTeX
@misc{wang2026cdeoh,
  author = {Yu-Nian Wang and Shen-Huan Lyu and Ning Chen and Jia-Le Xu and Baoliu Ye and Qingfu Zhang},
  title = {{CDEoH: Category-Driven Automatic Algorithm Design With Large Language Models}},
  year = {2026},
  eprint = {2603.19284},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.19284},
}
Figure