When a large language model (LLM) is used to invent heuristics for hard combinatorial problems like routing or packing, the usual loop is simple. The model writes a candidate function, the system runs it on test instances, and good candidates survive into the next round. This loop has a known flaw. Each structural idea is judged once, alone, with whatever numerical constants the model happened to write, so sound ideas are thrown away because their numbers were bad. We propose a different loop, borrowed from hybrid discrete-continuous optimization. The LLM proposes a small library of alternative code components that share an interface. The system combines them into one "soft" program whose output is a weighted mixture of the components' outputs. It then tunes the mixture weights and each component's constants jointly, and gradually forces the weights toward a single winner, a method called dense-to-sparse annealing. Only then does the LLM act discretely again: it merges and rewrites the survivors into one clean program. A single tuning run thus credits many structural choices at once, and each is ranked at its tuned quality rather than its raw quality.
In two sentences: instead of asking "is this edit better?" one edit at a time, we ask "given all the edits the model proposed, which ones earn weight once their constants are fitted together?", and we answer with continuous optimization over the choice itself. The LLM keeps the job it is good at, writing and merging code, and hands off the job it is bad at, which is choosing numbers and judging noisy comparisons.
Core Claim
At equal budgets of heuristic evaluations and LLM tokens, alternating between (a) continuous joint tuning of a softly mixed library of LLM-written components and (b) discrete LLM consolidation of the surviving components should reach lower optimality gaps than both per-candidate constant tuning and plain LLM evolution. The advantage should be largest where interactions between components matter and where per-candidate evaluation is expensive, which is at larger instance scales.
The closest prior work is TIDE. TIDE diagnoses "numerical blindness" in LLM heuristic design and fixes it by running a gradient-free differential-evolution tuner on the constants inside each candidate program, nested within an island-model evolutionary outer loop. TIDE motivates this proposal and is its main competitor. It still treats structure as discrete and evaluated one program at a time. Every candidate needs its own inner tuning run, and two structural alternatives are never optimized jointly. We relax the structural choice itself into continuous weights. dPads supplies the idea of relaxing a program's structural choices into a softmax and optimizing them alongside parameters, and it reports that this beat A* discrete search in time (174 vs 553 minutes on Basketball). However, dPads needs a typed, fully differentiable DSL and suffers from gradient bias toward shallow paths. Our components are arbitrary Python written by an LLM, and we relax only at the interface where their outputs are scalars that can be mixed. ADC supplies the annealing schedule. It relaxes discrete tokens into continuous vectors, raises sparsity as loss falls, and finishes with discrete coordinate refinement. ADC also names the risk we inherit: a good continuous mixture may have no good discrete counterpart. The alternation between a continuous phase and discrete swaps follows AC⊕DC. On FlyWire, a Frank-Wolfe relaxation climbed from about 5154K to over 5845K, and discrete swaps then added the last gains to over 5850K. We copy that division of labor: the continuous phase finds the basin, and the discrete phase cleans up.
Research Program
The method applies to heuristic-design settings where the unit being evolved is a function with a scalar output. Examples are the priority score used by a constructive TSP or CVRP heuristic, the item score in bin packing, and the heuristic matrix in ant colony optimization. In each round, the LLM writes $K$ components $f_1,\dots,f_K$. Each component carries its own exposed constants, which are extracted automatically from numeric literals in the code as in TIDE. The soft program scores a decision $x$ as
$$s(x) = \sum_{k=1}^{K} \mathrm{softmax}(\alpha/\tau)_k \, \hat f_k(x; c_k),$$
where $\alpha$ are the structural logits, $\tau$ is a temperature, $c_k$ are component $k$'s constants, and $\hat f_k$ is $f_k$ standardized per instance so that its scale cannot buy it weight. The cost being minimized is not differentiable in $\alpha$ or $c$. We therefore optimize $(\alpha, c)$ with a gradient-free evolution strategy, and we lower $\tau$ once the mean cost across instances stops improving. This is ADC's rule of raising sparsity as loss falls. Annealing stops when one or two components hold nearly all the weight.
The discrete phase then passes the LLM three things: the surviving components with their tuned constants, the final weights, and short execution summaries. The LLM is asked to write one consolidated function. That function is tested on its own, without the mixture. If it is worse than the annealed mixture by more than measurement noise, the system rolls back and keeps the best pure survivor, following the revert-on-regression idea in Fang et al.. The consolidated function becomes the seed for the next library. We accept candidates using a relaxed, correctness-first rule rather than strict improvement over the previous best, because ICER showed that strict monotone acceptance overfits noisy measurements.
The analysis centers on one question: does evaluating structure in superposition find ideas that one-at-a-time evaluation discards? We log every component the LLM ever writes. We record whether that component would have been discarded under EoH-style standalone raw evaluation, and whether it gained substantial weight in the mixture. We then measure how often such "rescued" components end up in the final heuristic.
Baselines
The naive reference point is the LLM heuristic-evolution loop with raw constants, EoH as reported in TIDE. It is re-run with our LLM, our instance sets, and the same total count of heuristic-instance evaluations. On TSP50, TIDE reports a 12.11% gap for EoH.
The strongest existing method on this exact question is TIDE. It reports a 4.76% optimality gap on TSP50, a 0.02% gap on Knapsack, and about 33% fewer input tokens than ReEvo on TSP-ACO. We will run TIDE's released configuration if one is available, and otherwise a faithful reimplementation. Its budget will be matched to ours on three axes: the same LLM, the same total evaluations (TIDE's inner-loop tuning evaluations count against its budget, just as our mixture-tuning evaluations count against ours), and the same token cap. Tuning effort for both methods' own hyperparameters will be capped equally. Beating TIDE means a lower mean gap across seeds at matched evaluations, with confidence intervals that do not overlap, on at least TSP and CVRP. A tie on small instances together with a gain on larger ones would still support the claim about scale.
On larger instances we compare against A₂DEPT. It reports a 9.8% reduction in mean normalized optimality gap relative to ReEvo and MCTS-AHD on FrontierCO's MIS, CVRP, CFLP, and FJSP. A₂DEPT evolves whole programs rather than scoring functions, so this comparison is only meaningful on the problems where both methods produce constructive heuristics. We report it as context, not as a head-to-head win condition.
Three ablations isolate the key ingredient. The dense-mixture ablation never anneals and deploys the tuned mixture as a portfolio. The no-consolidation ablation takes the top annealed survivor directly, with no LLM merge. The constants-only ablation sets $K=1$, which collapses the method to TIDE-like per-candidate tuning under our tuner. Comparing the full method with the constants-only ablation isolates the value of relaxing structure itself, separately from any difference between our tuner and TIDE's.
Why not just…?
Why not just tune each candidate's constants separately, as TIDE does? This is the real threat, and the constants-only ablation exists to test it. Our argument is about cost and interactions. Per-candidate tuning pays a full inner optimization for every structural idea, and it never discovers that two partial ideas are good together. If the constants-only ablation matches the full method at equal evaluations, the superposition idea is not worth its complexity. We will report that result plainly.
Why not just generate more candidates and pick the best (best-of-K, or larger EoH/ReEvo populations)? Scaling discrete sampling runs into the plateau reported by Yan et al., and into TIDE's observation that good structures get discarded because of their constants. The naive baseline, given our full budget, tests this directly. The rescued-component statistic shows the mechanism: if few rescued components appear in final heuristics, larger populations would have been enough.
Why not just keep the dense mixture as an algorithm portfolio and skip annealing and consolidation? A mixture of $K$ scoring functions costs $K$ times as much per decision, and it is harder to read. The dense-mixture ablation will show whether sparsification loses quality. Following ADC, we expect a projection gap, meaning the pure winner may be weaker than the mixture. If that gap is large, the right conclusion is that the deliverable should be a small portfolio, and we would change the output format accordingly.
Why not just ask the LLM to reason about which components to combine? Evidence from ICER is that making models reason explicitly about efficiency (predicting Big-O) degraded optimization. More generally, LLMs are poor at judging noisy numerical comparisons. We test this with an LLM-selects-subset variant at matched tokens.
Proposed Experiments
The first stage replicates TIDE's settings: TSP50, CVRP, bin packing, Knapsack, and Mountain Car. It reports optimality gap, total heuristic evaluations, and input and output tokens, over five or more seeds. The second stage moves to the FrontierCO Easy and Hard splits of FrontierCO for TSP, CVRP, and MIS. FrontierCO shows how learned methods break down with scale: LEHD's TSP gap grows from 0.72% on a standard set to 10% on Easy and 77% on Hard. Evaluation cost per candidate rises steeply at these sizes, which is where superposition should matter most. The question is whether our method's gain over TIDE grows with instance scale.
The decisive checks are three. First, the full method must beat the constants-only ablation at equal evaluations. Second, the gap between the consolidated program and the annealed mixture must stay within measurement noise, or else we must show that rollback contains the damage. Third, the rescued-component rate must be substantial and must predict final quality. If all three hold, relaxing structural choice is a useful new tool for LLM heuristic design. If the first fails, the lesson is that constant tuning, which TIDE already does, was the whole story.
References
- TIDE: Tuning-Integrated Dynamic Evolution for LLM-Based Automated Heuristic Design
- Differentiable Synthesis of Program Architectures
- Efficient LLM Jailbreak via Adaptive Dense-to-sparse Constrained Optimization
- AC$\oplus$DC search: behind the winning solution to the FlyWire graph-matching challenge
- MEIC: Re-thinking RTL Debug Automation using LLMs
- Improving Code Efficiency with Iterative Refinement using LLMs
- $A_2$DEPT: Large Language Model–Driven Automated Algorithm Design via Evolutionary Program Trees
- CodeTransOcean: A Comprehensive Multilingual Benchmark for Code Translation
- FrontierCO: Real-World and Large-Scale Evaluation of Machine Learning Solvers for Combinatorial Optimization