MeEvo: Metacognitive Evolution Combined with Natural Evolution for Automatic Heuristic Design

Zishang Qiu, Xinan Chen, Rong Qu, Ruibin BaiarXiv 2026

TL;DR

MeEvo is a novel Automatic Heuristic Design (AHD) framework that cyclically alternates between code-level Natural Evolution and reflection-driven Metacognitive Evolution. By combining population-driven exploration with strategic knowledge retention, MeEvo delivers state-of-the-art optimization performance and significantly lower variance, particularly on complex, heavily constrained tasks.

What Problem Does This Paper Address?

Designing optimization heuristics—rules of thumb that efficiently solve complex real-world problems like logistics or network routing—traditionally requires deep domain expertise and manual trial-and-error. Large Language Models (LLMs) have recently automated this via Automatic Heuristic Design (AHD) by generating executable code alongside natural language "reasoning traces" explaining their design choices.

However, existing LLM-based AHD frameworks are split into two isolated paradigms:

  1. Natural Evolution (NE): Frameworks like FunSearch and ReEvo apply crossover and mutation directly to the heuristic code. While great at exploring diverse strategies, they discard the LLM's reasoning traces between generations, losing the strategic knowledge behind why a piece of code worked.
  2. Metacognitive Evolution (ME): Frameworks like MeLA evolve the reasoning traces themselves through self-reflection. While excellent at accumulating design knowledge, they lack population-level diversity, limiting their ability to discover entirely new algorithmic strategies.

This paper addresses this gap by introducing MeEvo, a framework that treats code and reasoning as equal, alternating partners to prevent strategic knowledge loss while maintaining high population diversity.

TABLE I: Evolution Paradigm Comparison in LLM-based AHD

Methods

MeEvo introduces a Cyclic Alternation Architecture that coordinates two distinct evolutionary processes through a shared history repository containing reasoning traces, fitness values, execution errors, and the best-found heuristic.

TABLE I: Evolution Paradigm Comparison in LLM-based AHD

The optimization loop alternates between two phases:

  • Natural Evolution Phase ($N$ rounds): The LLM acts as an evolutionary operator executing population-driven crossover and mutation directly on the heuristic code. MeEvo introduces a hierarchical operator balance where the crossover-to-mutation ratio adapts autonomously over time. Early in the search, crossover dominates to maximize exploration; later, mutation takes over to focus on local exploitation and refinement.
  • Metacognitive Evolution Phase ($M$ rounds): The LLM steps back to reflect on the shared history. It generates structured Meta Insights consisting of a Convergence Diagnosis (identifying stagnation or steady improvement), a Limitation Analysis (uncovering cognitive biases), and a Pathway Recommendation (suggesting specific algorithmic techniques). An insight-mapping LLM then translates these strategic insights into high-quality code variants that seed the next Natural Evolution cycle.

Datasets

MeEvo was evaluated across five diverse optimization problems using two open-source LLM backbones (DeepSeek-V4-Flash and MIMO-v2.5-Pro):

  1. TSP-ACO & BPP-ACO: Downstream-solver benchmarks where the LLM generates a heuristic matrix to guide Ant Colony Optimization for the Traveling Salesperson and Bin Packing problems.
  2. Adaptive Curriculum Sequencing (ACS): A real-world constrained problem using the OULAD dataset (120 materials, 20 concepts, 30 students) to generate personalized learning paths.
  3. Wireless Sensor Network (WSN) Deployment: A real-world continuous optimization problem focused on positioning and powering 50 convergence nodes to cover 200 sensing nodes under strict signal and capacity constraints.
  4. TSP-Construct: A pure constructive-heuristic benchmark where the LLM builds a TSP tour from scratch without a downstream solver.

Key Insights and Ideas

  • Reasoning as an Immutable Asset: Reasoning traces shouldn't be treated as ephemeral byproducts of code generation. Preserving them independently allows the framework to pass strategic design logic across generations, preventing the "forgetting" behavior common in standard genetic algorithms.
  • The Necessity of Cyclic Alternation: Parallel co-evolution fails here because the two processes have incompatible operational requirements. Natural Evolution requires a stable parent pool to perform reliable crossovers, while Metacognitive Evolution needs multi-generational history to distill genuine strategic patterns from noise. Alternating them sequentially satisfies both needs.
  • Semantic Exploration-Exploitation Balance: Instead of relying on complex external rule engines to manage the search, MeEvo achieves macro-level balance purely through its cyclic rhythm and a simple, autonomous linear shift from crossover to mutation within the code space.

Key Results

MeEvo consistently achieved the best mean performance across all five optimization problems on both LLM backbones:

  • On the heavily constrained ACS and WSN tasks, MeEvo significantly outperformed the next-best architecture (MeLA), reducing final objective values while demonstrating exceptionally smooth convergence curves and lower standard deviations ($\pm 5.21$ on ACS, $\pm 0.76$ on WSN).
  • Traditional metaheuristic baselines (like GA, PSO, and Sand Cat Swarm Optimization) struggled heavily on the constrained tasks, even when given substantially larger computational budgets.
  • Heuristics generated by MeEvo demonstrated robust scale generalization and reproducibility. For instance, a heuristic optimized on a 50-city TSP generalized effectively when evaluated on 100-city instances, outperforming deep reinforcement learning approaches (like POMO) which tend to collapse under distribution shifts.

Limitations and Future Work

The authors note three primary areas for improvement:

  1. Computational Cost: MeEvo utilizes multiple distinct LLM call types (crossover, mutation, reflection, error correction), making it token-heavy. Future work will explore more cost-efficient prompting strategies.
  2. Single-Objective Focus: The current framework is tailored strictly for single-objective optimization; extending it to multi-objective scenarios remains an open challenge.
  3. Static Operator Shift: The transition from exploration to exploitation relies on a predefined linear schedule. Developing an adaptive mechanism that responds dynamically to real-time convergence behavior could further boost search efficiency.

Summary updated

Abstract

Large Language Models (LLMs) have advanced Automatic Heuristic Design (AHD) by enabling heuristic generation through reasoning and code synthesis. In LLM-based AHD, the LLM reasons about algorithm design and generates executable heuristic code. Existing architectures adopt two main paradigms: Natural Evolution applies crossover and mutation to this code to explore diverse strategies, but discards the reasoning traces behind the design decisions, weakening knowledge retention; Metacognitive Evolution retains these reasoning traces and refines them through reflection, but lacks population-level recombination, limiting exploration. These limitations reduce search efficiency, stability, and solution quality on complex problems. To address this gap, we propose MeEvo, an AHD framework that cyclically couples Natural Evolution and Metacognitive Evolution with operator balance that shifts from exploration to exploitation. Natural Evolution explores heuristic code while recording LLM-generated reasoning traces, fitness values, errors and best heuristic into a shared history; Metacognitive Evolution then reflects on this history to generate improved heuristics that feed into the next Natural Evolution cycle. This design enables population-driven exploration and reflection-driven refinement to reinforce each other. Experiments on five optimization problems show that MeEvo achieves stronger performance and lower variance than tested LLM-based AHD architectures, especially on complex constrained tasks.
BibTeX
@misc{qiu2026meevo,
  author = {Zishang Qiu and Xinan Chen and Rong Qu and Ruibin Bai},
  title = {{MeEvo: Metacognitive Evolution Combined with Natural Evolution for Automatic Heuristic Design}},
  year = {2026},
  eprint = {2606.14202},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.14202},
}

Loading related content...

Figure