TL;DR
BEAM reformulates automatic heuristic design as a bi-level optimization problem, separating high-level algorithmic structure evolution from low-level function implementation. By combining Genetic Algorithms, Monte Carlo Tree Search, and an adaptive memory module, BEAM enables Large Language Models (LLMs) to design complete, highly complex optimization solvers from scratch, significantly outperforming existing single-layer methods and state-of-the-art human-designed solvers.
What Problem Does This Paper Address?
Large Language Models (LLMs) have shown great promise in automatic heuristic design through Language Hyper-Heuristics (LHHs). However, most existing LHHs suffer from a major limitation: they only excel at optimizing a single, isolated function within a pre-defined, human-designed solver framework.
When tasked with designing an entire algorithm from scratch, single-layer evolution methods falter. They lack high-level algorithmic modeling, meaning they treat complex code as a monolithic block. This leads to massive token consumption, code generation errors, and a tendency to degrade into random search because the LLM cannot easily discern which specific code modification caused a change in performance. Furthermore, these methods lack structured external knowledge, often causing the LLM to get stuck or generate solutions that violate problem constraints.
Methods
To mirror how human experts design algorithms, the authors introduce BEAM (Bi-level Memory-adaptive Algorithmic Evolution). BEAM splits the problem into two distinct layers:
- Exterior Layer (Algorithmic Structure): Uses a Genetic Algorithm (GA) to evolve the macro-architecture of the algorithm, utilizing function placeholders (e.g., defining where a mutation or local search should happen without writing the code yet).
- Interior Layer (Function Realization): Employs Monte Carlo Tree Search (MCTS) to systematically explore and implement the specific code for those placeholders. It also includes an automated code-fixing process to handle compilation or runtime errors.
Two core modules support this bi-level architecture:
- Adaptive Memory (AM): A dynamic cache that stores high-performing low-level functions from previous generations. Instead of rewriting long code blocks repeatedly, the LLM can directly
importelite functions, drastically reducing token usage and code noise. - Knowledge Augmentation (KA) Pipeline: Before generation, the LLM extracts problem-specific tags to construct a text-based knowledge repository (
KnoBase) and a library of reusable heuristic components (HeuBase), preventing the model from searching blindly.
Datasets
BEAM was evaluated across a diverse suite of combinatorial and continuous optimization problems:
- Traditional Single-Function Benchmarks: Traveling Salesman Problem (TSP-100 to TSP-100k using Guided Local Search), Online Bin Packing Problem (BPP using Weibull distributions), and Cost-Aware Acquisition Functions (CAF) for Bayesian Optimization.
- Complex Complete Solver Benchmarks: Maximum Independent Set (MIS using RB and SATLIB graphs), Capacitated Vehicle Routing Problem (CVRP-100/200/500), and the Parallel Machine Scheduling Problem (PMSP).
Key Insights and Ideas
- Decomposition Mimics Expertise: Human experts don't write complex code monolithically; they plan frameworks and reuse components. By formalizing this as a bi-level optimization problem ($\min_{\alpha} Q(\alpha, w^*(\alpha))$), BEAM makes automated code generation structurally tractable.
- The Power of the
importStatement: The Adaptive Memory module shifts the LLM's role from raw code generation to component composition. This drastically stabilizes evolution, as the model can build upon proven building blocks rather than risking syntax errors on every generation. - Algorithmic Recombination over Mutation: Grounding the LLM with a
HeuBaseallows it to successfully combine cutting-edge heuristics (like KaHIP for graph partitioning) in novel ways that single-layer prompting strategies cannot discover.
Key Results
- CVRP Breakthrough: In hybrid algorithm design for the Capacitated Vehicle Routing Problem, BEAM reduced the optimality gap by 37.84% on aggregate compared to baseline LHHs.
- Surpassing SOTA: On the Maximum Independent Set (MIS) problem, BEAM designed a heuristic that outperformed KaMIS, a state-of-the-art human-designed solver.
- Higher Stability and Complexity: As shown in the benchmarking distribution, BEAM consistently produces code with the lowest average optimality gap and the smallest variance across multiple runs compared to alternatives like ReEvo and EoH.
Limitations and Future Work
The authors note that BEAM exhibits a tendency to overcomplicate solutions for simple objectives. Because the framework is designed to handle deep structural complexity, it often generates unnecessarily long code blocks for trivial tasks where a 20-line script would suffice.
Future work will focus on expanding BEAM to even more complex, multi-modal domains and developing more automated, efficient pipelines for the Knowledge Augmentation stage.
Summary updated