NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Teacher-Aware Evolution of Heuristic Programs from Learned Optimization Policies

Minyu Chen, Song Qin, Ling-I Wu, Jianxin Xue, Guoqiang LiNeurIPS 2026

TL;DR

Large Language Models (LLMs) can evolve surprisingly good code for tough optimization problems, like routing delivery trucks or scheduling factory floors, simply by looking at final scores. This paper shows they get much better if you pair them with a pre-trained neural network acting as a coach—critiquing the code's individual, step-by-step decisions during training. Best of all, once the LLM finishes evolving the code, you throw the neural network away, leaving behind a fast, lightweight, human-readable program that runs on a basic CPU.

What Problem Does This Paper Address?

Combinatorial optimization problems—finding the best order to run factory jobs, route vehicles, or partition graphs—are everywhere. In the real world, engineers love solving them with heuristics: compact, fast, interpretable rules of thumb written as ordinary code. Writing great heuristics by hand, however, takes deep domain expertise and endless trial-and-error.

Recently, researchers started using LLMs to automatically write and evolve heuristic code (a field called Automatic Heuristic Design). Typically, the LLM writes a batch of programs, runs them on test problems, looks at the final scores (like total route distance), and tries to breed better versions. The catch? Relying only on delayed endpoint feedback is like trying to fix your golf swing when a coach only tells you your final 18-hole score. You don't know which local decisions went wrong.

Meanwhile, Deep Reinforcement Learning (DRL) has produced neural networks that are fantastic at making step-by-step optimization decisions. Unfortunately, deploying heavy neural networks in production isn't always practical—especially in CPU-only environments or industries requiring inspectable, auditable code. The authors bridge these two worlds: what if we use neural networks during development to critique the LLM's step-by-step choices, while keeping the final output as pure, standalone code?

Methods

The authors build upon standard LLM evolutionary search—generating a population of Python-like scoring functions and iteratively mutating them—and inject an external, pre-trained optimization neural network as a behavioral teacher.

Figure 1: Teacher-aware heuristic evolution. Program and teacher decisions on visited states provide behavioral evidence. Population analysis guides rewrite and calibration; fusion analyzes its selected pair. Evaluated offspring undergo Pareto retention to form the next population.

Here is how a generation plays out:

  1. On-Policy Teacher Diagnostics: Candidate programs solve problem instances step-by-step. Along the exact states visited by a candidate program, the system queries the black-box teacher: "What action would you have picked here?" It calculates top-1 agreement (Align) and logs specific cases where the program and teacher disagreed.
  2. Teacher-Guided Reflection & Revision: An LLM analyzer studies these disagreements and guides three distinct code-editing operators:
  3. Structural rewrite: Overhauls a high-level decision component to fix recurring disagreements.
  4. Parameter calibration: Tweaks weights, thresholds, or tie-breakers without changing the code's backbone.
  5. Mechanism-level fusion: Combines a high-scoring parent program with a high-alignment parent program to get the best of both worlds.
  6. Multi-Objective Selection: Rather than keeping only the highest-scoring programs, the population is filtered using Pareto dominance across three goals: task performance, teacher alignment, and decision runtime. Crucially, when evolution finishes, the final winning program is chosen purely by task performance—not how obediently it copied the teacher.

Datasets

No new datasets are introduced; the method is evaluated across four classic sequential optimization benchmarks, testing both in-distribution performance and out-of-distribution (OOD) generalization to larger or structurally different problems:

  • Job-Shop Scheduling (JSSP): Evolved on synthetic instances ($10\times10$ to $20\times20$) and tested OOD on larger random instances ($30\times20, 50\times20$) and standard Taillard benchmarks.
  • Traveling Salesman (TSP) & Capacitated Vehicle Routing (CVRP): Evolved on 50-node Euclidean instances and tested OOD on 200-node instances, TSPLIB70, and VRPLIB192.
  • Max-Cut: Evolved on 200-vertex weighted Barabási–Albert (BA200w) graphs and transferred OOD to Erdős–Rényi (ER) topologies, 800-vertex weighted/unweighted graphs, and real-world Physics graphs.

Key Insights and Ideas

  • Guidance, not imitation: Unlike policy distillation—which tries to faithfully compress a neural network into a simpler program—this framework treats the neural network as an imperfect advisor. Because final selection is based on true task scores, evolving programs can absorb the teacher's smart habits while outgrowing its blind spots. On JSSP and Max-Cut, the evolved static heuristics actually beat their own neural teachers!
  • On-policy querying matters: The teacher isn't just demonstrating its own favorite trajectories; it evaluates states induced by the candidate programs. That means programs get targeted feedback on the exact messes they get themselves into.
  • Diagnosis beats blind retention: Ablation studies reveal that using teacher feedback to diagnose and rewrite code has a much bigger, more consistent payoff than simply favoring teacher-aligned programs during population survival.

Key Results

Across a tight search budget of 100 function evaluations, teacher-aware evolution outperforms performance-only LLM baselines (EoH and ReEvo) across every benchmark:

Table 4: OOD generalization on JSSP. Heuristics evolved on 20 × 20 are evaluated on larger random instances and Taillard benchmark instances. We report makespan and runtime separately. Lower is better for both metrics. Column colors indicate method families: blue for our method, orange for LLM-based heuristic evolution baselines, green for classical dispatching rules, and purple for learned dispatching policies.
  • Scheduling (JSSP): On $20\times20$ instances, it lowers makespan to 1812.16 (beating EoH's 1821.65 and the Offline-LD teacher's 1971.33) while running over 12$\times$ faster than the neural teacher (18.59s vs. 228.69s). These gains hold up on larger OOD Taillard benchmarks.
  • Routing (TSP & CVRP): Consistently beats LLM baselines across scales—for example, cutting TSP200 tour length to 12.499 (vs. 12.713 for EoH) and VRPLIB192 route length to 38,099.15 (even beating the LEHD neural teacher's 39,120.68).
  • Graph Search (Max-Cut): Achieves the highest mean cut across all seven synthetic and real-world graph sets (e.g., 718.00 on OOD BA800w vs. 700.72 for EoH and 703.43 for the ECO-DQN teacher).
  • Faster Convergence: Training curves show the method pulls ahead of EoH and ReEvo within just 20 evaluations, proving local behavioral signals dramatically speed up early search.

Limitations and Future Work

  • Need for a teacher and adapter: You can't use this out-of-the-box on a brand-new problem unless you already have a pre-trained optimization policy with a compatible action space, plus a hand-written "task interface adapter" to translate disagreements for the LLM.
  • Extra search overhead: Querying the teacher and running an LLM population analyzer adds compute cost during the evolutionary phase (even if deployment is free of neural networks), and bad teachers could mislead the search.
  • Future directions: Automating the creation of task adapters and triggering teacher feedback adaptively—only asking the coach for help when evolution gets stuck.

Summary updated

BibTeX
@inproceedings{chen2026teacher,
  author = {Minyu Chen and Song Qin and Ling-I Wu and Jianxin Xue and Guoqiang Li},
  title = {{Teacher-Aware Evolution of Heuristic Programs from Learned Optimization Policies}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=dXWka7F0Ie},
}
Figure