betaFeedback

WorksComputer Science

EPOCH: Coverage-Aware Evolution with Experiential Preference Optimization for LLM-based Automated Heuristic Design

Abstract

LLM-based automated heuristic design (AHD) discovers heuristics for combinatorial optimization problems (COPs), where an LLM generates candidates in an evolutionary search. Existing frameworks freeze the generator or fine-tune it on a scalar fitness signal hiding which instances each heuristic covers. Reflection-based frameworks improve heuristics with natural-language feedback, but it stays in the prompt and never reaches the generator's weights. We propose EPOCH, which makes instance coverage the objective of the evolutionary search and fine-tunes the generator to internalize reflection. Parent selection, operator allocation, and stagnation recovery all optimize how well the heuristics jointly cover the training instances, so the search returns a complementary heuristic ensemble. The generator learns from its own search by experiential preference optimization. A teacher LLM returns a natural-language insight on the generated heuristics, and the generator produces new heuristics with this insight. These improvements join the preference pairs for direct preference optimization (DPO). Since DPO only teaches the generator to rank these improvements, a reflective self-distillation (RSD) term makes it more likely to generate them on its own, and the gains accumulate over the long horizon of the search. Across COPs and open-source LLM backbones, EPOCH's heuristic ensembles outperform inference-only and fine-tuned baselines and generalize across problem scales.

Introduction

Many operational decisions, from vehicle routing to scheduling, are COPs (Tam et al., 2024). Because these problems are typically NP-hard, practitioners rely on heuristics that trade optimality for speed [16, 9]. Designing a strong heuristic by hand demands expertise, and a design for one problem rarely carries over to its variants [4] (Pillay and Qu 2018). AHD makes the heuristic itself the object of search [2], classically with genetic programming, which cannot express heuristics beyond its human-defined function set [17, 8].

LLM-based AHD replaces that function set with a large language model (LLM) that generates heuristics in the evolutionary loop (Liu et al., 2023), demonstrated by FunSearch (Romera-Paredes et al., 2023) and EoH [20]. ReEvo (Ye et al., 2024) adds reflection (Shinn et al., 2023), HSEvo [6] maintains population diversity, MCTS-AHD (Zheng et al., 2025) organizes heuristics in a Monte Carlo tree, and EoH-S [19] evolves a complementary set of heuristics. All keep the generator frozen. CALM [14] and EvoTune (Šurina et al., 2025) instead fine-tune the generator on the heuristics it generates, using group-relative policy optimization (GRPO) (Shao et al., 2024) with a manually designed, graded scalar reward and DPO (Rafailov et al., 2023) with fitness-ranked pairs, respectively. In both, a heuristic is reduced to a single number, so the update drives the generator toward one best-on-average heuristic, with no reflection on the generated heuristics. Appendix § 6 gives an extended review of related work.

Despite this progress, two limitations remain. First, no heuristic is best on every instance of a distribution [19], and a scalar fitness hides which instances each heuristic wins, so the coverage of the training instances cannot guide the evolutionary search beyond survivor selection. Second, the natural-language feedback of the inference-only methods stays inside the prompt and never reaches the generator’s weights, and the fine-tuned methods employ no reflection. We therefore propose Experiential Preference Optimization for Coverage-aware Heuristic Design (EPOCH), a framework that fine-tunes the generator during a coverage-aware evolutionary search and turns teacher-guided reflection into a training signal.

Our main contributions are as follows. (1) We develop a coverage-aware LLM-based AHD framework that fine-tunes the generator and threads each heuristic’s per-instance optimality gaps through parent selection, operator allocation, stagnation recovery, and the selection of the deployed heuristic ensemble, so the search optimizes instance coverage rather than average fitness. (2) We convert teacher-guided reflection into a training signal, where a teacher LLM serves only as a critic, the improvements it guides form preference pairs, and a reflective self-distillation term internalizes them so the gains accumulate over the search. (3) We design an adaptive operator bandit that favors the evolutionary operators improving instance coverage, and a coverage-based stagnation recovery with a persistent archive to preserve the best heuristics found on each instance. (4) Experiments across COPs and LLM backbones show that the heuristic ensembles discovered by EPOCH outperform inference-only and fine-tuned LLM-based AHD baselines and generalize across problem scales.

Preliminaries

Automated Heuristic Design Setup. We consider a COP with an instance space X\mathcal{X} and a solution space S\mathcal{S}. Each heuristic h∈Hh \in\mathcal{H} is an executable program that constructs a feasible solution, h:X→Sh:\mathcal{X} \to\mathcal{S}, and a cost function f:S→Rf:\mathcal{S} \to\mathbb{R} scores it. Performance is assessed on a training set Dtrain={x1,…,xm}\mathcal{D}_{\mathrm{train}} = \{x_1,\ldots,x_m\}. Conventional AHD summarizes a heuristic by the scalar fitness

P(h)=1m∑i=1m[−f(h(xi))](1)P(h) = \frac{1}{m}\sum_{i=1}^{m}\left[-f(h(x_i))\right] \tag*{(1)}

and, under an evaluation budget, returns the single best-on-average heuristic h∗=arg⁡max⁡h∈HP(h)h^* = \arg\max_{h \in\mathcal{H}} P(h). EPOCH instead searches for a set of complementary heuristics covering Dtrain\mathcal{D}_{\mathrm{train}} and retains each heuristic’s full per-instance performance profile (Section 3.1) rather than the scalar of Eq. (1).

Direct Preference Optimization. EPOCH updates the generator with DPO (Rafailov et al., 2023), which trains a policy πθ\pi_\theta on triplets of a prompt qq, a preferred response y+y^+, and a dispreferred response y−y^-, relative to a reference policy πref\pi_{\mathrm{ref}}. With the policy-side implicit reward r^θ(y)=βlog⁡(πθ(y∣q)/πref(y∣q))\hat{r}_\theta(y) = \beta\log(\pi_\theta(y \mid q)/\pi_{\mathrm{ref}}(y \mid q)), the loss

LDPO(πθ)=−E(q,y+,y−)[log⁡σ(r^θ(y+)−r^θ(y−))](2)\mathcal{L}_{\mathrm{DPO}}(\pi_\theta) = -\mathbb{E}_{(q,y^+,y^-)}\left[\log\sigma\left(\hat{r}_\theta(y^+) - \hat{r}_\theta(y^-)\right)\right] \tag*{(2)}

widens the margin r^θ(y+)−r^θ(y−)\hat{r}_\theta(y^+) - \hat{r}_\theta(y^-), where σ\sigma is the logistic function and β\beta regularizes towards πref\pi_{\mathrm{ref}}. As the evolving policy itself generates our preference data, DPO runs in periodic bursts.

Methodology

EPOCH augments an LLM-based evolutionary loop with two coupled ideas. The search maintains a heuristic pool P\mathcal{P}, initialized from a seed heuristic; its Np=10N_p=10 heuristics with the lowest average gap form the reproduction population PNp\mathcal{P}_{N_p}. Each iteration draws an operator, builds a prompt from parents selected from this population, samples candidates from the policy πθ\pi_{\theta}, and admits the valid ones into P\mathcal{P}. A per-instance gap-vector representation makes the search coverage-aware, and an experiential preference-optimization update, fed by teacher-guided reflection and an RSD term that internalizes its gains, fine-tunes the generator on its own evolutionary search. Sections 3.1–3.7 present the representation, parent selection, the evolutionary operators, the operator bandit, coverage stagnation and recovery, the reflective rollout, and experiential preference optimization, respectively. Figure 1 illustrates one training iteration and Algorithm 1 gives its pseudocode, with the complete pseudocode of its subalgorithms in Appendix § 8.

Figure 1. Overview of EPOCH, illustrating one training iteration. (1) Heuristics are represented by per-instance gap vectors, whose minima define expert heuristics and the coverage gap ρ(P)\rho(\mathcal{P}). (2) These drive parent selection, operator allocation, and coverage-aware population management. (3) The policy πθ\pi_\theta samples rollouts from the operator prompt qq, the teacher πT\pi_T returns an insight zz on the best and worst valid ones, and πθ\pi_\theta regenerates from q⊕zq \oplus z. (4) Responses form within-batch and cross-round preference pairs; periodic DPO bursts add an RSD term internalizing the hint-guided improvement into the unhinted policy.

Per-Instance Gap Vectors, Experts, and Coverage

Let fi∗f_i^* denote a reference optimum for training instance xix_i, e.g., an optimal tour length for the Traveling Salesman Problem (TSP) or the L1L_1 lower bound on bin count for online Bin Packing (OBP). The per-instance optimality gap of hh on xix_i is

γi(h)=f(h(xi))−fi∗∣fi∗∣,(3)\gamma_i(h) = \frac{f(h(x_i))-f_i^*}{\lvert f_i^*\rvert}, \tag*{(3)}

which is 0 when hh is optimal on xix_i and grows with sub-optimality. We represent hh by its gap vector

γ(h)=(γ1(h),…,γm(h))∈Rm,γˉ(h)=1m∑i=1mγi(h),(4)\gamma(h) = (\gamma_1(h),\ldots,\gamma_m(h)) \in\mathbb{R}^m, \qquad \bar{\gamma}(h) = \frac{1}{m}\sum_{i=1}^{m}\gamma_i(h), \tag*{(4)}

where γˉ(h)\bar{\gamma}(h) is the average gap over the mm instances. Given the current pool of heuristics P\mathcal{P}, define the pool’s best per-instance gap as γi∗(P)=min⁡h∈Pγi(h)\gamma_i^*(\mathcal{P})=\min_{h\in\mathcal{P}}\gamma_i(h), the lowest gap any pool member attains on instance xix_i. The heuristic achieving this minimum is the expert heuristic for instance xix_i, and the expert count

e(h;P)=∣{i:h=arg⁡min⁡h′∈P γi(h′)}∣(5)e(h;\mathcal{P}) = \left|\left\{i:h=\underset{h'\in\mathcal{P}}{\arg\min}\ \gamma_i(h')\right\}\right| \tag*{(5)}

counts the instances on which hh is uniquely best in the pool; a heuristic with e(h;P)>0e(h;\mathcal{P})>0 is an expert heuristic. The quality of the pool as a portfolio is captured by the coverage gap

ρ(P)=1m∑i=1mγi∗(P)=1m∑i=1mmin⁡h∈Pγi(h),(6)\rho(\mathcal{P})=\frac{1}{m}\sum_{i=1}^{m}\gamma_i^*(\mathcal{P})=\frac{1}{m}\sum_{i=1}^{m}\min_{h\in\mathcal{P}}\gamma_i(h), \tag*{(6)}

obtained by routing each instance to its best heuristic in P\mathcal{P}. Unlike the single-best average gap min⁡hγˉ(h)\min_h\bar{\gamma}(h), the coverage gap ρ(P)\rho(\mathcal{P}) improves whenever any heuristic becomes a better expert on any instance, even while the single best heuristic is unchanged. This set-level objective has previously guided survivor selection within an inference-only search [19]. EPOCH instead makes it the control signal of the entire search. Finally, the complementarity of two heuristics is the ℓ1\ell_1 distance between their gap vectors [19],

