PathWise: Planning through World Model for Automated Heuristic Design via Self-Evolving LLMs

Oguzhan Gungordu, Siheng Xiong, Faramarz Fekri

Introduction

Combinatorial Optimization Problems (COPs)—such as the Traveling Salesman Problem (TSP) and vehicle routing—are NP-hard challenges that underpin modern logistics, scheduling, and resource allocation. Traditionally, solving these problems at scale requires hand-crafted "heuristics" (rules of thumb) meticulously designed by human experts.

Recently, Large Language Models (LLMs) have been leveraged to automate this process, a field known as Automated Heuristic Design (AHD). However, existing AHD frameworks like FunSearch or ReEvo treat heuristic generation as a basic evolutionary loop. Relying on fixed evolutionary rules (like simple mutation) and static prompt templates, these methods are often "myopic." They fail to reason about why a previous heuristic failed or how to strategically combine successful ideas, leading to redundant evaluations and searches that frequently stall in local optima.

To overcome these limitations, researchers introduce PathWise, a novel multi-agent reasoning framework that transforms automated heuristic design from a trial-and-error evolutionary process into a stateful, sequential planning problem.

The PathWise Framework

PathWise formulates heuristic design as a Markov Decision Process, utilizing a multi-agent architecture to plan, execute, and reflect on algorithm derivations. The core components of the system include:

  • The Entailment Graph (Stateful Memory): Instead of a simple list of past attempts, PathWise maintains an entailment graph. Every node represents a heuristic, containing its code, performance metrics, and crucially, the natural language "rationale" for its creation. Edges map the lineage of derivations, allowing the system to remember exactly how and why an algorithm evolved.
  • Multi-Agent Architecture:
    • Policy Agent (The Planner): Acts as the high-level strategist. It analyzes the entailment graph, selects promising parent heuristics, and formulates a "derivation rationale"—a natural language plan for the next algorithmic edit.
  • World Model Agent (The Executor): Takes the policy’s plan and generates the actual Python code for the new heuristic rollouts.
  • Critic Agents (The Reflectors): Comprising a Policy Critic and a World Model Critic, these agents analyze the results of each step. By comparing the "best" and "worst" rollouts from a single action, they provide "verbal gradients"—natural language feedback that guides the Policy and World Model on how to adjust their strategies in the next iteration.
  • Diversity Mechanisms: To prevent the LLM from converging on repetitive ideas, PathWise employs "Prompt-level Diversity." It samples from an inventory of exploratory directives (e.g., "Favor unusual parent combinations") to perturb the agents' prompts, ensuring a broader exploration of the algorithmic search space.

Key Innovations

PathWise introduces several paradigm shifts to the AHD landscape:

  • From Evolution to Planning: By treating algorithm design as a reasoning task, the system leverages the LLM's planning capabilities rather than relying on random mutations.
  • Lineage and Memory: Storing derivation rationales in the entailment graph prevents the system from rediscovering failed ideas and helps it understand the trajectory of successful ones.
  • Semantic Operators: Unlike traditional Genetic Programming that uses fixed mathematical operators, PathWise allows the LLM to "invent" its own evolutionary operators through natural language directives.
  • Efficiency Through Contrast: The critics generate stronger learning signals by contrasting successful and unsuccessful rollouts, providing highly targeted feedback.

Experimental Evaluation

PathWise was rigorously evaluated across a diverse set of classic and complex COPs, including the Traveling Salesman Problem (TSP), Knapsack Problem (KP), Capacitated Vehicle Routing Problem (CVRP), Multiple Knapsack Problem (MKP), Orienteering Problem (OP), and Bin Packing Problem (BPP). The evaluation included Out-of-Distribution (OOD) testing—training on small instances (e.g., 50 cities) and testing on massive ones (up to 1,000 cities).

Key Results: * Superior Performance: PathWise consistently outperformed state-of-the-art baselines (including FunSearch, EoH, ReEvo, HSEvo, and MCTS-AHD) across all tested domains. * Faster Convergence: The framework achieved better results with only 500 evaluations than most baseline methods managed with 1,000. * Strong Scalability: The performance gap between PathWise and competing methods widened as problem complexity increased. For instance, on the Knapsack Problem, PathWise demonstrated an 81% relative improvement over baselines on the largest test sets. * Model Agnosticism: While it peaks with advanced reasoning models, PathWise remains highly effective and beats baselines even when powered by smaller or open-source models like GPT-4o-mini and DeepSeek-V3.2.

Limitations and Future Directions

Like all LLM-based systems, PathWise is subject to the inherent stochasticity of model outputs. Early-stage randomness can occasionally cause a run to diverge before establishing a stable improvement pattern. Additionally, the sophisticated multi-agent reasoning loop introduces overhead in terms of token usage and wall-clock time per iteration compared to simpler evolutionary methods.

Future work will explore fine-tuning agents specifically for the AHD task to reduce reliance on off-the-shelf LLMs. The authors also aim to extend the PathWise framework to domains where evaluating a heuristic is computationally expensive, such as physical hardware design or complex scientific simulations, where its sample efficiency would be highly advantageous.

Summary updated

BibTeX
@inproceedings{gungordu2026pathwise,
  author = {Oguzhan Gungordu and Siheng Xiong and Faramarz Fekri},
  title = {{PathWise: Planning through World Model for Automated Heuristic Design via Self-Evolving LLMs}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=aiOv6NhF3N},
}
Figure