arXiv:2611.00504cs.AIOct 2026

Manuscript Offprint

arXiv:2611.00504

Robustness Starts with the Objective: Designing and Certifying Robust LLM-Generated Heuristics

Pantea Karimi, Roozbeh Bostandoost, Dany Rouhana, Siva Kesava Reddy Kakarla, Pooria Namyar, Mohammad Alizadeh, Venkat Arun, Behnaz Arzani

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

LLMs are increasingly used to design heuristics for computer systems. However, most synthesis frameworks evaluate candidates by their average performance, which can mask severe regressions on specific workloads. Even adding adversarial training inputs doesn't eliminate these regressions, and percentile objectives (e.g., optimizing for the 95th percentile) overlook how severe regressions can be beyond the selected threshold.

We present TAILOR, a framework that guides LLM synthesis using the Conditional Value at Risk (CVaR) of the cost difference between each candidate and an existing baseline on the same workload. This paired CVaR measures the average difference over the worst fraction of workloads. We show that a negative paired CVaR guarantees improvements in both average performance and tail optimality gaps relative to the unknown optimum, without ever computing that optimum.

We find that TAILOR achieves the best mean–tail trade-off among the synthesis objectives we evaluate across three case studies: Azure GPU batch admission, Azure VM packing, and server placement. Tested across seven diverse optimization benchmarks, TAILOR produces heuristics that are certified with 99% confidence to improve both average performance and tail optimality gaps over the baseline in six of them. On these six benchmarks, TAILOR also outperforms known robust, human-designed alternatives in the tail while achieving better or comparable average-performance improvement over the baseline.

1 INTRODUCTION

Computer systems rely on heuristics to allocate resources, pack workloads, schedule jobs, and route traffic [73, 57, 25, 29]. These heuristics aim to minimize cost or maximize utility when computing an exact optimal solution (OPT) is computationally intractable or requires knowledge of future inputs. Designing effective heuristics requires substantial human expertise to exploit problem structure while maintaining reliable performance across diverse workload regimes.

LLMs have opened new opportunities to automate heuristic design. Recent frameworks use different search harnesses, including evolutionary search, orchestrated agents, and iterative refinement, to generate candidate programs, evaluate them on test inputs, and use the resulting scores to guide the search [46, 36, 38, 28, 72, 65].

Despite differences in search architecture, most LLM-based heuristic design frameworks optimize for average performance and give limited attention to robustness. FunSearch [72] and EoH [48] score candidates by their mean performance on a fixed training set, while EoH-S [50] evolves a portfolio of heuristics over a predefined set of diverse instances. Even

recent methods that target robustness do not directly optimize tail or worst-case performance during search. RAISE [49] adds adversarially discovered hard instances to its evaluation set, but still ranks candidates by their mean score over that set, arguing that scoring based on the worst lets single outlier instances dominate and destabilize the search [49]. But in production, good average performance can hide severe regressions on specific workloads. For example, MetaOpt [64] identified a traffic pattern on which a production heuristic in Microsoft's WAN served 40% less demand than the optimal solution.

In this paper, we seek to automate the design of robust heuristic improvement: improving tail performance without sacrificing average performance. Let I∼DI \sim \mathcal{D} denote a workload drawn from a target distribution D\mathcal{D}, HH an existing baseline heuristic, and H′H' a replacement generated by an LLM. We write H(I)H(I) and H′(I)H'(I) for their performance on the same workload, expressed as costs to minimize (maximization problems are handled by negating rewards). For example, in GPU Batch Admission (2),requestsarrivesequentiallyandcompeteforlimitedbatchcapacity.Here,2), requests arrive sequentially and compete for limited batch capacity. Here, Iisastreamofrequests,is a stream of requests,Hcouldbefirst−come,first−served(FCFS),andcould be first-come, first-served (FCFS), andH'acandidateLLM−generatedpolicy.Theirperformance,a candidate LLM-generated policy. Their performance,H(I)andandH'(I),isthenegativeofthetotalvalueadmittedonthatstream.OPT(, is the negative of the total value admitted on that stream. OPT(I)denotesthebestpossiblecosthadallfuturerequestsbeenknowninadvance.Theoptimalitygap,) denotes the best possible cost had all future requests been known in advance. The optimality gap, H(I) - \text{OPT}(I)$, measures how much

¹MIT²University of Massachusetts Amherst³Microsoft⁴The University of Texas at Austin.

Figure

Figure 1: Goal: improve tail optimality gaps while preserving average performance. Distributions of optimality gaps HH – OPT and H′H' – OPT for GPU batch admission (§2), where HH and H′H' denote the baseline and candidate performance, expressed as costs to minimize. The shaded regions are the worst 5% of each distribution, starting at its 95th-percentile cutoff. H′H' reduces the tail optimality gap by 14% while preserving average performance.

value the baseline leaves on the table. A heuristic may perform well on average while suffering large optimality gaps on a fraction of workloads. Our goal is to find a replacement H′H' via LLMs that reduces the tail of these optimality gaps while preserving or improving average performance over D\mathcal{D} (Fig. 1).