d(h,h′)=∥γ(h)−γ(h′)∥1=∑i=1m∣γi(h)−γi(h′)∣,(7)d(h,h')=\lVert\gamma(h)-\gamma(h')\rVert_1 =\sum_{i=1}^{m}\lvert\gamma_i(h)-\gamma_i(h')\rvert, \tag*{(7)}

which is large when two heuristics behave differently across instances.

Expert-Aware Parent Selection

The evolutionary operator prompts are seeded with parent heuristics drawn by rank-based sampling from the reproduction population PNp\mathcal{P}_{N_p}, the NpN_p heuristics of P\mathcal{P} with the lowest average gap; expert counts in this section are computed within that subset. A draw h∼Rank⁡(PNp;ζ)h\sim\operatorname{Rank}(\mathcal{P}_{N_p};\zeta) selects hh with probability proportional to 1/rank⁡1/\operatorname{rank} under the ordering key ζ\zeta, with ↓\downarrow and ↑\uparrow denoting descending and ascending order. The single-parent mutation operators draw

h1∼{Rank⁡(PNp;e(⋅;PNp)↓)w.p. pexp=0.5,Rank⁡(PNp;γˉ(⋅)↑)otherwise,(8)h_1\sim \begin{cases} \operatorname{Rank}(\mathcal{P}_{N_p};e(\cdot;\mathcal{P}_{N_p})\downarrow) & \text{w.p. }p_{\mathrm{exp}}=0.5,\\ \operatorname{Rank}(\mathcal{P}_{N_p};\bar{\gamma}(\cdot)\uparrow) & \text{otherwise,} \end{cases} \tag*{(8)}

where the expert-count branch, taken with probability pexpp_{\mathrm{exp}}, recruits expert heuristics for under-covered instances, and the average-gap branch refines strong all-rounders. The crossover operator draws h1∼Rank⁡(PNp;γˉ(⋅)↑)h_1\sim\operatorname{Rank}(\mathcal{P}_{N_p};\bar{\gamma}(\cdot)\uparrow) and

h2∼{softmax⁡(d(h1,⋅)/τ), τ=0.5w.p. pcomp=0.5,Rank⁡(PNp;γˉ(⋅)↑)otherwise,(9)h_2\sim \begin{cases} \operatorname{softmax}(d(h_1,\cdot)/\tau),\ \tau=0.5 & \text{w.p. }p_{\mathrm{comp}}=0.5,\\ \operatorname{Rank}(\mathcal{P}_{N_p};\bar{\gamma}(\cdot)\uparrow) & \text{otherwise,} \end{cases} \tag*{(9)}

where the complementarity branch, taken with probability pcompp_{\mathrm{comp}}, pairs the first parent with its most complementary counterpart under Eq. (7), and the average-gap branch pairs it with a strong all-rounder. The branch taken in Eq. (9) also determines the crossover variant of § 3.3. Algorithm 2 implements this as SelectParents.

Evolutionary Operators

EPOCH evolves heuristics with five evolutionary operators, a two-parent crossover operator and four single-parent mutation operators, all sharing a common prompt skeleton that presents each parent’s design idea, code, and average gap; the full templates and their sources are given in Appendix I.

  • Crossover recombines two parents, with the variant set by the branch of Eq. (9):

    • Exploitative crossover, used when the second parent was chosen by average-gap rank, asks for a heuristic that outperforms both parents on the same instances.

    • Complementary crossover, used when the second parent was chosen by complementarity, asks for a heuristic that unites the parents’ strengths across all instances either of them already handles well.

  • Simplification takes one parent and distills it into a more concise, elegant version, countering the build-up of redundant components.

  • Injection takes one parent and adds a novel component to it while preserving its core mechanism.

  • Replacement takes one parent, locates a component that scores competing choices nearly equally, and rewrites it to differentiate them.

  • Refine takes one parent, identifies its single most important weakness, and rewrites it to fix that weakness while preserving the parts that already work well.

Adaptive Operator Bandit

EPOCH allocates operator probabilities adaptively, favoring operators that advance instance coverage. For each operator o∈Oo \in\mathcal{O} we keep a quality estimate Qo∈[0,1]Q_o \in[0,1], an exponential moving average of a per-draw reward. After oo is drawn and its children are scored, let gog_o be the fraction of the mm instances on which any of its children improves the pool’s best per-instance gap measured before admission, νp\nu_p the fraction of valid children whose average gap beats the best parent’s, and νv\nu_v the valid fraction. The reward combines these as

Ro=wego+wpνp+wvνv,(10)R_o = w_e g_o + w_p \nu_p + w_v \nu_v, \tag*{(10)}

with weights (we,wp,wv)=(0.6,0.25,0.15)(w_e,w_p,w_v)=(0.6,0.25,0.15), so the coverage gain gog_o dominates. The quality is updated as Qo←(1−η)Qo+ηRoQ_o \leftarrow(1-\eta)Q_o+\eta R_o with η=0.3\eta=0.3, and operators are drawn with probability

ωo=wo0clip⁡(eκ(Qo−Qˉ),12,2),\omega_o = w_o^0 \operatorname{clip}\left(e^{\kappa(Q_o-\bar{Q})},\frac{1}{2},2\right),
po=ϕ+(1−kϕ)ωo∑o′ωo′,(11)p_o = \phi+ (1-k\phi)\frac{\omega_o}{\sum_{o'}\omega_{o'}}, \tag*{(11)}

where Qˉ\bar{Q} is the mean quality over the kk eligible operators, wo0w_o^0 a fixed prior, set to 3 for crossover and 1 otherwise, offsetting the split of the crossover draw between its two variants, κ=6\kappa=6 a steepness, and ϕ=0.05\phi=0.05 a probability floor. Centering on Qˉ\bar{Q} promotes above-average operators, while the clip and the floor keep every probability in a bounded band, so the bandit concentrates budget without starving any operator. After the recovery of § 3.5 the quality estimates are stale, so all QoQ_o are reset to 0. Algorithms 3 and 4 implement the draw and the update as DrawOperator and UpdateBandit.

Coverage Stagnation and Expert-Preserving Recovery

Self-reinforcing prompting can drive the pool onto minor variants of the current best heuristic, so EPOCH performs coverage-aware population management, detecting coverage stagnation and countering it with an expert-preserving recovery that shrinks the pool to Np/2N_p/2 heuristics. The stagnation criterion is keyed to the coverage gap rather than the single best heuristic, which can stay unchanged while the pool keeps gaining expert heuristics. Each iteration recomputes ρ(P)\rho(\mathcal{P}) and its best value ρ⋆\rho^\star, registering an improvement when

ρ(P)<ρ⋆−ϵρ,(12)\rho(\mathcal{P}) < \rho^\star-\epsilon_\rho, \tag*{(12)}

for an absolute margin ϵρ=10−4\epsilon_\rho=10^{-4}. The recovery fires after Tρ=10T_\rho=10 iterations without improvement, or Tcap=40T_{\mathrm{cap}}=40 iterations after the last recovery, the latter forcing a periodic reset in long improvement stretches. It rebuilds the pool from the best-by-average-gap heuristic, the seed, and the highest-expert-count heuristics, resets the bandit’s quality estimates, and restarts the stagnation window by setting ρ⋆\rho^\star to the recovered pool’s coverage gap. A persistent expert archive A\mathcal{A}, untouched by recovery, retains the best heuristics found on each training instance, so the pool can shrink aggressively without losing discovered expert heuristics. Algorithm 5 implements the recovery as Recover.

Teacher-Guided Reflective Rollout

Each iteration, the policy first generates the Round-1 rollouts Y1Y_1, N1=4N_1=4 responses to the operator

Algorithm 1 EPOCH: one training iteration

Input: policy πθ\pi_\theta; teacher πT\pi_T; pool P\mathcal{P}; expert archive A\mathcal{A}; preference buffer B\mathcal{B}; iteration index tt

Output: updated P\mathcal{P}, A\mathcal{A}, B\mathcal{B}, πθ\pi_\theta

  1. Coverage-aware population management

  2. P←RECOVER⁡(P)\mathcal{P} \leftarrow\operatorname{RECOVER}(\mathcal{P}) ▷ stagnation and rebuild, Alg. 5

  3. Reflective rollout

  4. o←DRAWOPERATOR⁡()o \leftarrow\operatorname{DRAWOPERATOR}() ▷ bandit draw, Alg. 3

  5. S←SELECTPARENTS⁡(P,o)S \leftarrow\operatorname{SELECTPARENTS}(\mathcal{P},o) ▷ expert-aware, Alg. 2

  6. q←Prompt⁡(o,S)q \leftarrow\operatorname{Prompt}(o,S) ▷ operator prompt

  7. Y1←{yj∼πθ(⋅∣q)}j=1N1Y_1 \leftarrow\{y_j \sim\pi_\theta(\cdot\mid q)\}_{j=1}^{N_1} ▷ Round 1, unhinted; evaluate γˉ\bar{\gamma}

  8. z←πT(q,Y1)z \leftarrow\pi_T(q,Y_1) ▷ natural-language insight

  9. Y2←{yj∼πθ(⋅∣q⊕z)}j=1N2Y_2 \leftarrow\{y_j \sim\pi_\theta(\cdot\mid q \oplus z)\}_{j=1}^{N_2} ▷ Round 2, hinted; evaluate γˉ\bar{\gamma}

  10. Admission, pairing, and bookkeeping

  11. F←(γ1⋆(P),…,γm⋆(P))F \leftarrow(\gamma_1^\star(\mathcal{P}),\ldots,\gamma_m^\star(\mathcal{P})) ▷ pre-admission snapshot

  12. P←P∪{hy∣y∈Y1∪Y2, y valid}\mathcal{P} \leftarrow\mathcal{P} \cup\{h_y \mid y \in Y_1 \cup Y_2,\ y\ \text{valid}\} ▷ admit

  13. B←B∪BUILぱAIRS⁡(q,Y1,Y2)\mathcal{B} \leftarrow\mathcal{B} \cup\operatorname{BUILぱAIRS}(q,Y_1,Y_2) ▷ pairs, Alg. 6

  14. UPDATEBANDIT⁡(o,Y1,Y2,F)\operatorname{UPDATEBANDIT}(o,Y_1,Y_2,F) ▷ reward, Alg. 4

  15. A←UpdateArchive⁡(A,P)\mathcal{A} \leftarrow\operatorname{UpdateArchive}(\mathcal{A},\mathcal{P}) ▷ per-instance experts

  16. Policy update

  17. if t mod Tdpo=0t \bmod T_{\mathrm{dpo}}=0 then

  18. πθ←DPOBURST⁡(πθ,B)\pi_\theta\leftarrow\operatorname{DPOBURST}(\pi_\theta,\mathcal{B}) ▷ DPO + RSD, Eq. (14)

  19. end if

  20. return P,A,B,πθ\mathcal{P},\mathcal{A},\mathcal{B},\pi_\theta

prompt qq. Each response states a design idea and implements it as an executable heuristic. An external teacher LLM πT\pi_T reads qq and Y1Y_1 and returns a natural-language insight zz, and the policy generates the Round-2 rollouts Y2Y_2, N2=4N_2=4 responses to the insight-augmented prompt q~=q⊕z\tilde{q}=q\oplus z; we refer to q~\tilde{q} and qq as the hinted and unhinted prompts. The teacher contributes only this critique, queried once per iteration, and generates neither heuristics nor training data, so every heuristic and every preference pair comes from the policy itself. The teacher’s full prompt appears in Appendix § 15. The critique adapts to how many valid responses Round 1 produced, where a response yy is valid when it follows the output format, parses into an executable heuristic hyh_y, and runs on the training instances without failure.

  • Contrastive critique. With two or more valid heuristics, the teacher contrasts the best and worst, reporting the design choices that reduced the gap and an instance-grounded summary of the training instances each wins.

  • Repair critique. With one valid heuristic, the teacher pairs it with a failed one and combines what worked with what to repair.

  • Diagnostic critique. With no valid heuristic, the teacher inspects two distinct failure modes and proposes a runnable direction.

Experiential Preference Optimization

An iteration produces a pooled batch Y1∪Y2Y_1 \cup Y_2 of valid and invalid responses. Each valid response receives the reward r(y)=−γˉ(hy)r(y)=-\bar{\gamma}(h_y), the negative average gap of its heuristic. Invalid responses require no reward, only a failure-type label that selects the repair and diagnostic critiques of § 3.6. Two families of preference pairs are appended to a growing buffer B\mathcal{B} by BUILDPairs in Algorithm 6, all conditioned on the unhinted prompt qq:

  • Within-batch pairs. Following Šurina et al. (2025), the valid responses are split by reward into halves and randomly matched across them, each used at most once. Each invalid response is paired as dispreferred against a random valid response, teaching the policy to avoid unparseable or crashing code.

  • Cross-round pairs. Each valid Round-2 hinted response y+∼πθ(⋅∣q~)y^+ \sim\pi_\theta(\cdot\mid\tilde{q}) is preferred over a strictly worse valid Round-1 unhinted response y−∈Y1y^- \in Y_1 with r(y−)<r(y+)r(y^-)<r(y^+). These pairs encode the lift from reflection and form the reflective subset Bref\mathcal{B}_{\mathrm{ref}}.

The insight zz biases Round 2 toward better heuristics but is only a sampling aid; every pair conditions on the unhinted qq, so the policy is trained on the prompt distribution it generates from, and the optimality gap certifies every pair’s ordering.

Every Tdpo=20T_{\mathrm{dpo}}=20 iterations we run a preference-optimization burst, the DPOBURST step of Algorithm 1, over the accumulated buffer. A threshold filter drops pairs whose preferred reward falls below the 30th percentile of the valid-output rewards observed since the previous burst (Šurina et al. (2025)), and the buffer accumulates across all iterations, which preserves diversity. The reference πref\pi_{\mathrm{ref}} is the current model with its low-rank adaptation (LoRA) disabled (Hu et al. [13]).

Reflective Self-Distillation. Optimizing the buffer with Eq. (2) teaches the policy to rank a reflective winner y+y^+ above the worse unhinted candidate y−y^-, but ranking is not generation. The loss enters a pair only through the margin r^θ(y+)−r^θ(y−)\hat{r}_\theta(y^+)-\hat{r}_\theta(y^-) and need not raise log⁡πθ(y+∣q)\log\pi_\theta(y^+ \mid q); it is met largely by lowering r^θ(y−)\hat{r}_\theta(y^-), and the reflective pairs are also a minority of the buffer with small margins, since both responses are valid heuristics. The unhinted policy thus learns to prefer the reflective winner without becoming more likely to generate it, although every Round-1 rollout is drawn from that policy.

To close this gap we distill the hinted policy into the unhinted one. Following Zhao and Li (2025), their discrepancy is the forward KL divergence

LRSD(πθ)=Eq,zKL⁡(πθ(⋅∣q~)∥πθ(⋅∣q)),(13)\mathcal{L}_{\mathrm{RSD}}(\pi_\theta) = \mathbb{E}_{q,z}\operatorname{KL}\left(\pi_\theta(\cdot\mid\tilde{q}) \mathbin\Vert\pi_\theta(\cdot\mid q)\right), \tag*{(13)}

which we estimate, as a reward-filtered surrogate, from the Round-2 winner y+y^+, since y+y^+ is a draw from πθ(⋅∣q~)\pi_\theta(\cdot\mid\tilde{q}) and freezing that hinted distribution reduces the gradient of Eq. (13) to that of the negative log-likelihood −log⁡πθ(y+∣q)-\log\pi_\theta(y^+ \mid q). This RSD term, applied to Bref\mathcal{B}_{\mathrm{ref}} alone, gives the burst objective

L(πθ)=LDPO(πθ)+λE(q,y+)∼Bref[−log⁡πθ(y+∣q)],(14)\mathcal{L}(\pi_\theta) = \mathcal{L}_{\mathrm{DPO}}(\pi_\theta) + \lambda\mathbb{E}_{(q,y^+) \sim\mathcal{B}_{\mathrm{ref}}}\left[-\log\pi_\theta(y^+ \mid q)\right], \tag*{(14)}

with λ=0.1\lambda=0.1 in all main runs and Appendix Appendix § 9 giving the derivation. Where DPO is relative, RSD is absolute, directly raising the probability that the unhinted policy generates the reflective winner. Restricting the term to Bref\mathcal{B}_{\mathrm{ref}}, whose pairs contain by construction a valid and better hint-guided heuristic, distills genuine reflective gains. Because the Round-1 rollouts are drawn from πθ(⋅∣q)\pi_\theta(\cdot\mid q), the internalized improvement makes them better on their own, and the gain accumulates over the search.

Experiments

We evaluate EPOCH on three COPs, the TSP, OBP, and Knapsack Problem (KP), solved within a step-by-step construction framework. We assess the single best heuristic, the expert-heuristic ensemble, and generalization from the in-domain (ID) training size to out-of-distribution (OOD) sizes. Problem definitions, datasets, and evaluation protocol are in Appendix § 7, and the KP results in Appendix § 10.§ 1.

Benchmarks and metrics. We report mean optimality gaps in percent, where lower is better. For TSP this is the gap of the tour length to the LKH-3 (Helsgaun, [12]) optimum averaged over 300 test instances per size, and for OBP the gap of the bin count to the L1L_1 lower bound averaged over the Weibull test instances. Each method saves a set of heuristics, scored at two granularities. Top-1 evaluates the saved heuristic with the best training fitness, while top-K evaluates the saved set as a portfolio, taking on each test instance the lowest cost among the KK heuristics. We use K∈{1,3,10}K \in\{1, 3, 10\} for TSP and K∈{1,4}K \in\{1, 4\} for OBP. EPOCH’s saved set is the expert-heuristic ensemble from its archive A\mathcal{A}, ranked by expert count; Appendix § 7 states how each baseline ranks its saved set.

Backbones and settings. We run EPOCH with two open-source backbones, Qwen2.5-7B and Llama-3.1-8B, fine-tuned online during the search, with GPT-5-nano as the teacher (Appendix § 12.§ 2 shows the gains persist with other teachers, including its own backbone). Every method uses a budget of 1,000 heuristic generations, which for EPOCH corresponds to 125 iterations. Full hyperparameters are in Appendix § 13.

Baselines. We compare against five LLM-based AHD methods, CALM (Huang et al., [14]), which fine-tunes the generator, and the inference-only ReEvo (Ye et al., 2024), HSEvo (Dat et al., [6]), MCTS-AHD (Zheng et al., 2025), and EoH-S (Liu et al., [19]). The inference-only methods are also run with GPT-4o-mini and, in Appendix § 10.§ 1, with GPT-5-nano; CALM and EPOCH require open backbones. For a fair comparison, where an open-backbone baseline makes auxiliary LLM calls that do not generate heuristics, such as reflection, they are served by GPT-5-nano, the teacher model of EPOCH (Appendix § 13). We further include the classical heuristics nearest-neighbor (Rosenkrantz et al., 1977) for TSP, and First-Fit and Best-Fit (Johnson et al., [15]) for OBP.

Main Results

TSP. As reported in Table 1 (Qwen2.5-7B in Table 5), EPOCH attains the best or a comparable top-1 gap in every size–backbone setting, improving on CALM by up to 8%. The advantage widens at the ensemble level, where the top-10 ensemble cuts the gap at the training size n=50n=50 by 38–40% relative to CALM and 19–45% relative to the strongest inference-only baseline, and the top-3 ensemble already outperforms the top-10 ensemble of almost every baseline. The gains persist OOD, with the top-10 ensemble about 20% below CALM at n=200n=200. Despite far smaller open backbones, EPOCH outperforms the inference-only baselines run with GPT-4o-mini at every metric and test size, and nearest-neighbor by a wide margin.

MethodTSP-20TSP-50TSP-100TSP-200
Classical heuristics
Nearest Neighbor17.6421.9624.5826.10
LLM-based AHD: GPT-4o-mini (closed-source)
ReEvoTop-110.55 ± 3.5813.89 ± 4.4815.43 ± 4.7716.64 ± 5.00
Top-39.18 ± 2.5512.12 ± 2.6613.66 ± 3.2917.01 ± 4.28
Top-108.49 ± 2.5210.92 ± 2.2912.48 ± 2.7014.29 ± 2.98
HSEvoTop-112.58 ± 4.1816.37 ± 4.6218.56 ± 4.9420.86 ± 5.30
Top-311.38 ± 5.1615.12 ± 5.6417.39 ± 5.9120.14 ± 5.98
Top-1010.59 ± 5.8114.28 ± 6.3216.66 ± 6.5019.65 ± 6.48
MCTS-AHDTop-17.28 ± 0.7110.77 ± 0.7112.82 ± 0.6714.75 ± 1.03
Top-36.25 ± 1.079.50 ± 1.0811.77 ± 1.1414.00 ± 1.18
Top-104.54 ± 1.207.94 ± 1.1710.49 ± 1.2512.85 ± 1.41
EoH-STop-18.56 ± 0.9111.69 ± 0.7113.80 ± 0.9115.05 ± 0.98
Top-35.05 ± 0.439.14 ± 0.6111.80 ± 0.8313.75 ± 0.85
Top-103.22 ± 0.417.30 ± 0.3810.06 ± 0.3812.39 ± 0.42
LLM-based AHD: Llama-3.1-8B
ReEvoTop-110.58 ± 0.5814.87 ± 1.3618.38 ± 2.1026.06 ± 12.93
Top-310.28 ± 0.5914.15 ± 2.1516.19 ± 1.6519.05 ± 1.37
Top-1010.25 ± 0.6214.10 ± 2.2415.96 ± 2.0118.69 ± 1.54
HSEvoTop-111.46 ± 1.6915.85 ± 2.6318.48 ± 4.5121.34 ± 7.00
Top-310.61 ± 1.2814.83 ± 1.7617.27 ± 2.8219.47 ± 3.89
Top-1010.29 ± 1.5414.45 ± 2.1016.80 ± 3.2418.99 ± 4.31
MCTS-AHDTop-110.27 ± 0.3714.23 ± 0.6516.39 ± 1.4817.87 ± 1.45
Top-39.76 ± 0.4013.40 ± 0.3915.40 ± 0.8116.92 ± 1.04
Top-107.58 ± 0.6311.73 ± 0.6113.77 ± 0.9115.51 ± 1.15
EoH-STop-110.69 ± 0.9315.43 ± 1.5817.86 ± 1.3820.04 ± 1.46
Top-36.05 ± 0.7211.68 ± 1.0614.59 ± 0.9317.31 ± 1.05
Top-104.70 ± 0.8110.46 ± 1.0213.60 ± 0.9616.45 ± 1.07
CALMTop-16.76 ± 0.2610.02 ± 0.2611.75 ± 0.2713.47 ± 0.31
Top-36.55 ± 0.239.68 ± 0.5511.34 ± 0.5113.33 ± 0.47
Top-106.19 ± 0.549.31 ± 0.8011.04 ± 0.6713.30 ± 0.91
EPOCH (Ours)Top-16.19 ± 0.309.61 ± 0.2511.63 ± 0.2113.57 ± 0.36
Top-34.31 ± 0.307.62 ± 0.239.85 ± 0.3611.98 ± 0.49
Top-102.81 ± 0.225.73 ± 0.158.15 ± 0.1910.74 ± 0.38

Table 1. TSP optimality gap (%) to LKH-3 optima; each cell is the mean over runs with standard deviation, lower is better. Size n=50n=50 is ID (underlined); n∈{20,100,200}n \in\{20, 100, 200\} are OOD. Within each backbone block the best method per metric and test set is shaded; each test set’s overall best result is shown in bold.

OBP. Across the six test sets of Table 2 (Qwen2.5-7B in Table 6), EPOCH attains the lowest average gap of the open-backbone methods at both top-1 and top-4, with a top-4 average 44–55% below CALM, over 40% below the strongest open-backbone inference-only baseline, and 13–30% below the strongest GPT-4o-mini baseline.

Method1k_1001k_5005k_1005k_50010k_10010k_500Avg.
Classical heuristics
First-Fit5.020.254.650.554.360.502.55
Best-Fit4.770.254.310.554.050.472.40
LLM-based AHD: GPT-4o-mini (closed-source)
ReEvo Top-13.74±0.943.74 \pm0.940.40±0.300.40 \pm0.303.09±1.123.09 \pm1.120.69±0.300.69 \pm0.302.84±1.112.84 \pm1.110.53±0.120.53 \pm0.121.88±0.461.88 \pm0.46
Top-43.61±1.013.61 \pm1.010.40±0.300.40 \pm0.302.98±1.212.98 \pm1.210.56±0.130.56 \pm0.132.74±1.222.74 \pm1.220.44±0.030.44 \pm0.031.79±0.531.79 \pm0.53
HSEvo Top-12.85±1.012.85 \pm1.010.40±0.300.40 \pm0.302.19±1.152.19 \pm1.150.56±0.020.56 \pm0.022.01±1.152.01 \pm1.150.50±0.040.50 \pm0.041.42±0.521.42 \pm0.52
Top-42.82±1.012.82 \pm1.010.20±0.100.20 \pm0.102.17±1.172.17 \pm1.170.47±0.120.47 \pm0.122.01±1.152.01 \pm1.150.42±0.100.42 \pm0.101.35±0.561.35 \pm0.56
MCTS-AHD Top-12.59±0.452.59 \pm0.450.15±0.120.15 \pm0.121.88±0.471.88 \pm0.470.42±0.170.42 \pm0.171.71±0.411.71 \pm0.410.38±0.120.38 \pm0.121.19±0.271.19 \pm0.27
Top-42.48±0.512.48 \pm0.510.10±0.120.10 \pm0.121.79±0.531.79 \pm0.530.36±0.170.36 \pm0.171.61±0.481.61 \pm0.480.33±0.130.33 \pm0.131.11±0.311.11 \pm0.31
EoH-S Top-12.62±0.332.62 \pm0.330.25±0.160.25 \pm0.161.74±0.731.74 \pm0.730.42±0.150.42 \pm0.151.46±0.831.46 \pm0.830.35±0.130.35 \pm0.131.14±0.331.14 \pm0.33
Top-42.40±0.382.40 \pm0.380.15±0.120.15 \pm0.121.41±0.561.41 \pm0.560.24±0.160.24 \pm0.161.08±0.581.08 \pm0.580.18±0.150.18 \pm0.150.91±0.300.91 \pm0.30
LLM-based AHD: Llama-3.1-8B
ReEvo Top-14.34±0.704.34 \pm0.700.25±0.000.25 \pm0.003.27±1.253.27 \pm1.250.41±0.170.41 \pm0.173.04±1.363.04 \pm1.360.36±0.160.36 \pm0.161.95±0.601.95 \pm0.60
Top-44.10±0.874.10 \pm0.870.20±0.100.20 \pm0.103.23±1.243.23 \pm1.240.41±0.170.41 \pm0.172.98±1.342.98 \pm1.340.35±0.160.35 \pm0.161.88±0.641.88 \pm0.64
HSEvo Top-13.39±0.933.39 \pm0.930.25±0.000.25 \pm0.002.42±1.262.42 \pm1.260.42±0.180.42 \pm0.182.11±1.332.11 \pm1.330.36±0.150.36 \pm0.151.49±0.581.49 \pm0.58
Top-43.36±0.973.36 \pm0.970.25±0.000.25 \pm0.002.42±1.262.42 \pm1.260.40±0.160.40 \pm0.162.10±1.332.10 \pm1.330.36±0.150.36 \pm0.151.48±0.591.48 \pm0.59
MCTS-AHD Top-14.14±0.894.14 \pm0.890.17±0.120.17 \pm0.123.54±1.093.54 \pm1.090.46±0.120.46 \pm0.123.30±1.073.30 \pm1.070.40±0.110.40 \pm0.112.00±0.572.00 \pm0.57
Top-44.11±0.944.11 \pm0.940.17±0.120.17 \pm0.123.54±1.093.54 \pm1.090.46±0.120.46 \pm0.123.30±1.073.30 \pm1.070.40±0.110.40 \pm0.111.99±0.571.99 \pm0.57
EoH-S Top-13.92±0.783.92 \pm0.780.21±0.090.21 \pm0.092.89±0.872.89 \pm0.870.51±0.070.51 \pm0.072.59±1.002.59 \pm1.000.45±0.050.45 \pm0.051.76±0.381.76 \pm0.38
Top-43.56±0.733.56 \pm0.730.08±0.120.08 \pm0.121.46±0.571.46 \pm0.570.16±0.090.16 \pm0.091.14±0.691.14 \pm0.690.14±0.100.14 \pm0.101.09±0.271.09 \pm0.27
CALM Top-13.71±0.523.71 \pm0.520.59±0.820.59 \pm0.821.32±0.401.32 \pm0.400.30±0.140.30 \pm0.140.82±0.410.82 \pm0.410.27±0.140.27 \pm0.141.17±0.221.17 \pm0.22
Top-43.69±0.513.69 \pm0.510.59±0.820.59 \pm0.821.29±0.431.29 \pm0.430.29±0.150.29 \pm0.150.80±0.430.80 \pm0.430.26±0.130.26 \pm0.131.15±0.231.15 \pm0.23
EPOCH (Ours) Top-12.99±0.702.99 \pm0.700.30±0.360.30 \pm0.361.66±0.901.66 \pm0.900.32±0.210.32 \pm0.211.33±0.971.33 \pm0.970.28±0.240.28 \pm0.241.15±0.391.15 \pm0.39
Top-42.34±0.432.34 \pm0.430.10±0.120.10 \pm0.120.74±0.060.74 \pm0.060.20±0.070.20 \pm0.070.36±0.060.36 \pm0.060.13±0.040.13 \pm0.040.64±0.070.64 \pm0.07

Table 2. OBP optimality gap (%) to the L1L_1 lower bound on the six held-out Weibull test sets; each cell is the mean over runs with standard deviation, lower is better. Columns are (items, capacity), e.g. 1k_100 is 1,000 items at capacity 100; Avg. is the mean over the six. Item scales 1k, 5k are ID (underlined); 10k is OOD. Within each backbone block the best Avg. per metric is shaded; each test set’s overall best result is shown in bold.

Single-best versus ensemble. TSP, OBP, and KP show the same pattern, the best or a comparable top-1 heuristic and far larger gains at the ensemble level. Because parent selection, operator allocation, stagnation recovery, and the deployed ensemble all optimize instance coverage rather than average fitness, the search yields a heuristic set whose per-instance best cost falls far below that of any single heuristic. Full results with Qwen2.5-7B and all classical heuristics, seed-robustness studies, evolutionary curves, and TSPLIB results appear in Appendix § 10, and significance tests in Appendix § 11.

Ablation Study

We ablate EPOCH one component at a time, on TSP and OBP with Llama-3.1-8B over five runs, scored on 100 instances per test set. We report in Table 3 the ensemble gap, top-10 for TSP and top-4 for OBP, averaged over the test sets. Appendix § 12 details each row’s removal and replacement, along with the hyperparameter ablation.

TSPOBP
EPOCH (full)6.79 ±0.190.64 ±0.07
Reflective learning
w/o RSD7.17 ±0.270.79 ±0.06
w/o cross-round pairs6.92 ±0.160.75 ±0.10
w/o instance-grounded insight6.90 ±0.210.68 ±0.07
w/o teacher reflection6.99 ±0.140.83 ±0.16
w/o preference optimization7.01 ±0.130.81 ±0.15
Coverage-aware search
w/o expert-aware selection6.93 ±0.150.81 ±0.09
w/o adaptive operator allocation7.15 ±0.390.76 ±0.12
coverage-blind bandit7.07 ±0.160.77 ±0.06
w/o coverage-stagnation signal7.13 ±0.290.69 ±0.08
w/o expert-preserving recovery6.99 ±0.170.76 ±0.06
Gap-vector representation
scalar fitness (no gap vector)8.77 ±0.630.86 ±0.18

Table 3. Component ablations on the Llama-3.1-8B backbone, reported as the ensemble optimality gap (%), lower is better. The full method is in bold.

Gap-vector representation. Replacing the per-instance gap vector with its scalar average everywhere causes the largest degradation, widening the ensemble gap by 29% on TSP and 34% on OBP. Scoring heuristics by one number removes the per-instance structure that parent selection, the operator reward, recovery, and the deployed ensemble use.

Coverage-aware search. Every coverage mechanism contributes. Removing expert-aware parent selection, the operator bandit, or the coverage term of its reward widens the ensemble gap by 2–5% on TSP and 19–27% on OBP, with the uniform

operator draw the largest on TSP. Replacing the coverage-stagnation signal with a fixed-period reset and the expert-preserving recovery with a single-best rebuild degrade the ensemble gap by up to 5% on TSP and 19% on OBP, confirming that preserving expert heuristics through recovery is essential.

Reflective learning. The reflective and preference components contribute most on OBP, whose four training instances make lost expert heuristics harder to recover. Removing RSD, the instance-grounded insight, teacher reflection, or preference optimization widens the OBP gap by 6–30% and the TSP gap by 2–6%. The reflective cross-round pairs are a minority of the buffer, 29% for Llama and 17% for Qwen (Figure 2a), and on those pairs the DPO loss is met almost entirely by lowering the rejected response’s implicit reward rather than raising the winner’s (Figure 2b), so the update ranks the winner above the worse candidate without making the policy more likely to generate it. The RSD term supplies the missing absolute signal, as a larger weight λ\lambda raises the unhinted policy’s per-token log-likelihood of the reflective winners (Figure 2c), and this log-likelihood rises across training for λ>0\lambda>0 and stays flat at λ=0\lambda=0 (Figure 3). The unhinted policy thus internalizes the hint-guided improvement and generates stronger Round-1 heuristics, the gain Table 3 attributes to RSD.

Figure 2. Motivation for RSD, on TSP with Llama-3.1-8B (top) and Qwen2.5-7B (bottom): (a) reflective cross-round pairs are a minority of the preference buffer; (b) plain DPO at λ=0\lambda=0 satisfies the reflective pairs’ margin by lowering the implicit reward of the rejected response, not raising the winner’s; (c) increasing the RSD weight λ\lambda raises the unhinted policy’s per-token log-likelihood of the reflective winners.

Figure 3. Internalization over training, on TSP with Llama-3.1-8B (left) and Qwen2.5-7B (right). The unhinted policy’s per-token log-likelihood of the reflective winners rises across DPO bursts for λ>0\lambda>0 and stays flat at λ=0\lambda=0.

Conclusion

We propose EPOCH, an LLM-based AHD framework that fine-tunes the generator during the search and represents every heuristic by its per-instance optimality-gap vector rather than a scalar fitness. This representation makes the entire search loop coverage-aware, driving expert-aware parent selection, an adaptive operator bandit, and coveragebased stagnation recovery. Teacher-guided reflection becomes a training signal, and RSD internalizes these improvements into the generator. Across COPs and LLM backbones, EPOCH’s complementary expert-heuristic ensembles outperform AHD methods and generalize across problem scales.

Limitations

EPOCH fine-tunes only the generator. The teacher LLM that returns the natural-language insight stays fixed throughout the search, so reflection guides the training of the generator without being trained itself. Fine-tuning the reflection jointly with the generator, toward an end-to-end fine-tuned system, is left for future work. EPOCH is evaluated within the step-by-step construction framework; Appendix § 7 explains this choice, and solver-driven frameworks such as ant colony optimization and guided local search remain to be explored.

Extended Related Work

Heuristic design and hyper-heuristics. Exact algorithms for NP-hard COPs rarely scale to practical instance sizes, so routing, scheduling, and design problems are commonly solved with heuristics ([7] (Tam et al. 2024)) and with metaheuristics such as simulated annealing and tabu search ([16, 9]). Such solvers encode expert knowledge, and adapting one to a new problem variant largely restarts the design effort ([4] (Pillay and Qu 2018)). Hyper-heuristics and AHD instead automate the design itself, selecting or constructing heuristics for a problem class ([2]). Genetic programming is the classical realization, evolving heuristic programs built from a human-defined function set ([17, 8]), and free-form LLM code generation widens the search space beyond what that function set expresses.

LLMs in evolutionary search. A line of work runs a standard evolutionary algorithm but lets an LLM generate the offspring, prompting it with the selected parents to produce new code or text, while fitness evaluation and survivor selection stay outside the model ([18, 3] (Meyerson et al. 2024)). LLM-based AHD builds on this setup, and EPOCH keeps the same outer loop but additionally trains the operator rather than treating it as fixed.

LLM-based AHD frameworks. FunSearch (Romera-Paredes et al., 2023) pioneered evolutionary program search with an LLM proposer, EoH ([20]) co-evolves thoughts and code, ReEvo (Ye et al., 2024) adds reflection (Shinn et al., 2023; Pryzant et al., 2023), HSEvo ([6]) couples diversity metrics with harmony search, and MCTS-AHD (Zheng et al., 2025) organizes heuristics in a Monte Carlo tree. Analyses of the AHD fitness landscape and code-evolution dynamics further motivate diversity (Liu et al., 2025; van Stein et al., 2025), and planning-based approaches organize the search over a tree (Wang et al., 2025) or an entailment graph that carries derivation history ([11]). Most relevant to our coverage view, EoH-S ([19]) evolves a set of complementary heuristics, using per-instance performance vectors to select survivors that specialize on different parts of the instance distribution. All of these methods keep the LLM frozen, whereas EPOCH trains the generator and uses the per-instance best gaps as an online control signal throughout the run.

Training the LLM generator for AHD. CALM ([14]) co-evolves the heuristic pool and the LLM, fine-tuning with GRPO (Shao et al., 2024) on a progressive scalar reward and using a stagnation-driven collapse that resets the pool to the seed and current best. EvoTune (Surina et al., 2025) interleaves FunSearch-style search with periodic DPO over a program database treated as a replay buffer, using a forward-KL variant that preserves output diversity and a dynamic reward-percentile filter. EPOCH likewise fine-tunes the generator, but governs selection, operator allocation, and recovery by per-instance gap vectors rather than scalar fitness, converts teacher-guided reflection into preference pairs and distills the hint-guided improvement into the unhinted policy with an RSD term, and deploys a complementary ensemble of expert heuristics.

Reflection and natural-language feedback. Reflection (Shinn et al., 2023) and Self-Refine (Madaan et al., 2023) improve LLM outputs through in-context natural-language feedback, ExpeL (Zhao et al., 2024) reuses accumulated experience across tasks, and prompt-optimization methods treat textual critiques as gradients (Pryzant et al., 2023); all act at inference time without updating weights. A recent thread instead folds text feedback into training. Text feedback can be distilled into first-attempt behavior so the model needs no feedback at test time (Song et al., 2026), and an experience–reflection–consolidation loop can internalize corrective revisions into the policy (Shi et al., 2026), though both target domains other than heuristic design. EPOCH brings this idea to AHD, where the executable, verifiable reward orders reflection-conditioned generations without a learned judge, and its RSD term internalizes the hint-guided improvement into the policy’s unhinted behavior so it carries into later generations of the search.

Preference optimization and learning from feedback. Aligning LLMs from preferences was popularized by reinforcement learning from human feedback (RLHF) (Ouyang et al., 2022); DPO (Rafailov et al., 2023) removes the learned reward model by optimizing preferences directly, and Reflective Preference Optimization (Zhao and Li, 2025) constructs the pairs by conditioning regeneration on a critic’s hint and contrasting hinted with unhinted responses, keeping the update on-policy. EPOCH adopts DPO for the generator together with this reflection-as-preference construction, but the preference ordering is certified by the optimality gap on executed code rather than by a learned or model-based judge, and the contrasted responses are a hinted second batch versus a strictly worse unhinted first batch from the same evolutionary iteration. That work also distills the hint-conditioned behavior back into the unconditioned policy to remove a test-time dependence on the hint. EPOCH’s RSD term shares this mechanism but is motivated within training, makes each iteration’s unhinted rollouts better and accumulates across generations, and is gated to the pairs whose verifiable reward certifies a genuine reflective gain.

Problem Definitions and Datasets

We instantiate EPOCH on three COPs, solved within a step-by-step construction framework; the function signatures match the conventions of prior LLM-based AHD work (Zheng et al., 2025; Ye et al., 2024).

Solution framework. We evaluate within the step-by-step construction framework because there the heuristic alone builds the solution, so the optimality gap measures the heuristic an AHD framework discovered. In solver-driven frameworks such as ant colony optimization and guided local search (Ye et al., 2024; Zheng et al., 2025), the heuristic only biases a solver that continues the search on its own, through pheromone updates or local search, so the solver narrows the differences between heuristics and the gap reflects the solver as much as the discovery method. Each candidate evaluation also runs the solver on every training instance, which makes it far costlier than a construction run and the 1,000-generation search of every method correspondingly slower. Extending EPOCH to these frameworks is left for future work.

Traveling Salesman Problem (TSP). A TSP instance is a complete graph on nn nodes with coordinates sampled uniformly from [0,1]2[0,1]^2 and Euclidean edge costs; a solution is a Hamiltonian tour scored by its total length. Within the step-by-step construction framework, the LLM designs the key function below, which chooses the next city from the current one given the unvisited set and the distance matrix, and the framework calls it repeatedly until the tour is complete.

TSP key function

select_next_node(current_node, destination_node,
                 unvisited_nodes, distance_matrix)
    -> next_node

Per-instance gaps in Eq. (3) are computed against LKH-3 [12] optimal tour lengths. Training uses m=64m=64 instances at n=50n=50; held-out evaluation uses a range of sizes (n∈{20,50,100,200}n \in\{20,50,100,200\}) to test OOD generalization.

Online Bin Packing (OBP). In OBP, items arrive sequentially with sizes drawn from a Weibull distribution and must be placed immediately into a bin that can hold them, minimizing the number of bins used. The LLM designs the priority function below, which scores each feasible bin for the arriving item, and the item is placed in the highest-priority bin.

OBP key function

step(item_size, remaining_capacity) -> priority

Per-instance gaps are computed against the L1L_1 lower bound ⌈(∑isi)/C⌉\lceil(\sum_i s_i)/C\rceil on the number of bins [20]. Because the training set comprises few instances, the inference-time ensemble is reported up to the available number of experts.

0-1 Knapsack Problem (KP). Following the KP setting of MCTS-AHD and ReEvo (Zheng et al., 2025; Ye et al., 2024), an instance has nn items with weights and values sampled uniformly from [0,1][0,1] and a knapsack of capacity 25 (12.5 at n=50n=50); a solution is a subset of items whose total weight fits the capacity, scored by its total value. Within the step-by-step construction framework, the LLM designs the key function below, which chooses the next item to pack given the remaining capacity and the weights and values of the items not yet packed, and the framework calls it repeatedly until no remaining item fits.

KP key function

Figure KP key function.

Per-instance gaps are computed against the optimal value from dynamic programming, with the negated value as the cost in Eq. (3). Training uses m=64m=64 instances at n=100n=100; held-out evaluation uses n∈{50,100,200}n \in\{50, 100, 200\}.

Datasets and evaluation protocol. As summarized in Table 4, for TSP we train on 64 instances at n=50n=50 and evaluate on held-out sets of 300 instances at each of n∈{20,50,100,200}n \in\{20, 50, 100, 200\}, where n=50n=50 is ID and the other sizes are OOD. For OBP we train on four Weibull instances spanning {1k,5k}\{1\mathrm{k}, 5\mathrm{k}\} items at capacity 100, and evaluate on the six held-out Weibull sets {1k,5k,10k}×{100,500}\{1\mathrm{k}, 5\mathrm{k}, 10\mathrm{k}\} \times\{100, 500\} of five instances each; the 10k-item sets are OOD in scale. For KP we train on 64 instances at n=100n=100 and evaluate on held-out sets of 1,000 instances at each of n∈{50,100,200}n \in\{50, 100, 200\}, where n=100n=100 is ID, with K∈{1,3,10}K \in\{1, 3, 10\} as for TSP. Following standard practice, both training and test instances are sampled under fixed settings used by prior LLM-based AHD work (Ye et al., 2024; Liu et al., [20]; Zheng et al., 2025), and every method sees only the training set during search and is scored on the held-out sets afterward. We report the mean over five independent runs. During search, each heuristic evaluates the full training set under a 60 s wall-clock budget and is treated as a runtime failure if it exceeds it. At test time, TSP heuristics run under a per-instance wall-clock budget of 15 s at n=50n=50, 30 s at n=100n=100, and 60 s at n=200n=200, KP heuristics under 10 s at every size, and a heuristic exceeding its budget is recorded as failing those instances.

ProblemTrain ScaleTrain #Inst.Test ScaleTest #Inst.
TSPn=50n=5064n∈{20,50,100,200}n \in\{20, 50, 100, 200\}300
OBP{1k,5k}\{1\mathrm{k}, 5\mathrm{k}\}, C=100C=1004{1k,5k,10k}×{100,500}\{1\mathrm{k}, 5\mathrm{k}, 10\mathrm{k}\} \times\{100, 500\}5
KPn=100n=10064n∈{50,100,200}n \in\{50, 100, 200\}1,000

Table 4. Training and test datasets. ID scales are underlined; the rest are OOD. #Inst. is per size (TSP, KP) or per (items, capacity) set (OBP). TSP gaps are to LKH-3 optima, OBP gaps to the L1L_1 lower bound, and KP gaps to the optimum.

Top-KK snapshots of the methods. Every method ends a run with a saved set of heuristics carrying its own ranking. Top-1 evaluates the member of that set with the best training fitness, identically for every method, and top-KK routes each test instance to the lowest cost among KK of its members; for OBP, K=4K=4 matches the four training instances. For EPOCH and EoH-S, whose saved sets are ranked for coverage, the ensemble takes the first KK of that ranking, and for every other method it takes the KK with the best training fitness. At KK equal to the full set size the two rules coincide. Top-KK thus scores the set each method itself returns, with no re-selection at test time; it is the deployment a set-based AHD method targets, and top-1 gives the single-heuristic view alongside. Since EoH-S is scored by the same procedure on its own coverage-ranked set, the top-KK margin of EPOCH over it in Tables 5 and 6 reflects the search rather than the selection of the deployed set. EPOCH deploys its expert-heuristic ensemble ranked by expert count, Eq. (5), with the training-fitness-best heuristic always included. EoH-S saves its final complementary set in its own order, the best individual first, followed by the members added for coverage. CALM saves its all-time-best buffer ranked by training fitness. For HSEvo and ReEvo we take the ten best heuristics evaluated during each run, ranked by training fitness, so that strong candidates displaced by generational replacement are retained. MCTS-AHD saves the ten tree nodes with the highest back-propagated QQ value, the quantity its tree search ranks nodes by. On OBP every method, including HSEvo, is trained on the same four-instance Weibull set, and we omit the Worst-Fit rule as it orders of magnitude from competitive. Among methods that fine-tune the generator, we omit EvoTune (Šurina et al., 2025): CALM outperforms it under matched comparisons that include a DPO-trained CALM variant against the DPO-based EvoTune (Huang et al., [14]), and within our framework the scalar-fitness and reflective-learning ablations of Appendix § 12 isolate, under a matched budget, the gains of the coverage-aware search and of the reflective preference construction over preference optimization on scalar fitness alone. The classical heuristics are deterministic single programs, so their top-1 and top-KK scores coincide.

Algorithm 2 SELECTPARENTS: expert-aware parent selection
Input: pool $\mathcal{P}$, population size $N_p$, operator $o$, probabilities $p_{\mathrm{exp}},p_{\mathrm{comp}}$, temperature $\tau$
Output: parent set $S$
1: $P_{N_p} \leftarrow \operatorname{Top}_{N_p}(\mathcal{P};\bar{\gamma}(\cdot)\uparrow)$ ▷ reproduction population
2: \textbackslash\textbackslash Single-parent mutation operators
3: if $o$ is a single-parent mutation operator then
4:   if $\operatorname{rand}() < p_{\mathrm{exp}}$ and some $h$ has $e(h;P_{N_p}) > 0$ then
5:     sample $h_1 \in P_{N_p}$ with prob. $\propto 1/\operatorname{rank}$, descending $e(\cdot;P_{N_p})$ ▷ target under-covered instances
6:   else
7:     sample $h_1 \in P_{N_p}$ with prob. $\propto 1/\operatorname{rank}$, ascending $\bar{\gamma}(\cdot)$ ▷ refine strong
8:   end if
9:   return $\{h_1\}$
10: end if
11: \textbackslash\textbackslash Crossover
12: sample $h_1 \in P_{N_p}$ with prob. $\propto 1/\operatorname{rank}$, ascending $\bar{\gamma}(\cdot)$ ▷ parent 1
13: if $\operatorname{rand}() < p_{\mathrm{comp}}$ then
14:   sample $h_2 \sim \operatorname{softmax}(d(h_1,\cdot)/\tau)$ over $P_{N_p}\setminus\{h_1\}$ ▷ complementary variant
15: else
16:   sample $h_2 \in P_{N_p}$ with prob. $\propto 1/\operatorname{rank}$, ascending $\bar{\gamma}(\cdot)$, $h_2 \ne h_1$ ▷ exploitative variant
17: end if
18: return $\{h_1,h_2\}$
Algorithm 3 DRAWOPERATOR: bandit operator draw
Input: pool $\mathcal{P}$, quality $\{Q_o\}$, priors $\{w_o^o\}$, steepness $\kappa$, floor $\phi$
Output: sampled operator $o$
1: $\mathcal{O}' \leftarrow \mathcal{O}$
2: if $|\mathcal{P}| < 2$ then
3:   remove crossover from $\mathcal{O}'$ ▷ needs two parents
4: end if
5: $\bar{Q} \leftarrow \operatorname{mean}_{o\in\mathcal{O}'} Q_o$
6: $\omega_o \leftarrow w_o^o\operatorname{clip}(e^{\kappa(Q_o-\bar{Q})},\frac{1}{2},2)$ for $o\in\mathcal{O}'$ ▷ $\omega_o\in[\frac{1}{2}w_o^o,2w_o^o]$
7: $p_o \leftarrow \phi+(1-|\mathcal{O}'|\phi)\omega_o/\sum_{o'\in\mathcal{O}'}\omega_{o'}$ ▷ probability floor
8: return $o\sim p$
Algorithm 4 UPDATEBANDIT: bandit quality update
Input: operator $o$, Round-1/Round-2 rollouts $Y_1,Y_2$, best-gap snapshot $F$, margin $\epsilon_\rho$, rate $\eta$, weights $w_e,w_p,w_v$
Output: updated quality $Q_o$
1: $V \leftarrow \{y\in Y_1\cup Y_2:y\text{ valid}\}$
2: $g_o \leftarrow \frac{1}{|V|}|\{i:\min_{y\in V}\gamma_i(h_y)<F_i-\epsilon_\rho\}|$ ▷ instances won vs. $F$
3: $\nu_p\leftarrow \frac{1}{|V|}|\{y\in V:\bar{\gamma}(h_y)<\bar{\gamma}_{\mathrm{par}}\}|$ ▷ $\bar{\gamma}_{\mathrm{par}}$: best parent's average gap
4: $\nu_v\leftarrow |V|/|Y_1\cup Y_2|$ ▷ valid fraction
5: $R_o\leftarrow \operatorname{clip}(w_eg_o+w_p\nu_p+w_v\nu_v,0,1)$
6: $Q_o\leftarrow (1-\eta)Q_o+\eta R_o$ ▷ EMA; $Q_o\leftarrow 0$ on recovery
7: return $Q_o$

Algorithm Pseudocodes

This section provides the complete pseudocode of the subalgorithms invoked by Algorithm 1. Algorithm 2 is the expert-aware parent selector that supplies operator parents from the reproduction population. Algorithms 3 and 4 are the operator bandit’s draw and update steps. Algorithm 5 is the expert-preserving recovery that restores diversity when the coverage gap stagnates, and Algorithm 6 is the preference-pair construction that turns one iteration’s generations into training pairs.

Parent selection. Algorithm 2 mixes exploitation with coverage over the reproduction population PNpP_{N_p}, the NpN_p heuristics of the pool with the lowest average gap. A single-parent mutation operator samples either by expert count, which recruits heuristics for under-covered instances, or by average gap, which refines strong all-rounders. The crossover operator samples its first parent by average gap and its second parent either by complementarity or by average gap, selecting the matching crossover variant of § 3.3.

Operator bandit. Algorithm 3 draws operators in proportion to a bounded weight that is centered on the mean quality across eligible operators, under the probability floor ϕ\phi. Algorithm 4 then revises the quality QoQ_o from the expert-coverage gain gog_o together with the parent-beating and validity fractions of the iteration’s children, and resets QoQ_o to 0 on recovery.

Expert-preserving recovery. Algorithm 5 tracks the coverage gap ρ(P)\rho(\mathcal{P}); after TρT_\rho iterations without an ϵρ\epsilon_\rho improvement, or TcapT_{\mathrm{cap}} iterations since the last recovery, it rebuilds a pool of Np/2N_p/2 heuristics from the best heuristic, the seed, and the highest-expert-count heuristics, resets the bandit’s quality estimates, and restarts the stagnation window by setting ρ⋆\rho^\star to the recovered pool’s coverage gap. The persistent expert archive of § 3.5 is updated each iteration outside this procedure and remains intact across recoveries.

Preference-pair construction. Algorithm 6 forms within-batch pairs by splitting valid responses at the reward median and matching across the halves, pairs each invalid response as dispreferred against a randomly chosen valid one, and adds cross-round pairs that prefer a hinted Round-2 response over a strictly worse unhinted Round-1 response. Every pair is conditioned on the unhinted prompt qq.

Algorithm 5 RECOVER: expert-preserving recovery
Input: pool P\mathcal{P}, best gap ρ⋆\rho^\star, age aa, patience TρT_\rho, iterations-since-recovery cc, cap TcapT_{\mathrm{cap}}, margin ϵρ\epsilon_\rho, population size NpN_p, seed heuristic hseedh_{\mathrm{seed}}
Output: updated pool
1: \\\mathbin{\backslash\backslash} Stagnation criterion
2: ρ←1m∑imin⁡h∈Pγi(h)\rho\leftarrow\frac{1}{m}\sum_i \min_{h\in\mathcal{P}}\gamma_i(h) ▷ coverage gap, Eq. (6)
3: c←c+1c \leftarrow c+1
4: if ρ<ρ⋆−ϵρ\rho< \rho^\star-\epsilon_\rho then
5: ρ⋆←ρ\rho^\star\leftarrow\rho; a←0a \leftarrow0 ▷ coverage gap improved
6: else
7: a←a+1a \leftarrow a+1
8: end if
9: if a<Tρa<T_\rho and c<Tcapc<T_{\mathrm{cap}} then
10: return P\mathcal{P} ▷ within patience and cap
11: end if
12: \\\mathbin{\backslash\backslash} Expert-preserving rebuild
13: Prec←{arg⁡min⁡h∈Pγˉ(h)}∪{hseed}\mathcal{P}_{\mathrm{rec}}\leftarrow\{\arg\min_{h\in\mathcal{P}}\bar{\gamma}(h)\}\cup\{h_{\mathrm{seed}}\} ▷ best-by-average-gap and seed
14: Prec←Prec∪Top⁡Np/2−∣Prec∣(P∖Prec;e(⋅;P)↓)\mathcal{P}_{\mathrm{rec}}\leftarrow\mathcal{P}_{\mathrm{rec}}\cup\operatorname{Top}_{N_p/2-|\mathcal{P}_{\mathrm{rec}}|}(\mathcal{P}\setminus\mathcal{P}_{\mathrm{rec}};e(\cdot;\mathcal{P})\downarrow) ▷ ties: lower γˉ\bar{\gamma}
15: reset bandit; ρ⋆←1m∑imin⁡h∈Precγi(h)\rho^\star\leftarrow\frac{1}{m}\sum_i\min_{h\in\mathcal{P}_{\mathrm{rec}}}\gamma_i(h); a←0a\leftarrow0; c←0c\leftarrow0
16: return Prec\mathcal{P}_{\mathrm{rec}}

Table 5.

Reflective Self-Distillation: Derivation and Margin Analysis

This appendix expands § 3.7. We make precise the sense in which preference optimization over the search buffer can rank the reflective winners without making the policy more likely to generate them, and then derive the RSD term as the sampled, stop-gradient form of a divergence between the hinted and unhinted policies. Throughout, qq is an unhinted operator prompt, q~=q⊕z\widetilde{q}=q\oplus z its insight-augmented counterpart (§ 3.6), and a reflective pair (q,y+,y−)∈Bref(q,y^+,y^-)\in\mathcal{B}_{\mathrm{ref}} has a hinted winner y+∼πθ(⋅∣q~)y^+\sim\pi_\theta(\cdot\mid\widetilde{q}) and a strictly worse unhinted candidate y−∼πθ(⋅∣q)y^-\sim\pi_\theta(\cdot\mid q).

Ranking is not generation. Recall the implicit reward r^θ(y)=βlog⁡πθ(y∣q)πref(y∣q)\hat{r}_\theta(y)=\beta\log\frac{\pi_\theta(y\mid q)}{\pi_{\mathrm{ref}}(y\mid q)}. The per-pair loss of Eq. (2) is a decreasing function of the margin

Δθ(q,y+,y−)=r^θ(y+)−r^θ(y−)=β[log⁡πθ(y+∣q)πref(y+∣q)−log⁡πθ(y−∣q)πref(y−∣q)](15)\Delta_\theta(q,y^+,y^-)=\hat{r}_\theta(y^+)-\hat{r}_\theta(y^-) =\beta\left[\log\frac{\pi_\theta(y^+\mid q)}{\pi_{\mathrm{ref}}(y^+\mid q)}-\log\frac{\pi_\theta(y^-\mid q)}{\pi_{\mathrm{ref}}(y^-\mid q)}\right] \tag*{(15)}

and enters the pair only through Δθ\Delta_\theta, so nothing in it rewards a high absolute value of log⁡πθ(y+∣q)\log\pi_\theta(y^+\mid q); a given increase of Δθ\Delta_\theta is credited equally whether it raises log⁡πθ(y+∣q)\log\pi_\theta(y^+\mid q) or lowers log⁡πθ(y−∣q)\log\pi_\theta(y^-\mid q). Because a log-probability is bounded above by 0 but unbounded below, the margin can be widened far more cheaply by driving log⁡πθ(y−∣q)\log\pi_\theta(y^-\mid q) down than by lifting the already-high log⁡πθ(y+∣q)\log\pi_\theta(y^+\mid q), and gradient descent does so preferentially, leaving log⁡πθ(y+∣q)\log\pi_\theta(y^+\mid q) near its reference value log⁡πref(y+∣q)\log\pi_{\mathrm{ref}}(y^+\mid q). Two consequences specialize this to our setting. First, the reflective pairs are a minority of the buffer and have a small margin by construction: y+y^+ and y−y^- are both valid heuristics that differ only by the hint’s refinement, so ∣Δθ∣|\Delta_\theta| is small relative to the within-batch and valid-versus-invalid pairs, whose rejected members are far weaker, and the reflective signal is easily dominated. Second, even when the reflective margin is realized it need not raise log⁡πθ(y+∣q)\log\pi_\theta(y^+\mid q), the quantity that governs how likely the unhinted policy is to generate y+y^+ in the next iteration. Ranking y+y^+ above y−y^- and generating y+y^+ from qq are thus distinct objectives, and Eq. (2) targets only the former.

The hinted–unhinted divergence. The objective LRSD\mathcal{L}_{\mathrm{RSD}} of Eq. (13) is the forward Kullback–Leibler divergence between the hinted policy πθ(⋅∣q~)\pi_\theta(\cdot\mid\widetilde{q}), which the insight zz biases toward better heuristics, and the unhinted policy πθ(⋅∣q)\pi_\theta(\cdot\mid q), the search rolls out from. It vanishes when the hint changes nothing and grows as the hint moves the policy, so minimizing it pulls the unhinted policy toward the hinted one and the reflective improvement carries into the policy’s own Round-1 rollouts.

From the divergence to a likelihood. The divergence averages over the open-ended space of heuristics and has no closed form, so we estimate

Algorithm 6 BUILDPairs: preference-pair construction
Input: unhinted prompt qq, Round-1 rollouts Y1Y_1, Round-2 rollouts Y2Y_2
Output: preference pairs Bq\mathcal{B}_q
1: V←V\leftarrow valid responses in Y1∪Y2Y_1\cup Y_2; I←I\leftarrow invalid responses; Bq←∅\mathcal{B}_q\leftarrow\varnothing
2: \\\mathbin{\backslash\backslash} Within-batch pairs
3: (V+,V−)←(V^+,V^-)\leftarrow higher- and lower-scoring halves of VV by r(⋅)r(\cdot)
4: add (q,y+,y−)(q,y^+,y^-) for a random matching of V+V^+ with V−V^- ▷ each response used at most once
5: for all y−∈Iy^-\in I do
6: add (q,y,y−)(q,y,y^-) with y∼Unif⁡(V)y\sim\operatorname{Unif}(V) ▷ valid ≻\succ invalid
7: end for
8: \\\mathbin{\backslash\backslash} Cross-round pairs
9: for all valid y+∈Y2y^+\in Y_2 do
10: add (q,y+,y−)(q,y^+,y^-) with y−∼Unif⁡({y∈V∩Y1:r(y)<r(y+)})y^-\sim\operatorname{Unif}(\{y\in V\cap Y_1:r(y)<r(y^+)\}) ▷ skip if empty
11: end for
12: return Bq\mathcal{B}_q

Table 6.

it by sampling. Expanding it,

KL⁡(πθ(⋅∣q~) ∥ πθ(⋅∣q))=Ey∼πθ(⋅∣q~)[log⁡πθ(y∣q~)−log⁡πθ(y∣q)].(16)\begin{aligned} \operatorname{KL}\left(\pi_\theta(\cdot\mid\tilde{q}) \,\|\, \pi_\theta(\cdot\mid q)\right) &= \mathbb{E}_{y \sim\pi_\theta(\cdot\mid\tilde{q})}\left[\log\pi_\theta(y \mid\tilde{q}) \right.\\ &\qquad\left. - \log\pi_\theta(y \mid q)\right]. \tag*{(16)} \end{aligned}

Two properties of our pipeline reduce this to a single likelihood. First, the Round-2 winner y+y^{+} is a draw from πθ(⋅∣q~)\pi_\theta(\cdot\mid\tilde{q}), the sampling distribution of Eq. (16), so it serves as a Monte Carlo sample at no extra cost; because Bref\mathcal{B}_{\mathrm{ref}} retains only winners whose gap certifies a reflective gain, the resulting term is a reward-filtered surrogate of the divergence, deliberately biased toward the region the hint improved. Second, treating the hinted policy as a fixed teacher, a stop-gradient on πθ(⋅∣q~)\pi_\theta(\cdot\mid\tilde{q}) that is standard in distillation, makes log⁡πθ(y+∣q~)\log\pi_\theta(y^{+} \mid\tilde{q}) a constant in θ\theta that drops from the gradient. What remains is

∇θL^RSD=−∇θlog⁡πθ(y+∣q),(17)\nabla_\theta\widehat{\mathcal{L}}_{\mathrm{RSD}} = -\nabla_\theta\log\pi_\theta(y^{+} \mid q), \tag*{(17)}

the gradient of the negative log-likelihood of the reflective winner under the unhinted prompt. The RSD term −λlog⁡πθ(y+∣q)-\lambda\log\pi_\theta(y^{+} \mid q) of Eq. (14) is therefore not a separate objective added to DPO but the reward-filtered, sampled, stop-gradient realization of the divergence in Eq. (13), evaluated on samples the search has already produced. The same forward pass DPO uses to score y+y^{+} already yields log⁡πθ(y+∣q)\log\pi_\theta(y^{+} \mid q), so the term adds essentially no compute.

Why this accumulates. A related distillation term has been motivated by inference-time hint independence, dropping the teacher at deployment (Zhao and Li, 2025). That reading does not apply here, since EPOCH deploys saved heuristic artifacts rather than the policy. Our motivation is internal to training. Every iteration draws its Round-1 rollouts from the unhinted policy πθ(⋅∣q)\pi_\theta(\cdot\mid q), so raising log⁡πθ(y+∣q)\log\pi_\theta(y^{+} \mid q) makes those rollouts more likely to recover the reflective improvement unprompted, which in turn seeds better parents, preference pairs, and experts in subsequent iterations. Because search and policy update interleave, an improvement internalized in one burst propagates through the population it generates, so the effect accumulates over the run rather than acting only at its end.

Implementation. We restrict RSD to Bref\mathcal{B}_{\mathrm{ref}} because each of its pairs contains, by construction, a valid Round-2 winner over a strictly worse valid Round-1 rollout, so the term distills genuine reflective gains rather than arbitrary accepted code. We length-normalize log⁡πθ(y+∣q)\log\pi_\theta(y^{+} \mid q) by the token length of y+y^{+} so the objective does not favor short heuristics, and we keep λ\lambda small. With few reflective samples per burst, an unnormalized or large-λ\lambda term behaves like maximum-likelihood concentration onto a handful of accepted heuristics and can oversharpen the policy, eroding the output diversity that the coverage objective depends on. Setting λ=0\lambda= 0 recovers the plain-DPO update of Eq. (2), which makes the contribution of RSD a single-coefficient ablation.

Extended Experiments

Extended Experiment Results

Table 5 extends Table 1 with the greedy-edge [1], nearest-insertion (Rosenkrantz et al., 1977), and Christofides [5] classical heuristics and the Qwen2.5-7B backbone; Table 6 extends Table 2 with the Qwen2.5-7B backbone. Both tables also include the inference-only baselines run with the closed-source GPT-5-nano as the generator. On OBP, EPOCH attains a lower average gap than each of them on both backbones at both top-1 and top-4. On TSP, EPOCH keeps the lower top-1 gap, and only EoH-S matches its top-10 ensemble, with a lower gap at n∈{20,200}n \in\{20, 200\} and a slightly higher one at n∈{50,100}n \in\{50, 100\}. These runs make every one of their 1,000 heuristic generations with GPT-5-nano, which EPOCH queries only as a critic, and cost 14–29× more per run in API calls (Appendix § 13).

Table 7 reports the KP results with the Llama-3.1-8B backbone against ReEvo and MCTS-AHD, whose released implementations include this problem. EPOCH attains the best or a comparable top-1 gap at every size, its top-3 ensemble outperforms the top-10 ensemble of ReEvo at every size, and its top-10 ensemble cuts the gap by 26–47% relative to MCTS-AHD and 55–59% relative to ReEvo, with the gains persisting OOD at n∈{50,200}n \in\{50, 200\}.

MethodKP-50KP-100KP-200
Classical heuristics
First-Fit (seed)32.85634.83653.153
LLM-based AHD: Llama-3.1-8B
ReEvoTop-10.224 ±0.0310.099 ±0.0160.107 ±0.025
ReEvoTop-30.198 ±0.0180.081 ±0.0060.089 ±0.023
ReEvoTop-100.170 ±0.0220.066 ±0.0050.071 ±0.018
MCTS-AHDTop-10.202 ±0.0130.090 ±0.0090.077 ±0.010
MCTS-AHDTop-30.187 ±0.0210.080 ±0.0160.063 ±0.017
MCTS-AHDTop-100.131 ±0.0380.054 ±0.0120.039 ±0.006
EPOCH (Ours)Top-10.188 ±0.0080.089 ±0.0060.078 ±0.010
EPOCH (Ours)Top-30.123 ±0.0270.057 ±0.0070.059 ±0.015
EPOCH (Ours)Top-100.070 ±0.0180.030 ±0.0050.029 ±0.006

Table 7. KP optimality gap (%) to the optimum with the Llama-3.1-8B backbone; each cell is the mean over runs with standard deviation, lower is better. Size n=100n=100 is ID (underlined); n∈{50,200}n \in\{50, 200\} are OOD. The best method per metric and test set is shaded; each test set’s overall best result is shown in bold.

Robustness to Seed Quality

Several LLM-based AHD methods begin their search from a fixed seed heuristic. ReEvo and HSEvo require one to initialize the population and to sustain variation among candidates, since a population that has converged to a single objective value cannot improve further and the search halts; CALM and EPOCH likewise start from a provided heuristic. To keep the comparison controlled, every method that requires a seed is initialized from the same heuristic, adopted from the MCTS-AHD experimental setup. The TSP seed, shown in the box below, is structurally detailed, scoring each candidate node by its distance to the current node, the mean and dispersion of its distances to the remaining nodes, and its distance to the destination.

import numpy as np

def select_next_node(current_node: int,
                     destination_node: int,
                     unvisited_nodes: set,
                     distance_matrix: np.ndarray) -> int:
    c1, c2, c3, c4 = 0.4, 0.3, 0.2, 0.1
    scores = {}
    for node in unvisited_nodes:
        all_distances = [distance_matrix[node][i]
                         for i in unvisited_nodes
                         if i != node]
        average_distance = np.mean(all_distances)
        std_dev_distance = np.std(all_distances)
        score = (
            c1 * distance_matrix[current_node][node]
            - c2 * average_distance
            + c3 * std_dev_distance
            - c4 * distance_matrix[destination_node][node]
        )
        scores[node] = score
    return min(scores, key=scores.get)

The OBP seed, shown in the box below, is a single priority rule shared by every seed-requiring method; it is structurally detailed yet weak, scoring below the First-Fit and Best-Fit rules of Table 6. It returns a priority score per open bin, and the framework places the item in the highest-scoring bin.

import numpy as np

def step(item_size: float,
         remaining_capacity: np.ndarray) -> np.ndarray:
    max_bin_cap = max(remaining_capacity)
    score = ((remaining_capacity - max_bin_cap) ** 2
             / item_size
             + remaining_capacity ** 2 / item_size ** 2
             + remaining_capacity ** 2 / item_size ** 3)
    over = remaining_capacity > item_size
    score[over] = -score[over]
    score[1:] -= score[:-1]
    return score

The KP seed, shown in the box below, packs the first remaining item that fits; it is the First-Fit row of Table 7.

import numpy as np

def select_next_item(remaining_capacity: float,
                     weights: np.ndarray,
                     values: np.ndarray) -> int:
    fits = np.flatnonzero(weights <= remaining_capacity)
    return int(fits[0])

A capable seed narrows the margin a method must close and can reward a search that exploits the seed over one that improves the generator. To test whether the advantage of EPOCH persists from a weaker starting point, we re-run the two methods that fine-tune the generator, CALM and EPOCH, from the substantially weaker TSP seed shown in the box below, which assigns every unvisited node the same constant score and therefore selects the next node without any problem-specific preference. All other settings match the TSP protocol of § 4.

import numpy as np

def select_next_node(current_node: int,
                     destination_node: int,
                     unvisited_nodes: set,
                     distance_matrix: np.ndarray) -> int:
    scores = {node: 1 for node in unvisited_nodes}
    return min(scores, key=scores.get)

As reported in Table 8, from the weak seed CALM degrades sharply on both backbones, and its top-10 gap at the training size n=50n=50 rises to 14.51% on Llama and 16.10% on Qwen, against 9.31 and 9.59% from the standard seed in Table 5. EPOCH instead stays close to its standard-seed performance, with a top-10 gap of 6.71 and 6.76% at n=50n=50 against 5.73 and 5.71% in Table 5, and it attains the lowest gap on every size, metric, and backbone. Its top-3 ensemble from the weak seed still outperforms the full top-10 ensemble of CALM throughout. Because the per-instance gap-vector objective steers selection, operator allocation, recovery, and the deployed ensemble toward coverage rather than the fitness of a single heuristic, EPOCH recovers a strong complementary set even from an uninformative seed, where a fitness-only method does not.

MethodTSP-20TSP-50TSP-100TSP-200
LLM-based AHD: Qwen2.5-7B
CALMTop-112.08 ±3.5616.70 ±3.8919.38 ±4.2121.39 ±3.56
CALMTop-312.08 ±3.5716.65 ±3.8919.32 ±4.2121.21 ±3.56
CALMTop-1011.49 ±3.5616.10 ±3.7218.60 ±3.9320.48 ±3.23
EPOCH (Ours)Top-17.97 ±2.3910.85 ±1.4512.82 ±1.3014.64 ±1.28
EPOCH (Ours)Top-35.55 ±2.018.61 ±1.5911.08 ±1.7113.22 ±1.53
EPOCH (Ours)Top-103.88 ±1.606.76 ±1.279.23 ±1.3511.59 ±1.39
LLM-based AHD: Llama-3.1-8B
CALMTop-111.30 ±1.4915.89 ±2.6517.81 ±3.0319.46 ±3.12
CALMTop-310.93 ±1.6615.41 ±2.8217.38 ±3.1819.05 ±3.25
CALMTop-109.91 ±1.3114.51 ±2.6316.40 ±3.1018.01 ±3.15
EPOCH (Ours)Top-17.97 ±1.4411.42 ±1.4013.11 ±1.1714.86 ±1.00
EPOCH (Ours)Top-35.31 ±0.858.82 ±1.0611.24 ±1.2013.53 ±1.07
EPOCH (Ours)Top-103.33 ±0.516.71 ±0.629.12 ±0.6911.59 ±0.73

Table 8. TSP optimality gap (%) to LKH-3 optima when the two methods that fine-tune the generator start from the weak seed; each cell is the mean over runs with standard deviation, lower is better. Size n=50n=50 is ID (underlined); n∈{20,100,200}n \in\{20, 100, 200\} are OOD. Within each backbone block the best method per metric and test set is shaded; each test set’s overall best result is shown in bold.

Search Dynamics & Evolutionary Curves

To assess search efficiency and stability, Figure 4 plots the best-so-far cost on Dtrain\mathcal{D}_{\mathrm{train}} against the number of heuristic evaluations, from the same weak seed and averaged over at least five runs of each method. EPOCH converges faster and to a lower cost than the LLM-based AHD baselines on both backbones, and its top-10 ensemble curve stays below every single-heuristic method across the entire budget, with low deviation across runs. This is the intended effect of optimizing per-instance coverage rather than the fitness of a single heuristic.

(a) (a) Llama-3.1-8B

(b) (b) Qwen2.5-7B

Figure 4. Evolution curves on TSP from the weak seed for (a) Llama-3.1-8B and (b) Qwen2.5-7B. Each curve is the mean over runs with its standard deviation as the shaded band; EPOCH is drawn as its top-1, top-3, and top-10 ensembles.

MethodTSP-20TSP-50TSP-100TSP-200
Classical heuristics
Nearest Neighbor17.6421.9624.5826.10
Greedy Edge11.9617.4118.6917.89
Nearest Insertion13.1419.3821.5523.69
Christofides8.8211.1711.9512.41
LLM-based AHD: GPT-4o-mini (closed-source)
ReEvoTop-110.55 ± 3.5813.89 ± 4.4815.43 ± 4.7716.64 ± 5.00
ReEvoTop-39.18 ± 2.5512.12 ± 2.6613.66 ± 3.2917.01 ± 4.28
ReEvoTop-108.49 ± 2.5210.92 ± 2.2912.48 ± 2.7014.29 ± 2.98
HSEvoTop-112.58 ± 4.1816.37 ± 4.6218.56 ± 4.9420.86 ± 5.30
HSEvoTop-311.38 ± 5.1615.12 ± 5.6417.39 ± 5.9120.14 ± 5.98
HSEvoTop-1010.59 ± 5.8114.28 ± 6.3216.66 ± 6.5019.65 ± 6.48
MCTS-AHDTop-17.28 ± 0.7110.77 ± 0.7112.82 ± 0.6714.75 ± 1.03
MCTS-AHDTop-36.25 ± 1.079.50 ± 1.0811.77 ± 1.1414.00 ± 1.18
MCTS-AHDTop-104.54 ± 1.207.94 ± 1.1710.49 ± 1.2512.85 ± 1.41
EoH-STop-18.56 ± 0.9111.69 ± 0.7113.80 ± 0.9115.05 ± 0.98
EoH-STop-35.05 ± 0.439.14 ± 0.6111.80 ± 0.8313.75 ± 0.85
EoH-STop-103.22 ± 0.417.30 ± 0.3810.06 ± 0.3812.39 ± 0.42
LLM-based AHD: GPT-5-nano (closed-source)
ReEvoTop-112.32 ± 5.1616.11 ± 5.4118.10 ± 5.8719.84 ± 6.08
ReEvoTop-312.32 ± 5.1616.11 ± 5.4118.10 ± 5.8719.84 ± 6.08
ReEvoTop-1012.32 ± 5.1616.11 ± 5.4118.10 ± 5.8719.84 ± 6.08
HSEvoTop-18.44 ± 1.0511.90 ± 1.2013.54 ± 1.0714.73 ± 1.17
HSEvoTop-38.21 ± 1.0811.64 ± 1.1813.22 ± 1.0914.39 ± 1.22
HSEvoTop-108.10 ± 1.1311.48 ± 1.2413.05 ± 1.1714.24 ± 1.30
MCTS-AHDTop-17.23 ± 0.3910.24 ± 0.3812.13 ± 0.4913.77 ± 1.02
MCTS-AHDTop-35.64 ± 1.228.67 ± 0.8410.66 ± 0.8512.51 ± 1.07
MCTS-AHDTop-103.78 ± 0.307.11 ± 0.349.32 ± 0.5811.64 ± 0.88
EoH-STop-16.47 ± 0.7110.04 ± 0.3712.04 ± 0.4813.94 ± 0.86
EoH-STop-34.13 ± 0.217.69 ± 0.3510.07 ± 0.5612.25 ± 0.81
EoH-STop-102.48 ± 0.155.78 ± 0.228.23 ± 0.3310.46 ± 0.33
LLM-based AHD: Qwen2.5-7B
ReEvoTop-17.83 ± 2.0711.10 ± 2.0212.99 ± 2.1014.43 ± 2.40
ReEvoTop-37.25 ± 1.5510.48 ± 1.5912.32 ± 1.6413.81 ± 2.06
ReEvoTop-107.23 ± 1.5810.47 ± 1.6012.30 ± 1.6613.78 ± 2.11
HSEvoTop-112.27 ± 3.2716.41 ± 3.7819.17 ± 3.7822.50 ± 3.60
HSEvoTop-312.12 ± 3.5016.30 ± 3.9219.08 ± 3.8822.50 ± 3.60
HSEvoTop-1011.16 ± 3.0015.42 ± 3.5818.22 ± 3.5521.53 ± 3.14
MCTS-AHDTop-18.42 ± 0.6612.00 ± 0.1614.25 ± 0.4915.93 ± 0.89
MCTS-AHDTop-37.83 ± 0.5811.34 ± 0.5413.63 ± 0.9215.19 ± 1.32
MCTS-AHDTop-106.04 ± 1.409.75 ± 1.3212.18 ± 1.2914.07 ± 1.31
EoH-STop-18.64 ± 1.0312.25 ± 1.2614.44 ± 1.8416.73 ± 2.50
EoH-STop-35.43 ± 1.149.12 ± 1.0511.76 ± 1.4514.43 ± 2.37
EoH-STop-103.46 ± 0.667.08 ± 0.769.97 ± 1.0112.69 ± 1.34
CALMTop-16.75 ± 0.089.99 ± 0.2211.96 ± 0.2013.96 ± 0.20
CALMTop-36.70 ± 0.149.92 ± 0.2311.90 ± 0.2113.91 ± 0.27
CALMTop-106.30 ± 0.509.59 ± 0.5511.59 ± 0.4213.77 ± 0.34
EPOCH (Ours)Top-16.42 ± 0.089.81 ± 0.2211.70 ± 0.4613.67 ± 0.91
EPOCH (Ours)Top-34.39 ± 0.207.62 ± 0.4410.06 ± 0.4512.25 ± 0.50
EPOCH (Ours)Top-102.91 ± 0.145.71 ± 0.318.22 ± 0.3710.93 ± 0.47
LLM-based AHD: Llama-3.1-8B
ReEvoTop-110.58 ± 0.5814.87 ± 1.3618.38 ± 2.1026.06 ± 12.93
ReEvoTop-310.28 ± 0.5914.15 ± 2.1516.19 ± 1.6519.05 ± 1.37
ReEvoTop-1010.25 ± 0.6214.10 ± 2.2415.96 ± 2.0118.69 ± 1.54
HSEvoTop-111.46 ± 1.6915.85 ± 2.6318.48 ± 4.5121.34 ± 7.00
HSEvoTop-310.61 ± 1.2814.83 ± 1.7617.27 ± 2.8219.47 ± 3.89
HSEvoTop-1010.29 ± 1.5414.45 ± 2.1016.80 ± 3.2418.99 ± 4.31
MCTS-AHDTop-110.27 ± 0.3714.23 ± 0.6516.39 ± 1.4817.87 ± 4.45
MCTS-AHDTop-39.76 ± 0.4013.40 ± 0.3915.40 ± 0.8116.92 ± 1.04
MCTS-AHDTop-107.58 ± 0.6311.73 ± 0.6113.77 ± 0.9115.51 ± 1.15
EoH-STop-110.69 ± 0.9315.43 ± 1.5817.86 ± 1.3820.04 ± 1.46
EoH-STop-36.05 ± 0.7211.68 ± 1.0614.59 ± 0.9317.31 ± 1.05
EoH-STop-104.70 ± 0.8110.46 ± 1.0213.60 ± 0.9616.45 ± 1.07
CALMTop-16.76 ± 0.2610.02 ± 0.2611.75 ± 0.2713.47 ± 0.31
CALMTop-36.55 ± 0.239.68 ± 0.5511.34 ± 0.5113.33 ± 0.47
CALMTop-106.19 ± 0.549.31 ± 0.8011.04 ± 0.9613.30 ± 0.91
EPOCH (Ours)Top-16.19 ± 0.309.61 ± 0.2511.63 ± 0.2113.57 ± 0.36
EPOCH (Ours)Top-34.31 ± 0.307.62 ± 0.239.85 ± 0.3611.98 ± 0.49
EPOCH (Ours)Top-102.81 ± 0.225.73 ± 0.158.15 ± 0.1910.74 ± 0.38

Table 5 (PDF p. 18). Complete version of Table 1. TSP optimality gap (%) to LKH-3 optima; each cell is the mean over runs with standard deviation, lower is better. Size n=50n=50 is ID (underlined); n∈{20,100,200}n \in\{20, 100, 200\} are OOD. Within each backbone block the best method per metric and test set is shaded; each test set’s overall best result is shown in bold.

Method1k1001\mathrm{k}_{100}1k5001\mathrm{k}_{500}5k1005\mathrm{k}_{100}5k5005\mathrm{k}_{500}10k10010\mathrm{k}_{100}10k50010\mathrm{k}_{500}Avg.
Classical heuristics
First-Fit5.020.254.650.554.360.502.55
Best-Fit4.770.254.310.554.050.472.40
LLM-based AHD: GPT-4o-mini (closed-source)
ReEvoTop-13.74 ±\pm 0.940.40 ±\pm 0.303.09 ±\pm 1.120.69 ±\pm 0.302.84 ±\pm 1.110.53 ±\pm 0.121.88 ±\pm 0.46
Top-43.61 ±\pm 1.010.40 ±\pm 0.302.98 ±\pm 1.210.56 ±\pm 0.132.74 ±\pm 1.220.44 ±\pm 0.031.79 ±\pm 0.53
HSEvoTop-12.85 ±\pm 1.010.40 ±\pm 0.302.19 ±\pm 1.150.56 ±\pm 0.022.01 ±\pm 1.150.50 ±\pm 0.041.42 ±\pm 0.52
Top-42.82 ±\pm 1.010.20 ±\pm 0.102.17 ±\pm 1.170.47 ±\pm 0.122.01 ±\pm 1.150.42 ±\pm 0.101.35 ±\pm 0.56
MCTS-AHDTop-12.59 ±\pm 0.450.15 ±\pm 0.121.88 ±\pm 0.470.42 ±\pm 0.171.71 ±\pm 0.410.38 ±\pm 0.121.19 ±\pm 0.27
Top-42.48 ±\pm 0.510.10 ±\pm 0.121.79 ±\pm 0.530.36 ±\pm 0.171.61 ±\pm 0.480.33 ±\pm 0.131.11 ±\pm 0.31
EoH-STop-12.62 ±\pm 0.330.25 ±\pm 0.161.74 ±\pm 0.730.42 ±\pm 0.151.46 ±\pm 0.830.35 ±\pm 0.131.14 ±\pm 0.33
Top-42.40 ±\pm 0.380.15 ±\pm 0.121.41 ±\pm 0.560.24 ±\pm 0.161.08 ±\pm 0.580.18 ±\pm 0.150.91 ±\pm 0.30
LLM-based AHD: GPT-5-nano (closed-source)
ReEvoTop-13.58 ±\pm 1.240.50 ±\pm 0.252.91 ±\pm 1.320.62 ±\pm 0.072.73 ±\pm 1.370.54 ±\pm 0.061.81 ±\pm 0.72
Top-43.58 ±\pm 1.240.37 ±\pm 0.132.90 ±\pm 1.310.57 ±\pm 0.022.72 ±\pm 1.350.47 ±\pm 0.001.77 ±\pm 0.68
HSEvoTop-14.56 ±\pm 0.150.25 ±\pm 0.004.04 ±\pm 0.220.55 ±\pm 0.003.89 ±\pm 0.130.47 ±\pm 0.012.29 ±\pm 0.08
Top-44.56 ±\pm 0.150.25 ±\pm 0.004.04 ±\pm 0.220.55 ±\pm 0.003.88 ±\pm 0.130.47 ±\pm 0.012.29 ±\pm 0.08
MCTS-AHDTop-13.78 ±\pm 1.150.25 ±\pm 0.003.06 ±\pm 1.440.55 ±\pm 0.002.81 ±\pm 1.460.48 ±\pm 0.021.82 ±\pm 0.67
Top-43.73 ±\pm 1.190.20 ±\pm 0.103.04 ±\pm 1.430.48 ±\pm 0.092.79 ±\pm 1.450.43 ±\pm 0.081.78 ±\pm 0.71
EoH-STop-13.22 ±\pm 0.830.53 ±\pm 0.811.84 ±\pm 0.830.48 ±\pm 0.181.53 ±\pm 0.860.41 ±\pm 0.091.33 ±\pm 0.51
Top-42.84 ±\pm 0.850.28 ±\pm 0.501.39 ±\pm 0.700.36 ±\pm 0.170.94 ±\pm 0.700.31 ±\pm 0.161.02 ±\pm 0.42
LLM-based AHD: Qwen2.5-7B
ReEvoTop-14.53 ±\pm 0.680.25 ±\pm 0.003.29 ±\pm 1.290.49 ±\pm 0.123.00 ±\pm 1.370.44 ±\pm 0.132.00 ±\pm 0.55
Top-44.47 ±\pm 0.650.20 ±\pm 0.103.25 ±\pm 1.260.48 ±\pm 0.122.98 ±\pm 1.350.41 ±\pm 0.121.97 ±\pm 0.52
HSEvoTop-14.72 ±\pm 0.100.25 ±\pm 0.004.24 ±\pm 0.100.55 ±\pm 0.004.02 ±\pm 0.050.47 ±\pm 0.002.38 ±\pm 0.04
Top-44.71 ±\pm 0.120.25 ±\pm 0.004.24 ±\pm 0.100.55 ±\pm 0.004.02 ±\pm 0.060.47 ±\pm 0.002.37 ±\pm 0.05
MCTS-AHDTop-14.71 ±\pm 0.140.25 ±\pm 0.004.13 ±\pm 0.210.55 ±\pm 0.003.95 ±\pm 0.220.47 ±\pm 0.002.34 ±\pm 0.09
Top-44.64 ±\pm 0.080.25 ±\pm 0.004.12 ±\pm 0.210.55 ±\pm 0.003.93 ±\pm 0.210.47 ±\pm 0.002.33 ±\pm 0.08
EoH-STop-13.70 ±\pm 1.100.49 ±\pm 0.292.89 ±\pm 1.210.52 ±\pm 0.122.71 ±\pm 1.210.44 ±\pm 0.121.79 ±\pm 0.57
Top-43.37 ±\pm 1.100.25 ±\pm 0.252.31 ±\pm 1.350.39 ±\pm 0.122.04 ±\pm 1.430.39 ±\pm 0.121.46 ±\pm 0.64
CALMTop-14.17 ±\pm 0.540.35 ±\pm 0.122.89 ±\pm 1.180.45 ±\pm 0.152.55 ±\pm 1.330.35 ±\pm 0.151.79 ±\pm 0.51
Top-44.09 ±\pm 0.550.30 ±\pm 0.102.82 ±\pm 1.280.45 ±\pm 0.152.50 ±\pm 1.410.35 ±\pm 0.161.75 ±\pm 0.56
EPOCH (Ours)Top-13.91 ±\pm 0.660.25 ±\pm 0.221.54 ±\pm 0.460.17 ±\pm 0.091.27 ±\pm 0.660.19 ±\pm 0.141.22 ±\pm 0.20
Top-43.19 ±\pm 0.100.15 ±\pm 0.200.79 ±\pm 0.030.17 ±\pm 0.090.30 ±\pm 0.020.15 ±\pm 0.070.79 ±\pm 0.05
LLM-based AHD: Llama-3.1-8B
ReEvoTop-14.34 ±\pm 0.700.25 ±\pm 0.003.27 ±\pm 1.250.41 ±\pm 0.173.04 ±\pm 1.360.36 ±\pm 0.161.95 ±\pm 0.60
Top-44.10 ±\pm 0.870.20 ±\pm 0.103.23 ±\pm 1.240.41 ±\pm 0.172.98 ±\pm 1.340.35 ±\pm 0.161.88 ±\pm 0.64
HSEvoTop-13.39 ±\pm 0.930.25 ±\pm 0.002.42 ±\pm 1.260.42 ±\pm 0.182.11 ±\pm 1.330.36 ±\pm 0.151.49 ±\pm 0.58
Top-43.36 ±\pm 0.970.25 ±\pm 0.002.42 ±\pm 1.260.40 ±\pm 0.162.10 ±\pm 1.330.36 ±\pm 0.151.48 ±\pm 0.59
MCTS-AHDTop-14.14 ±\pm 0.890.17 ±\pm 0.123.54 ±\pm 1.090.46 ±\pm 0.123.30 ±\pm 1.070.40 ±\pm 0.112.00 ±\pm 0.57
Top-44.11 ±\pm 0.940.17 ±\pm 0.123.54 ±\pm 1.090.46 ±\pm 0.123.30 ±\pm 1.070.40 ±\pm 0.111.99 ±\pm 0.57
EoH-STop-13.92 ±\pm 0.780.21 ±\pm 0.092.89 ±\pm 0.870.51 ±\pm 0.072.59 ±\pm 1.000.45 ±\pm 0.051.76 ±\pm 0.38
Top-43.56 ±\pm 0.730.08 ±\pm 0.121.46 ±\pm 0.570.16 ±\pm 0.091.14 ±\pm 0.690.14 ±\pm 0.101.09 ±\pm 0.27
CALMTop-13.71 ±\pm 0.520.59 ±\pm 0.821.32 ±\pm 0.400.30 ±\pm 0.140.82 ±\pm 0.410.27 ±\pm 0.141.17 ±\pm 0.22
Top-43.69 ±\pm 0.510.59 ±\pm 0.821.29 ±\pm 0.430.29 ±\pm 0.150.80 ±\pm 0.430.26 ±\pm 0.131.15 ±\pm 0.23
EPOCH (Ours)Top-12.99 ±\pm 0.700.30 ±\pm 0.361.66 ±\pm 0.900.32 ±\pm 0.211.33 ±\pm 0.970.28 ±\pm 0.241.15 ±\pm 0.39
Top-42.34 ±\pm 0.430.10 ±\pm 0.120.74 ±\pm 0.060.20 ±\pm 0.070.36 ±\pm 0.060.13 ±\pm 0.040.64 ±\pm 0.07

Table 6 (PDF p. 19). Complete version of Table 2. OBP optimality gap (%) to the L1L_1 lower bound on the six held-out Weibull test sets; each cell is the mean of over runs with standard deviation, lower is better. Column headers are (items, capacity), e.g. 1k_100 is 1,000 items at capacity 100; Avg. is the mean over the six. Item scales 1k, 5k are ID (underlined); 10k is OOD. Within each backbone block the best Avg. per metric is shaded; each test set’s overall best result is shown in bold.

Generalization to Real-World TSPLIB Instances

The experiments of § 4 train and test on random uniform instances. To test whether the discovered heuristics transfer to real, structured instances of varied size and scale, we evaluate on TSPLIB (Reinelt, 1991), using its 15 instances with fewer than 500 nodes. Coordinates are scaled to [0,1]2[0,1]^2 to match the training distribution, each tour is built from three start nodes and averaged, and the gap is taken against the known optimum. For every method we deploy the top-10 ensemble of its single best run, selected by the lowest mean top-10 gap over the four uniform test sizes. We compare against the manually designed greedy, nearest-insertion, and nearest-neighbor heuristics (Rosenkrantz et al., 1977) and the genetic-programming hyper-heuristic GPHH [8].

As reported in Table 9, EPOCH attains the lowest average optimality gap and the best result on the majority of the TSPLIB instances.

InstanceGreedyNear-ins.Near-gr.GPHHReEvoHSEvoMCTS-AHDEoH-SCALMEPOCH
ts2255.3819.9316.827.717.366.183.563.695.785.68
rat9922.3021.0521.7914.0917.3917.7216.8818.5014.059.87
bier12719.5023.0523.2515.6420.9417.2617.5311.2412.186.33
lin31818.7524.4425.7814.3015.4716.2114.4814.4812.7311.97
eil5113.0316.1431.9610.206.658.427.267.567.536.83
d49316.6820.3924.0015.5817.8114.3715.3315.5412.9611.37
kroB10016.5921.5326.2614.0616.8812.5212.5114.2012.4010.38
kroC10012.9424.2525.7616.2216.1415.5515.7513.8215.0510.97
ch13028.4019.2125.6614.7713.5012.5211.5212.5810.478.09
pr29931.4225.0531.4218.2420.6820.9519.5519.6617.1718.07
fl41712.6425.5232.4222.7215.0118.9016.2518.9221.9213.67
kroA15020.2419.0926.0815.5915.3319.8715.1216.1912.759.10
pr26411.8934.2817.8723.9630.0314.3715.3512.7819.6715.87
pr22621.4428.0224.6515.5113.4111.1516.5512.4419.8916.55
pr43920.0824.6727.3621.3627.0723.8018.9119.5317.0113.01
Average18.0923.1125.4116.0016.9115.3214.4414.0814.1111.18

Table 9. Generalization to real-world TSPLIB instances (Reinelt, 1991), reported as the per-instance optimality gap (%) to the known optimum, lower is better. The LLM-based methods use the Llama-3.1-8B backbone, and the manual and GP reference columns are single heuristics taken from Duflo et al. [8]. Per instance, the best LLM-based method is shaded and the overall best is in bold.

Significance Testing and Uncertainty Quantification

We test whether the advantage of EPOCH in Tables 5 and 6 is statistically reliable along the two axes that matter for an LLM-driven search: the randomness of an entire run (LLM sampling and the stochastic search trajectory), and the spread of difficulty across test instances. The first is addressed by a significance test across runs, the second by a paired comparison across instances. Every method is run at least five times.

Statistical Significance Across Runs

We treat each independent run of a method as one observation, summarized by the mean optimality gap of its deployed ensemble on a test set: the top-10 ensemble for TSP and the top-4 ensemble for OBP. For each test set we test whether EPOCH reaches a lower mean gap than a given baseline with a one-sided two-sample tt-test in the Welch form, which does not assume the two methods share a variance (Welch, 1947). The per-size pp-values for TSP on both backbones are in Table 10; those for OBP, where the test is run on the gap averaged over the six Weibull sets as each set holds only a few instances, are in Table 11. A pp-value below 0.05 indicates that the lower mean gap of EPOCH is unlikely to be an artifact of run-to-run noise. EPOCH attains a significantly lower mean gap than the baselines in nearly all settings.

MethodQwen2.5-7B TSP-20Qwen2.5-7B TSP-50Qwen2.5-7B TSP-100Qwen2.5-7B TSP-200Llama-3.1-8B TSP-20Llama-3.1-8B TSP-50Llama-3.1-8B TSP-100Llama-3.1-8B TSP-200
ReEvo0.0030.0020.0030.0262.7×10−62.7 \times10^{-6}8.5×10−48.5 \times10^{-4}7.1×10−47.1 \times10^{-4}1.8×10−41.8 \times10^{-4}
HSEvo0.0030.0030.0020.0202.9×10−42.9 \times10^{-4}5.6×10−45.6 \times10^{-4}0.0030.009
MCTS-AHD0.0050.0010.0010.0032.4×10−52.4 \times10^{-5}1.2×10−51.2 \times10^{-5}9.5×10−59.5 \times10^{-5}3.7×10−43.7 \times10^{-4}
EoH-S0.0600.0040.0050.0160.0016.2×10−56.2 \times10^{-5}1.9×10−51.9 \times10^{-5}1.4×10−51.4 \times10^{-5}
CALM4.0×10−54.0 \times10^{-5}6.2×10−66.2 \times10^{-6}1.3×10−61.3 \times10^{-6}1.8×10−51.8 \times10^{-5}4.2×10−54.2 \times10^{-5}3.7×10−43.7 \times10^{-4}3.3×10−43.3 \times10^{-4}0.002

Table 10. Across-run significance on TSP. One-sided Welch tt-test pp-values for the EPOCH top-10 ensemble gap against each baseline, per test size and backbone; p<0.05p < 0.05 is shown in bold.

MethodQwen2.5-7BLlama-3.1-8B
ReEvo0.0050.009
HSEvo1.9×10−111.9 \times10^{-11}0.023
EoH-S0.0330.007
CALM0.0130.005

Table 11. Across-run significance on OBP. One-sided Welch tt-test pp-values for the EPOCH top-4 ensemble gap, averaged over the six Weibull test sets, against the baselines; p<0.05p < 0.05 is shown in bold.

Cross-Instance Uncertainty Quantification

The run-level test takes a run as its unit; we now ask whether the advantage holds across the individual test instances, that is, whether it is distributional rather than carried by a few easy cases. We restrict this analysis to TSP and KP, whose test sets contain 300 and 1,000 instances each; the OBP sets are too small for a per-instance comparison. For each method we average its per-instance optimality gap over runs to obtain one gap per instance for the deployed top-10 ensemble, and compare EPOCH against each baseline on the same instances. The paired per-instance gap differences are tested with the two-sided Wilcoxon signed-rank test (Wilcoxon, 1945), reported in Table 12 and Table 13 together with the number of instances on which EPOCH wins, ties, or loses against the baseline (a tie is a gap difference within 10−910^{-9}). EPOCH wins the large majority of instances at every size and on both backbones on TSP, and on KP it wins several times more instances than it loses at every size, where most ties are instances both ensembles solve optimally; the test is significant throughout, so the gains in Tables 5 and Table 7 reflect a population-wide advantage rather than a few outliers.

Methodnn\multicolumn{4}{c}{Qwen2.5-7B}\multicolumn{4}{c}{Llama-3.1-8B}
Wilcoxon ppWinTieLossWilcoxon ppWinTieLoss
ReEvo201.8×10−471.8 \times10^{-47}2780227.9×10−507.9 \times10^{-50}29208
503.9×10−503.9 \times10^{-50}2890116.1×10−516.1 \times10^{-51}30000
1009.3×10−519.3 \times10^{-51}296046.1×10−516.1 \times10^{-51}30000
2001.9×10−501.9 \times10^{-50}2890116.1×10−516.1 \times10^{-51}30000
HSEvo203.7×10−503.7 \times10^{-50}295052.3×10−502.3 \times10^{-50}29208
506.1×10−516.1 \times10^{-51}300006.1×10−516.1 \times10^{-51}30000
1006.1×10−516.1 \times10^{-51}300006.1×10−516.1 \times10^{-51}30000
2006.1×10−516.1 \times10^{-51}300006.1×10−516.1 \times10^{-51}30000
MCTS-AHD201.4×10−421.4 \times10^{-42}26910215.1×10−455.1 \times10^{-45}275025
501.9×10−481.9 \times10^{-48}2860147.1×10−517.1 \times10^{-51}29802
1007.9×10−517.9 \times10^{-51}298026.3×10−516.3 \times10^{-51}29802
2007.7×10−517.7 \times10^{-51}295056.1×10−516.1 \times10^{-51}30000
EoH-S203.1×10−113.1 \times10^{-11}19610943.0×10−243.0 \times10^{-24}223770
503.8×10−323.8 \times10^{-32}2460545.2×10−505.2 \times10^{-50}289011
1003.9×10−463.9 \times10^{-46}2790219.5×10−519.5 \times10^{-51}29703
2001.8×10−481.8 \times10^{-48}2830177.1×10−517.1 \times10^{-51}29802
CALM202.5×10−462.5 \times10^{-46}2722537.6×10−497.6 \times10^{-49}277176
508.0×10−518.0 \times10^{-51}295051.1×10−501.1 \times10^{-50}29613
1007.1×10−517.1 \times10^{-51}298021.4×10−501.4 \times10^{-50}29406
2001.4×10−501.4 \times10^{-50}294067.3×10−517.3 \times10^{-51}29604

Table 12. Cross-instance uncertainty quantification on TSP for the deployed top-10 ensemble. Each entry is the Wilcoxon signed-rank pp-value on the paired per-instance gap differences, with the Win/Tie/Loss counts of EPOCH against the baseline.

MethodnnWilcoxon ppWinTieLoss
ReEvo502.3×10−1262.3 \times10^{-126}52244038
1001.8×10−1211.8 \times10^{-121}65727370
2004.4×10−1314.4 \times10^{-131}82566109
MCTS-AHD502.9×10−772.9 \times10^{-77}45349354
1003.6×10−783.6 \times10^{-78}54436789
2001.8×10−361.8 \times10^{-36}515309176

Table 13. Cross-instance uncertainty quantification on KP for the deployed top-10 ensemble with the Llama-3.1-8B backbone. Each entry is the Wilcoxon signed-rank pp-value on the paired per-instance gap differences over the 1,000 instances per size, with the Win/Tie/Loss counts of EPOCH against the baseline.

Extended Ablations

Each ablation removes exactly one component and replaces it with a simpler, untuned alternative, holding every other component and all hyperparameters at their full-method values. The full-method and w/o RSD rows reuse the main EPOCH runs (the latter is the λ=0\lambda=0 setting), so all rows are directly comparable. Ablations use the Llama-3.1-8B backbone on TSP and OBP, the full training budget, and five runs per variant scored on 100 instances per test set. Each row’s removed component and its replacement are listed in Table 14; the hyperparameter ablation of § 4.2 is in Table 15.

AblationRemovedReplacement
Reflective learning
w/o RSDthe RSD distillation termplain DPO on the same pairs (λ=0\lambda=0)
w/o cross-round pairsthe certified cross-round matching, a valid hinted Round-2 winner over a strictly worse valid Round-1 heuristiceach valid Round-2 heuristic paired with a randomly chosen valid Round-1 heuristic, reward-ordered (λ=0\lambda=0)
w/o instance-grounded insightthe gap-vector instance-split sentence in the teacher prompta generic critique from code and scalar gaps only
w/o teacher reflectionthe insight channelRound 2 regenerates unhinted (λ=0\lambda=0)
w/o preference optimizationall DPO burstsa frozen generator, search and reflection only
Coverage-aware search
w/o expert-aware selectionexpert-count ranking and the complementary second parentparents ranked by average gap only
w/o adaptive operator allocationthe operator banditevery eligible operator drawn with equal probability
coverage-blind banditthe expert-coverage term of the bandit rewarda bandit rewarded by the parent-improvement and validity terms only
w/o coverage-stagnation signalthe coverage-stagnation criterion and soft capa fixed reset every 20 iterations
w/o expert-preserving recoverythe expert-preserving survivor rulereset to the single best heuristic by average gap
Gap-vector representation
scalar fitness (no gap vector)every read of the per-instance gap vectorthe scalar average gap throughout selection, the bandit reward, stall detection, rebuild, and archiving

Table 14. Component ablations: what each row removes and the simpler alternative that replaces it, grouped as in Table 3.

TSPOBP
RSD weight λ\lambda
λ=0\lambda=0 (no RSD)7.17 ±0.270.79 ±0.06
λ=0.1\lambda=0.1 ★6.79 ±0.190.64 ±0.07
λ=0.15\lambda=0.156.84 ±0.350.73 ±0.12
λ=0.2\lambda=0.26.96 ±0.090.76 ±0.09
RSD scope
cross-round only ★6.79 ±0.190.64 ±0.07
all pairs7.05 ±0.050.73 ±0.12
Coverage pressure pp
p=0p=0 (no expert selection)6.93 ±0.150.81 ±0.09
p=0.5p=0.5 ★6.79 ±0.190.64 ±0.07
p=1p=16.88 ±0.180.78 ±0.05
Preference-burst period TdpoT_{\mathrm{dpo}}
Tdpo=10T_{\mathrm{dpo}}=107.05 ±0.450.69 ±0.11
Tdpo=20T_{\mathrm{dpo}}=20 ★6.79 ±0.190.64 ±0.07
Tdpo=40T_{\mathrm{dpo}}=406.99 ±0.141.00 ±0.52

Table 15. Hyperparameter ablation on the Llama-3.1-8B backbone, reported as the ensemble optimality gap (%), lower is better; ★ marks the full-method default.

Hyperparameter Ablation

With the components fixed at the full method, we vary one hyperparameter at a time and report in Table 15 the same averaged ensemble gaps as the component study. The RSD weight λ\lambda improves performance across a broad range of small values rather than at a single point, and the default λ=0.1\lambda=0.1 is best or tied on both problems; distilling only the certified cross-round winners outperforms distilling all pairs. The coverage-pressure blend pp, which sets pexp=pcomp=pp_{\mathrm{exp}} = p_{\mathrm{comp}} = p, is best at the default 0.5, since pure exploitation at p=0p=0 removes expert-aware selection and pure coverage at p=1p=1 over-explores. The preference-burst period TdpoT_{\mathrm{dpo}} is best at its default of 20 iterations; both shorter and longer periods are worse, and the longer period markedly destabilizes OBP.

Teacher LLM Ablation

The teacher is a critic rather than a generator: it reads two heuristics with their gaps and explains their difference in a few sentences. We fill this role with a reasoning model that reads code, as is now common for critic roles, and take it from a different model family than the generator, so that the critique is an independent view of the candidates rather than the generator’s own. GPT-5-nano is a small model of this kind, which keeps a run’s critiques at $0.08 (Table 18). To test whether the gains of EPOCH depend on the teacher model, we also run EPOCH with GPT-4o-mini and with the generator’s own backbone as the teacher; in the latter, the frozen pretrained backbone writes the critique, so the run uses no external model. The teacher prompts of Appendix § 15 are unchanged. Table 16 and Table 17 report the results under the protocol of § 4; the EPOCH rows with GPT-5-nano and the EoH-S and CALM rows, the strongest baselines on these backbones at the ensemble level, are taken from Tables 5 and 6.

MethodTSP-20TSP-50TSP-100TSP-200
LLM-based AHD: Qwen2.5-7B
EoH-STop-18.64 ±1.0312.25 ±1.2614.44 ±1.8416.73 ±2.50
Top-35.43 ±1.149.12 ±1.0511.76 ±1.4514.43 ±2.37
Top-103.46 ±0.667.08 ±0.769.97 ±1.0112.69 ±1.34
CALMTop-16.75 ±0.089.99 ±0.2211.96 ±0.2013.96 ±0.20
Top-36.70 ±0.149.92 ±0.2311.90 ±0.2113.91 ±0.27
Top-106.30 ±0.509.59 ±0.5511.59 ±0.4213.77 ±0.34
EPOCH (GPT-5-nano)Top-16.42 ±0.089.81 ±0.2211.70 ±0.4613.67 ±0.91
Top-34.39 ±0.207.62 ±0.4410.06 ±0.4512.25 ±0.50
Top-102.91 ±0.145.71 ±0.318.22 ±0.3710.93 ±0.47
EPOCH (GPT-4o-mini)Top-16.46 ±0.309.75 ±0.2511.75 ±0.3013.41 ±0.90
Top-34.73 ±0.427.98 ±0.4810.29 ±0.5912.39 ±0.60
Top-103.15 ±0.205.99 ±0.278.30 ±0.1510.66 ±0.22
EPOCH (own backbone)Top-16.49 ±0.469.73 ±0.3411.61 ±0.4613.31 ±0.59
Top-34.58 ±0.797.69 ±0.329.71 ±0.1711.83 ±0.15
Top-102.92 ±0.266.04 ±0.118.42 ±0.1410.86 ±0.29
LLM-based AHD: Llama-3.1-8B
EoH-STop-110.69 ±0.9315.43 ±1.5817.86 ±1.3820.04 ±1.46
Top-36.05 ±0.7211.68 ±1.0614.59 ±0.9317.31 ±1.05
Top-104.70 ±0.8110.46 ±1.0213.60 ±0.9616.45 ±1.07
CALMTop-16.76 ±0.2610.02 ±0.2611.75 ±0.2713.47 ±0.31
Top-36.55 ±0.239.68 ±0.5511.34 ±0.5113.33 ±0.47
Top-106.19 ±0.549.31 ±0.8011.04 ±0.6713.30 ±0.91
EPOCH (GPT-5-nano)Top-16.19 ±0.309.61 ±0.2511.63 ±0.2113.57 ±0.36
Top-34.31 ±0.307.62 ±0.239.85 ±0.3611.98 ±0.49
Top-102.81 ±0.225.73 ±0.158.15 ±0.1910.74 ±0.38
EPOCH (GPT-4o-mini)Top-16.92 ±0.4010.07 ±0.2111.97 ±0.2613.94 ±0.35
Top-34.60 ±0.387.69 ±0.359.97 ±0.3212.10 ±0.26
Top-102.87 ±0.145.89 ±0.368.36 ±0.3410.90 ±0.28
EPOCH (own backbone)Top-16.43 ±0.359.84 ±0.5111.63 ±0.6313.69 ±0.82
Top-34.45 ±0.148.01 ±0.6210.17 ±0.8612.37 ±0.87
Top-102.89 ±0.195.92 ±0.378.22 ±0.4510.60 ±0.56

Table 16. Teacher LLM ablation on TSP. Optimality gap (%) to LKH-3 optima for EPOCH with three teachers, named in parentheses, with the EoH-S and CALM rows of Table 5 for reference; each cell is the mean over runs with standard deviation, lower is better. Size n=50n=50 is ID (underlined); n∈{20,100,200}n \in\{20, 100, 200\} are OOD. Within each backbone block the best method per metric and test set is shaded; each test set’s overall best result is shown in bold.

Method1k_1001k_5005k_1005k_50010k_10010k_500Avg.
LLM-based AHD: Qwen2.5-7B
EoH-STop-13.70 ±1.100.49 ±0.292.89 ±1.210.52 ±0.122.71 ±1.210.44 ±0.121.79 ±0.57
Top-43.37 ±1.100.25 ±0.252.31 ±1.350.39 ±0.122.04 ±1.430.39 ±0.121.46 ±0.64
CALMTop-14.17 ±0.540.35 ±0.122.89 ±1.180.45 ±0.152.55 ±1.330.35 ±0.151.79 ±0.51
Top-44.09 ±0.550.30 ±0.102.82 ±1.280.45 ±0.152.50 ±1.410.35 ±0.161.75 ±0.56
EPOCH (GPT-5-nano)Top-13.91 ±0.660.25 ±0.221.54 ±0.460.17 ±0.091.27 ±0.660.19 ±0.141.22 ±0.20
Top-43.19 ±0.100.15 ±0.200.79 ±0.030.17 ±0.090.30 ±0.020.15 ±0.070.79 ±0.05
EPOCH (GPT-4o-mini)Top-13.94 ±0.711.32 ±1.192.08 ±1.490.53 ±0.061.75 ±0.590.42 ±0.071.67 ±0.50
Top-43.22 ±0.150.33 ±0.310.78 ±0.030.36 ±0.130.36 ±0.080.27 ±0.150.89 ±0.05
EPOCH (own backbone)Top-13.26 ±0.330.58 ±0.230.96 ±0.170.60 ±0.041.27 ±1.240.52 ±0.051.20 ±0.13
Top-43.18 ±0.280.16 ±0.120.82 ±0.040.28 ±0.051.22 ±1.300.18 ±0.060.97 ±0.18
LLM-based AHD: Llama-3.1-8B
EoH-STop-13.92 ±0.780.21 ±0.212.89 ±0.870.51 ±0.072.59 ±1.000.45 ±0.051.76 ±0.38
Top-43.56 ±0.730.08 ±0.121.46 ±0.570.16 ±0.091.14 ±0.690.14 ±0.101.09 ±0.27
CALMTop-13.71 ±0.520.59 ±0.821.32 ±0.400.30 ±0.140.82 ±0.410.27 ±0.141.17 ±0.22
Top-43.69 ±0.510.59 ±0.821.29 ±0.430.29 ±0.150.80 ±0.430.26 ±0.131.15 ±0.23
EPOCH (GPT-5-nano)Top-12.99 ±0.700.30 ±0.361.66 ±0.900.32 ±0.211.33 ±0.970.28 ±0.241.15 ±0.39
Top-42.34 ±0.430.10 ±0.120.74 ±0.060.20 ±0.070.36 ±0.060.13 ±0.040.64 ±0.07
EPOCH (GPT-4o-mini)Top-13.20 ±0.630.55 ±0.431.11 ±0.200.30 ±0.190.64 ±0.230.58 ±0.651.06 ±0.15
Top-42.86 ±0.520.15 ±0.200.80 ±0.080.11 ±0.070.35 ±0.030.10 ±0.050.73 ±0.06
EPOCH (own backbone)Top-13.65 ±0.540.45 ±0.291.31 ±0.540.38 ±0.160.87 ±0.560.33 ±0.181.16 ±0.19
Top-43.04 ±0.600.25 ±0.160.79 ±0.040.21 ±0.120.32 ±0.020.15 ±0.050.79 ±0.10

Table 17. Teacher LLM ablation on OBP. Optimality gap (%) to the L1L_1 lower bound on the six held-out Weibull test sets for EPOCH with three teachers, named in parentheses, with the EoH-S and CALM rows of Table 6 for reference; each cell is the mean over runs with standard deviation, lower is better. Columns are (items, capacity) and Avg. is the mean over the six. Item scales 1k, 5k are ID (underlined); 10k is OOD. Within each backbone block the best Avg. per metric is shaded; each test set’s overall best result is shown in bold.

TSPOBP
LLM-based AHD: GPT-4o-mini (closed-source)
ReEvo0.600.52
HSEvo0.380.29
MCTS-AHD0.420.36
EoH-S0.530.29
LLM-based AHD: GPT-5-nano (closed-source)
ReEvo2.21.7
HSEvo2.31.3
MCTS-AHD2.11.5
EoH-S1.91.1
LLM-based AHD: Qwen2.5-7B / Llama-3.1-8B
ReEvo0.500.50
HSEvo0.120.12
MCTS-AHD0.430.43
EPOCH (GPT-5-nano teacher)0.080.08
EPOCH (GPT-4o-mini teacher)0.050.04
EPOCH (own-backbone teacher)0.000.00

Table 18. API cost per run in US dollars at list prices, grouped by the model that generates the heuristics. With an open backbone, the cost is that of the auxiliary LLM calls, averaged over the two backbones.

The teacher model has little effect on the ensemble. Across the three teachers, the top-10 TSP gap changes by less than 0.4 points at every size and the top-4 OBP average by less than 0.2 points, and every teacher keeps EPOCH’s top-10 TSP ensemble and top-4 OBP average ahead of all baselines on the same backbone in Tables 5 and 6. With its own backbone as the teacher, EPOCH uses no model beyond its generator. Its top-10 gap at n=50n=50 is still 36–37% below CALM and 15–43% below EoH-S, and its top-4 OBP average is 31–45% below CALM and 28–34% below EoH-S. GPT-5-nano gives the lowest ensemble gap in most settings, by a small margin. At top-1, where a single heuristic represents the run, the teachers differ more, and all three remain comparable to CALM while staying below every inference-only baseline on the same backbone, at each TSP size and in the OBP average. An independent teacher is therefore a design default rather than a dependency: the gains persist when the generator’s own backbone writes the critique.

With GPT-4o-mini as the teacher, EPOCH on Llama-3.1-8B still outperforms the inference-only

baselines run with GPT-4o-mini (Tables 5 and 6): on TSP at every metric and test size, with its top-10 ensemble 11–19% below EoH-S and its top-1 heuristic 5–7% below MCTS-AHD, and on OBP with a top-4 average 20% below EoH-S and a top-1 average 7% below. The same closed-source model serves EPOCH only as a critic, at 7–13× lower API cost per run (Table 18). With its own backbone as the teacher, EPOCH uses no external model and still outperforms the inference-only baselines run with GPT-4o-mini on TSP at every metric and test size on both backbones, with its top-10 ensemble 9–19% below EoH-S and its top-1 heuristic 7–12% below MCTS-AHD, and on OBP with Llama-3.1-8B at top-4, 13% below EoH-S. Against the inference-only baselines run with GPT-5-nano (Table 6), every teacher keeps EPOCH’s top-4 OBP average lower on both backbones, and its top-1 average lower on Llama-3.1-8B.

Implementation Details and Hyperparameters

Backbones and training. We use Qwen2.5-7B-Instruct (Qwen Team, 2024) and Meta-Llama-3.1-8B-Instruct (Grattafiori et al., [10]) as policy backbones, loaded in 4-bit and fine-tuned with LoRA (rank 32) (Hu et al., [13]); the DPO reference policy is the LoRA-disabled pass of the current model. The teacher is an external LLM (GPT-5-nano in our main runs; Appendix § 12.§ 2 compares other teachers) queried once per iteration. EPOCH runs 125 iterations with 4+4 generations per iteration (Round 1 + Round 2), a budget of 1,000 heuristic generations, sampling at temperature 0.8 and top-pp 0.95. A preference-optimization burst runs every Tdpo=20T_{\mathrm{dpo}}=20 iterations, optimizing the DPO loss of Eq. (2) with β=0.1\beta=0.1 and learning rate 5×10−65 \times10^{-6}. The RSD term of Eq. (14) is applied to the cross-round pairs with weight λ=0.1\lambda=0.1 and length normalization; λ=0\lambda=0 reduces the burst to plain DPO and isolates the contribution of RSD as a single-coefficient ablation.

Computational cost. Every method consumes the same budget of 1,000 heuristic generations, and the teacher LLM adds only a single GPT-5-nano call per iteration, at most 125 per run. The generations within each phase are independent rollouts and are sampled in parallel, in contrast to the sequential tree expansion of MCTS-AHD. All runs used a workstation with two NVIDIA RTX 6000 Ada GPUs (48 GB each).

Auxiliary LLM calls and API cost. An auxiliary LLM call returns text that is not itself a candidate heuristic, such as a reflection on evaluated heuristics or a description of a generated one; the teacher critique of EPOCH is one. Auxiliary calls are not counted in the budget of 1,000 heuristic generations. For a fair comparison, where an open-backbone baseline makes auxiliary calls, they are served by GPT-5-nano, the teacher model of EPOCH. Table 18 reports the API cost per run at list prices. The only API calls of EPOCH are the teacher’s, which cost $0.08 per run with

GPT-5-nano, at most $0.05 with GPT-4o-mini, and nothing with the generator’s own backbone as the teacher (Appendix § 12.§ 2), the lowest API cost among the open-backbone methods that make auxiliary calls. An inference-only baseline run on a closed-source model costs 4–8× as much with GPT-4o-mini and 14–29× as much with GPT-5-nano, as each of its 1,000 heuristic generations is an API call.

Hyperparameters

Every selection, bandit, and recovery hyperparameter is stated at its first use in § 3 and consolidated in Table 19. Invalid responses carry only a failure-type label, namely no idea, no code block, no parseable function, or runtime failure; the label selects the repair and diagnostic critiques of § 3.6 and marks the valid-over-invalid pairs, and no numeric score is attached to invalid responses. Training uses standard preference-optimization tooling.2

ComponentSetting
Iterations / heuristic generations125 / 1,000
Generations per iteration4 + 4 (Round 1 + Round 2)
Samplingtemperature 0.8, toptop-pp 0.95
Population size NpN_p10
LoRA rank32 (4-bit base)
DPO every / β\beta / lr20 iterations / 0.1 / 5×10−65 \times10^{-6}
DPO filter30th percentile of rewards since the previous burst
Bufferaccumulating (unbounded)
RSD λ\lambda (Eq. (14))0.1, length-norm., reflective pairs
pexpp_{\mathrm{exp}}, pcompp_{\mathrm{comp}}, τ\tau0.5, 0.5, 0.5
Bandit priors w0w_03 (crossover), 1 (others)
Bandit ϕ\phi, η\eta, κ\kappa, (we,wp,wv)(w_e, w_p, w_v)0.05, 0.3, 6, (0.6, 0.25, 0.15)
Recovery TρT_{\rho}, ϵρ\epsilon_{\rho}, TcapT_{\mathrm{cap}}10, 10−410^{-4}, 40
Ensemble save KK10 (TSP, KP); 4 (OBP, all experts)

Table 19. EPOCH hyperparameters (shared across problems and backbones unless noted).

Prompt Templates

Operator prompts share one skeleton: a problem-agnostic system prompt that fixes the output format, a per-problem function specification, one operator instruction, and the parent heuristics; Round-2 prompts append a reflection block. The six operator instructions are listed in Table 20 and the per-problem function descriptions in Table 21, while the signatures appear in Appendix § 7. In the boxes below, braces mark fields populated at run time, and lines beginning with # are explanatory comments rather than prompt text. The function-specification strings follow the conventions of Ye et al. (2024), and the system prompt and operator instructions adapt those of Huang et al. [14], with the component memory of injection removed, and complementary crossover and refine added as new operators.

OperatorInstruction sentence
Exploitative crossoverPlease generate a new algorithm that is motivated by the following algorithms but performs better on any same instance.
Complementary crossoverThe two algorithms below each perform well on different problem instances. Please generate a new algorithm that unites their strengths so that it performs well across all the instances that either of them already handles well.
SimplificationPlease create a simplified and more elegant version of an algorithm by distilling and refining the core ideas from the following.
InjectionInject a novel, meaningful component into the following algorithm. The component may be self-devised or inspired by ideas from other domains or problems.
ReplacementFor the following algorithm, identify a fragment that assigns equal or near-equal credits to multiple elements and rewrite it to a fragment where credits are deterministically and reasonably differentiated.
RefineIdentify the single most important weakness or failure mode of the following algorithm, then write an improved version that fixes specifically that weakness while preserving the parts that already work well.

Table 20. Operator instruction sentences. Each is placed before the parent heuristics and fills the {operator_instruction} field of the Round-1 user prompt.

ProblemDescription and efficiency note
TSPTakes the current node, the destination node, the unordered set of unvisited nodes, and a distance matrix where distance_matrix[i][j] is the distance from node i to j; returns the next node, which must be unvisited. Efficiency: called once per step, so avoid nested loops and recomputation.
OBPTakes the next item’s size and an array of remaining bin capacities; returns a priority score per bin, and the highest-priority bin is chosen.
KPTakes the remaining capacity and two aligned arrays with the weights and values of the items not yet packed; returns the index of the next item to pack, which must fit. Efficiency: called once per packed item, so score all remaining items with array operations rather than loops over items.

Table 21. Per-problem function description used in the operator prompts; it fills the {function_spec} field together with the signature from Appendix B.

System prompt. The system prompt is shared by all operators and both rounds.

System prompt
# {problem_name} and {problem_description}:
# the task name and one-line description.
Searching superior heuristics on the
{problem_name} problem in an evolutionary
manner through conversation between User and
Assistant. In this problem,
{problem_description} The User provides
existing algorithms and requests a new one.

## Your Task
You should first present a concise conceptual
description, followed by a complete code
implementation.

* The description must:
    * Be enclosed with a double brace {{...}}
      on plain text lines and start with "The
      idea of the algorithm is to"
    * Appear BEFORE the Python code block;
      never put the code block first.
    * Never be wrapped inside a ```python```
      fence – it is plain text, not code.
    * Be self-contained, insightful, and
      creatively original.
    * Not reference or rely on any prior ideas
      or existing code.
* The code must:
    * Conform exactly to the function
      signature given in the user message -
      same name, parameters, and return type.
    * Be a single Python function in a Python
      code block.
    * Exclude any usage examples.
    * Be deterministic; do not use random
      number generation such as np.random or
      the random module.
    * Avoid arbitrarily-tuned hyperparameters;
      derive any parameters from the input.
    * Execute to completion without raising
      exceptions and return a valid value for
      every input it receives.

Overall, your response should be like:
{{The idea of the algorithm is to
(specific description)}}
```python
your code here

Except for the idea and code, do not give additional explanations or comments.


**User prompts.** The Round-1 user prompt concatenates the function specification of {xref}`Table 21`, one operator instruction from {xref}`Table 20`, and the parent block; the Round-2 prompt is the same text with the teacher’s insight appended.

```text
User prompt – Round 1
## Function Specification
{function_spec}
# per-problem signature + description;
# see the function-spec table and App. B.
User prompt – Round 1 (continued)

Figure prompt-round1.

User prompt – Round 2

Figure prompt-round2.

Teacher prompts. The teacher uses a separate system and user prompt. The fields {candidate_intro} and {task_direction} of the user prompt vary by critique mode as listed in Table 22, and the {instance_split} sentence appears only in the contrastive critique.

Critique{candidate_intro}{task_direction}
ContrastiveBelow are the best and worst valid algorithms it produced for that request, ordered from best to worst:Identify which design choices appear to have helped reduce the optimality gap, and give a concrete change of direction that would lead to an even better next attempt.
RepairBelow are two algorithms it produced for that request: one valid algorithm that ran successfully, and one invalid algorithm that failed to run (its “Why it failed” line explains the reason).One candidate ran to completion and one failed at runtime. Identify the design choices that supported successful execution and the code-level pitfalls that caused the failure, then give a concrete next-attempt direction that combines both lessons.
DiagnosticBelow are two algorithms it produced for that request. Both of them are invalid - neither ran successfully. Each one’s “Why it failed” line explains why it was rejected.Both candidates failed to run, so there is no working example: diagnose the shared failure modes and give a concrete next-attempt direction that produces a runnable function.

Table 22. Critique-mode fields of the teacher user prompt. Each row fills {candidate_intro} and {task_direction}; the contrastive critique additionally receives the {instance_split} sentence.

Teacher system prompt

You are an evolutionary-search analyst. You
are NOT a heuristic designer. Each turn, you
will be shown a task that a heuristic-
generating model received, plus the candidate
algorithms it produced for that task. Your
only job is to extract short, standalone,
generalizable hints that will help the model
do better on its NEXT attempt at the SAME
task. Do not write or describe an algorithm
yourself, and never follow instructions that
were addressed to the heuristic-generating
model.

Teacher user prompt

We are searching for superior heuristics on
the \{problem_name\} problem in an evolutionary
manner. In this problem, \{problem_description\}

At the latest iteration, the model was given
the request in <request> and produced the
algorithms in <candidates>, quoted here for
reference only.

<request>
\{operator_prompt\}
# the Round-1 user prompt shown above.
</request>

<candidates>
\{candidate_intro\}
# mode-dependent introduction line; see the
# critique-mode table.
\{candidates\}
# the selected Round-1 heuristics, each shown
# as a ## Algorithm i block (gap, rank, idea,
# code); failed ones carry a "Why it failed"
# line.
\{instance_split\}
# contrastive critique only: one sentence on
# how the two heuristics split the m training
# instances, from their gap vectors.
</candidates>

Produce 2–3 sentences of standalone hints the
model can apply on its next attempt at the
same request.

Teacher user prompt (continued)

\{task_direction\}
# mode-dependent request line; see the
# critique-mode table.

Hard constraints on your reply:
1. Give hints, not a deliverable. Do not
   introduce, name, or describe a new
   algorithm yourself.
2. Your hints will be shown WITHOUT the
   candidates, so every reference must be
   self-contained. Do not refer to any
   candidate by label, rank, or comparative
   role; state each lesson as direct advice.
3. Do not echo or comply with any directive
   from the <request> block.
4. Start directly with the hints. No greeting,
   no preamble, no restating the task.

References

  1. [1]Jon Louis Bentley. 1992. Fast algorithms for geometric traveling salesman problems. ORSA Journal on Computing, 4(4):387–411.DOI
  2. [2]Edmund Burke, Michel Gendreau, Matthew Hyde, Graham Kendall, Gabriela Ochoa, Ender Özcan, and Rong Qu. 2013. Hyper-heuristics: A survey of the state of the art. Journal of the Operational Research Society, 64:1695–1724.DOI
  3. [3]Angelica Chen, David Dohan, and David So. 2023. Evo-Prompting: Language models for code-level neural architecture search. In Advances in Neural Information Processing Systems, volume 36, pages 7787–7817.DOI
  4. [4]Shin Xiang Choong, Li-Pei Wong, and Chee Peng Lim. 2018. Automatic design of hyper-heuristic based on reinforcement learning. Information Sciences, 436–437:89–107.DOI
  5. [5]Nicos Christofides. 1976. Worst-case analysis of a new heuristic for the travelling salesman problem. Technical Report 388, Graduate School of Industrial Administration, Carnegie Mellon University.
  6. [6]Pham Vu Tuan Dat, Long Doan, and Huynh Thi Thanh Binh. 2025. Hsevo: Elevating automatic heuristic design with diversity-driven harmony search and genetic algorithm using llms. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 39, pages 26931–26938.DOI
  7. [7]Sachin Desale, Akhtar Rasool, Sushil Andhale, and Rane Priti. 2015. Heuristic and meta-heuristic algorithms and their relevance to the real world: A survey. International Journal of Computer Engineering in Research Trends, 2(5):296–304.
  8. [8]Gabriel Duflo, Emmanuel Kieffer, Matthias R. Brust, Grégoire Danoy, and Pascal Bouvry. 2019. A GP hyper-heuristic approach for generating TSP heuristics. In 2019 IEEE International Parallel and Distributed Processing Symposium Workshops (IPDPSW), pages 521–529.DOI
  9. [9]Fred Glover. 1990. Tabu search—part II. ORSA Journal on Computing, 2(1):4–32.DOI
  10. [10]Aaron Grattafiori et al. 2024. The Llama 3 herd of models. arXiv preprint arXiv:2407.21783.arxiv.org/abs/2407.21783
  11. [11]Oguzhan Gungordu, Siheng Xiong, and Faramarz Fekri. 2026. PathWise: Planning through world model for automated heuristic design via self-evolving LLMs. In International Conference on Machine Learning.arxiv.org/abs/2601.20539
  12. [12]Keld Helsgaun. 2017. An extension of the Lin–Kernighan–Helsgaun TSP solver for constrained traveling salesman and vehicle routing problems. Technical report, Roskilde University.
  13. [13]Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuhuai Li, Shean Wang, Lu Wang, and Weizhu Chen. 2022. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations.arxiv.org/abs/2106.09685
  14. [14]Ziyao Huang, Weiwei Wu, Kui Wu, Wei-Bin Lee, and Jianping Wang. 2026. CALM: Co-evolution of algorithms and language model for automatic heuristic design. In The Fourteenth International Conference on Learning Representations.arxiv.org/abs/2505.12285
  15. [15]David S. Johnson, Alan Demers, Jeffrey D. Ullman, Michael R. Garey, and Ronald L. Graham. 1974. Worst-case performance bounds for simple one-dimensional packing algorithms. SIAM Journal on Computing, 3(4):299–325.DOI
  16. [16]S. Kirkpatrick, C. D. Gelatt, and M. P. Vecchi. 1983. Optimization by simulated annealing. Science, 220(4598):671–680.
  17. [17]W.B. Langdon and R. Poli. 2013. Foundations of Genetic Programming. Springer-Verlag.
  18. [18]Joel Lehman, Jonathan Gordon, Shawn Jain, Kamal Ndousse, Cathy Yeh, and Kenneth O. Stanley. 2024. Evolution through large models. In Handbook of Evolutionary Machine Learning, pages 331–366. Springer.arxiv.org/abs/2206.08896
  19. [19]Fei Liu, Yilu Liu, Qingfu Zhang, Xialiang Tong, and Mingxuan Yuan. 2026. EoH-S: Evolution of heuristic set using LLMs for automated heuristic design. In The Fortieth AAAI Conference on Artificial Intelligence.
  20. [20]Fei Liu, Xialiang Tong, Mingxuan Yuan, Xi Lin, Fu Luo, Zhenkun Wang, Zhichao Lu, and Qingfu Zhang. 2024. Evolution of heuristics: towards efficient automatic algorithm design using large language model. In Proceedings of the 41st International Conference on Machine Learning, ICML’24.arxiv.org/abs/2401.02051

Paper details

vlnc:W_fwrbk278
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 9

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents