Back to the Beginning of Heuristic Design: Bridging Code and Knowledge with LLMs

Nguyen Viet Tuan Kiet, Pham Bui Dinh, Tung Dao, Cong Dao Tran, Huynh Thi Thanh Binh

TL;DR

This paper proposes a paradigm shift in LLM-driven Automatic Heuristic Design (AHD), moving from a "bottom-up" approach (evolving code and then distilling insights) to a "top-down" approach where knowledge and design principles are the primary objects of evolution. By treating code as a mere instantiation of high-level ideas, the authors achieve better search efficiency, superior cross-domain transfer, and higher interpretability across combinatorial optimization and scientific discovery tasks.

What Problem Does This Paper Address?

Combinatorial Optimization (CO) problems—like the Traveling Salesman Problem (TSP) or scheduling—are notoriously difficult. Because finding exact solutions is often computationally impossible, we rely on heuristics: "rules of thumb" that provide good-enough solutions quickly.

Recently, researchers have used Large Language Models (LLMs) to automate the design of these heuristics. However, most current frameworks operate bottom-up: the LLM generates a bunch of code, tests it, and then "reflects" on the results to try again. The authors argue this is inefficient and "memoryless." It treats knowledge as an afterthought (scaffolding) rather than the foundation. This makes it hard to transfer what was learned on one problem to a different but related one, and it makes the system prone to overfitting on small training sets.

Methods

The authors introduce a top-down paradigm for AHD. Instead of searching the space of executable programs, the algorithm searches the space of reusable abstractions.

  1. Top-Down Search: The LLM first proposes a "knowledge state" (a design principle or hypothesis). It then "realizes" this knowledge into executable code for testing. Feedback from the test is used to update the knowledge, not just the code.
  2. Dual Code-Knowledge Evolution: The authors propose a "dual" variant that maintains two populations simultaneously: one of high-level principles and one of low-level code. These populations "cross-pollinate" through:
  3. Distillation: Turning successful code into new general principles.
  4. Grounding: Using strong principles to generate better code candidates.
  5. Theoretical Framework: They formalize this using a distortion-compression trade-off. Knowledge is a "compressed" version of code. While compression might lose some fine-grained implementation details (distortion), it reduces "adaptive complexity," meaning the model is less likely to overfit to specific training instances.

Datasets

The authors evaluated their approach across a massive range of benchmarks (over 15 problems and 7 algorithms):

  • Canonical CO Problems: Traveling Salesman (TSP), Capacitated Vehicle Routing (CVRP), Orienteering (OP), Job Shop Scheduling (JSSP), and Quadratic Assignment (QAP).
  • TSP Distributions: They tested on four distinct geometric structures: Uniform, Clustered, Diagonal, and Barbell.
  • Sequential CO (SCO): Synthetic tasks like Conference Talk Scheduling and Online Ad Sequencing.
  • Symbolic Regression (SR): Discovering equations for physical systems (e.g., damped oscillators).
  • Protein Engineering (PE): Designing acquisition functions to find high-fitness protein sequences.

Key Insights and Ideas

  • Knowledge as a First-Class Object: By making "principles" the primary thing being evolved, the search becomes more like human scientific inquiry—forming hypotheses and testing them—rather than random code mutation.
  • The Power of "Sparse Evaluation": In a surprising finding, the top-down approach performed exceptionally well even when only half of the generated candidates were actually evaluated. Because the LLM can reason about the structure of unevaluated code through its knowledge framework, it doesn't need to run every single test to make progress.
  • Cross-Backbone Transfer: Knowledge is more "portable" than code. The authors showed that principles learned for one solver (e.g., Ant Colony Optimization) could be successfully adapted to guide entirely different solvers (e.g., Guided Local Search), even when the code itself was incompatible.
  • Interpretability: Because the system explicitly states its "strategy" before writing the code, the resulting heuristics are much easier for humans to understand and verify.

Key Results

  • Performance Gains: Top-down variants consistently outperformed bottom-up baselines across most CO tasks. For example, in TSP and CVRP, the top-down approach achieved lower optimality gaps (better solutions) than standard code-centric pipelines.
  • Efficiency: In the Protein Engineering tasks, the dual code-knowledge variant often achieved the best average rank, showing that combining implementation feedback with hypothesis evolution provides a "best of both worlds" signal.
  • Robustness: Under "Sparse Evaluation," the top-down ReEvo variant achieved the best test performance among all contemporary AHD methods, despite using only half the evaluation budget.

Limitations and Future Work

  • Fidelity of Abstraction: The authors note that if the "knowledge" is too abstract or "coarse," it might discard low-level implementation details that are actually critical for performance. In these cases, bottom-up search might still be better.
  • LLM Prior Dependence: The success of top-down search relies on the LLM's ability to form meaningful abstractions. If the problem description is misleading or the LLM lacks domain intuition, the "knowledge" it generates can bias the search in the wrong direction.
  • Future Directions: The authors suggest moving toward more principled "knowledge evolution" that can reduce overfitting to finite training sets while preserving the structural "DNA" of good code. They also plan to release their full codebase and datasets to the research community.

Summary updated

BibTeX
@inproceedings{kiet2026back,
  author = {Nguyen Viet Tuan Kiet and Pham Bui Dinh and Tung Dao and Cong Dao Tran and Huynh Thi Thanh Binh},
  title = {{Back to the Beginning of Heuristic Design: Bridging Code and Knowledge with LLMs}},
  booktitle = {DL4C @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=wmZ4KA2l8x},
}
Figure