TL;DR
MOSAIC introduces an adversarial co-evolutionary framework for Large Language Model (LLM)-based automated heuristic design. By simultaneously evolving hard, discriminative problem instances and region-specific specialist heuristics within a Quality-Diversity grid, it maps out algorithmic strengths and weaknesses. This process yields a highly complementary portfolio of heuristics that consistently outperforms state-of-the-art methods across multiple combinatorial optimization problems.
What Problem Does This Paper Address?
Automated Heuristic Design (AHD) leverages LLMs to write code for solving complex Combinatorial Optimization Problems (COPs) like routing and scheduling. However, existing AHD frameworks suffer from a major limitation: they optimize for average performance across a small, fixed training dataset.
According to the No Free Lunch theorem, no single heuristic can dominate every type of problem structure. Furthermore, current methods guide the LLM's search using simple scalar feedback (i.e., telling the LLM whether a new heuristic is "better" or "worse" overall). This "verbal gradient" lacks directional information; it tells the LLM that a change helped, but not where in the problem space it succeeded or why. As a result, LLM-generated heuristics often generalize poorly to out-of-distribution problem instances.
Methods
The authors propose MOSAIC (Map Of Specialists via Adversarial Instance Co-evolution), which treats instance generation and heuristic generation as an adversarial minimax game.
The core architecture relies on a Quality-Diversity (QD) grid archive, where the axes represent bounded, structural features of the problem instances (e.g., city distribution statistics for routing problems). The framework operates in an iterative loop:
- Distant Parent Selection: Pairs of specialist heuristics are sampled from distant regions of the feature grid.
- Discriminative Instance Generation: An LLM-guided evolutionary loop generates new problem instances designed to maximize the performance gap between the two parent heuristics.
- Decision-Tree Analysis: A shallow decision tree maps out the exact feature-space boundaries where each heuristic wins.
- Contrastive Multi-Directional Reflection: A reflection LLM analyzes the winning regions to distill explicit, natural-language insights explaining why a strategy works. These insights are stored directly inside the corresponding grid cells, creating a persistent, spatially-grounded memory.
- Region-Aware Crossover & Mutation: New heuristics are generated using prompts conditioned on these localized insights. Crucially, new candidates are evaluated only within local "cube neighborhoods" in the grid, ensuring that a region-specific specialist isn't prematurely discarded due to poor global average performance.
At test time, a compact, highly complementary portfolio of heuristics is extracted from the archive using a greedy selection strategy.
Datasets
MOSAIC was evaluated across three classic COPs, training on small instance sizes ($n=50$ or $100$) and testing on larger scales to evaluate generalization:
- Traveling Salesman Problem (TSP): Evaluated on synthetic layouts (Uniform, Grid, Ring, and Mixture) and real-world instances from the standard TSPLIB benchmark.
- Knapsack Problem (KP): Evaluated across five value-weight correlation regimes (Uncorrelated, Weakly/Strongly/Inverse-Correlated, and Subset-Sum).
- Capacitated Vehicle Routing Problem (CVRP): Evaluated on uniform, clustered, and depot-correlated customer distributions.
Key Insights and Ideas
- Instances as Active Experimental Design: Instead of treating the training set as fixed, MOSAIC uses instance generation to actively probe the boundaries of current heuristics. Evolving instances to maximize cost-ratio margins acts as a proxy for a Bayes factor, generating data with maximal power to discriminate between algorithms.
- Spatially-Grounded Persistent Memory: Traditional LLM optimization discards reflections after a single iteration. By anchoring natural-language insights to specific grid cells, MOSAIC accumulates a durable, region-aware prior that survives even when individual heuristics are replaced.
- Co-evolution Solves the Trade-off: Standard evolutionary instance generators often trade off feature-space coverage for instance hardness. MOSAIC achieves both simultaneously because its target landscape constantly shifts as new heuristic specialists emerge.
Key Results
MOSAIC was tested using both GPT-4o-mini and GPT-5-nano backbones against state-of-the-art AHD baselines (including ReEvo, MCTS-AHD, PathWise, and EoH-S).
- Heuristic Performance: As shown in the results table, MOSAIC consistently achieves the lowest optimality gaps. At Top-5 selection with
GPT-5-nano, MOSAIC's portfolio outperforms the Oracle bounds (the absolute best single heuristic found during the entire search) of all baselines on large-scale problems. - Instance Quality: MOSAIC's instance generator covers up to 33% more of the structural feature grid while producing instances that are 23% harder and 34% more discriminating than standard Quality-Diversity evolutionary baselines.
- Real-World Generalization: On the TSPLIB benchmark, the extracted MOSAIC portfolio achieved the lowest average optimality gap ($9.50\%$) compared to both classical constructive baselines and advanced AHD methods.
Limitations and Future Work
While MOSAIC demonstrates remarkable sample efficiency and generalization, the authors note or imply a few boundaries:
- Feature Dependency: The framework relies on predefined, analytically bounded structural features to set up the QD grid axes. Extending this to problems where such features are unknown or difficult to bound remains an open challenge.
- Constructive Focus: The current implementation focuses on constructive heuristics (building a solution step-by-step). Adapting the contrastive reflection mechanism to local search or iterative improvement heuristics is a promising direction for future research.
Summary updated