To control tail regressions, we would ideally optimize the tail of the candidate's optimality gaps directly (Fig. 1). However, the challenge is that computing OPT across large-scale workloads is impractical. Existing tools such as MetaOpt [64] and MetaEase [37] identify worst-case failures relative to OPT, but require formal models or expensive OPT evaluations, taking minutes to hours even on small instances (§C.1). Other tools have similar problems [5, 2, 7, 4, 74, 35, 23]. This makes them impractical for iterative LLM synthesis, which must evaluate thousands of candidate heuristics. A simpler alternative, optimizing the tail of H′H' directly (e.g., its 95th-percentile cost), is also insufficient (§2). A high cost may reflect an inherently difficult workload rather than poor heuristic performance, as even an optimal solution may incur a high cost. We therefore need a scalable objective that measures tail performance relative to the baseline without computing OPT.

The second challenge is the tension between average performance and tail robustness, which arises in many problems [82]. In GPU Batch Admission, optimizing average performance leads LLMs to discover heuristics that achieve large average improvements while incurring severe regressions on some workloads. We need an objective that accounts for how often regressions occur and how severe, without sacrificing average performance.

Our approach: Optimizing the tail of paired differences. We introduce TAILOR, a framework for synthesizing robust heuris-

tic improvements with LLMs. Rather than computing OPT, we evaluate the candidate and baseline on the same workload and compute their paired difference, Δ(I)=H′(I)−H(I)\Delta(I) = H'(I) - H(I). This directly measures the impact of replacing the baseline and requires only running the two heuristics, making it practical feedback for iterative LLM search.

Even with paired differences, simple tail metrics provide poor feedback for LLM search. Optimizing a fixed percentile (e.g., the 95th percentile of Δ\Delta) ignores how severe regressions get beyond the cutoff, while using the single worst-case difference lets isolated outliers dominate heuristic selection (§5.2). We instead minimize the Conditional Value-at-Risk (CVaR) of paired differences [70, 71]. At β=0.95\beta=0.95, CVaRβ(Δ)CVaR_{\beta}(\Delta) averages the worst 5% of candidate–baseline differences, capturing both how often regressions occur and how severe they are.

Certifying tail improvements without OPT. We show a negative population CVaRβ(Δ)CVaR_{\beta}(\Delta) guarantees that replacing the baseline HH with H′H' reduces the average optimality gap in the worst 1−β1-\beta tail of the workload distribution. This guarantees an improvement relative to OPT without ever computing OPT, using only the observable performance differences between the two heuristics (§3).

Guaranteeing average improvement. CVaR has a second useful property: the average of the worst performance differences is always at least as large as their overall average. Therefore, if even the worst-tail average difference is negative, the overall average difference must also be negative. A negative paired CVaR therefore guarantees average improvement, without explicitly optimizing for the mean or imposing a separate constraint.

This guarantee holds for the full distribution, but in practice we can only evaluate a candidate on a finite sample. To account for sampling uncertainty, TAILOR evaluates the final heuristic on independent validation workloads and computes a statistical upper confidence bound on its paired CVaR [56]. If this bound is negative, we certify with 99% confidence that the heuristic improves both tail optimality gaps and average performance over the target distribution. We also introduce a simple check to detect when it is unlikely that we would be able to certify an improvement before synthesis. This enables us to avoid the expensive LLM-based synthesis when the requested certification target is unattainable (§3).

We evaluate TAILOR across three case studies on realistic workloads: Azure GPU Batch Admission [75, 61], Azure VM Packing [60, 27], and Server Placement [68]. Holding the LLM and synthesis architecture fixed, we compare different synthesis objectives, measuring each heuristic's average improvement and its performance relative to the baseline on the worst 5% of paired differences.

TAILOR improves tail performance over mean-optimized heuristics. On GPU Batch Admission, mean-optimized heuristics underperform the FCFS baseline on 7.5% of streams, with an average regression of 9.2% over the worst 5% of streams. Adding adversarial inputs does not eliminate regressions: RAISE [49] still regresses the baseline on 7.4% of streams. TAILOR regresses on fewer than 0.01% of streams (§2). On Server Placement, TAILOR turns an average regression over the worst 5% of inputs into an improvement. On VM Packing, it delivers a 25% larger average improvement over the worst 5% of inputs than mean-optimized heuristics (§4).

TAILOR improves tail performance more than percentile-based optimization. Across all three case studies, TAILOR delivers 46–62% larger average improvements over the baseline on the worst 5% of inputs than heuristics synthesized by optimizing the 95th percentile of paired differences (§2,§4).

TAILOR certifies its tail improvements. Across the three case studies and four additional synthesis benchmarks, TAILOR certifies improvements in tail optimality gaps in 24 of 35 independent synthesis runs at 99% confidence, with successful certification on six of the seven benchmarks (§5.1).

TAILOR outperforms robust human-designed heuristics in the tail. Across six benchmarks with known robust human-designed heuristics, the best TAILOR-generated heuristics achieve a better worst-5% average relative to the same baseline. On Traffic Engineering and VM Packing, human-designed heuristics regress on average in their worst 5% of outcomes, while TAILOR-generated heuristics still improve over the baseline (§5.3).

TAILOR also improves average performance. Across all cases, TAILOR achieves better average performance over the baseline heuristic. Also on VM Packing and Server Placement, TAILOR beats mean-optimized heuristics and achieves 14% and 66% larger average improvements.

References (76)