Evolving Prompt Portfolios Whose Errors Cancel Under Perturbation

Large language models change their answers when a question is reworded in ways that should not matter: the multiple-choice options are shuffled, the option letters are replaced with other symbols, or a polite phrase is added. Automatic prompt optimizers make this worse. They search for one instruction that scores well on a clean validation set, and the instruction they find is often a narrow peak that falls apart under such changes. Our proposal starts from an observation that the current optimizers throw away. A genetic algorithm, which improves a whole population of candidate solutions by selecting, recombining and mutating them, ends with many good prompts. Separately, different prompts with the same average accuracy tend to fail on different questions. If those failures are spread out enough, a small committee of prompts that votes on each answer should be much more stable than any single prompt.

The claim is specific. If the genetic algorithm rewards each prompt for its marginal contribution to the committee's accuracy under perturbation, and not for its own accuracy, it will find a portfolio of $k$ prompts whose majority vote is more accurate and less brittle on held-out perturbation types than two alternatives at the same inference cost: $k$ random rewordings of the best single prompt, and the single most robust prompt found by worst-case evolutionary search. The genetic algorithm is the core mechanism here. Prompt sensitivity supplies both the objective and the evaluation setting.

What Exists and What Is Missing

Three lines of work run evolutionary or iterative search over prompts, and all three return one prompt. EvoPrompt uses an LLM as the crossover and mutation operator inside genetic and differential-evolution loops and maximizes clean development accuracy. It reports gains of up to 25% over chain-of-thought prompting on BIG-Bench Hard. It keeps only the top individual. TARE adds a min-max loop: an inner search finds the worst-performing paraphrase of each candidate, and an outer evolutionary loop minimizes that worst case. Its adaptive variant perturbs style more aggressively than hard constraints. TARE still outputs a single paraphrase-invariant prompt, and it perturbs the instruction, not how each question is presented. Robustness-aware Automatic Prompt Optimization rewrites one prompt along a single path to defend against noisy user inputs such as typos and slang. It also shows that EvoPrompt's prompts can fall below manual instructions under noise. That result motivates our work: optimizing for point accuracy produces brittle prompts. A fourth paper, the GA for secure code generation, constrains our design. Its evolved prompts transferred poorly across model families, so we evaluate transfer explicitly and do not assume it.

The diagnostic literature supplies the premise and the metrics. ProSA shows that sensitivity is an instance-level effect: two prompts with equal aggregate scores can succeed and fail on disjoint sets of questions. It also ties flipping to flat output distributions and introduces the PromptSensiScore. Brittlebench splits score variance into a data-difficulty part and a brittleness part. It finds that perturbations account for up to half of the variance in open-weight models and that a single perturbation changes model rankings in 63% of cases. When Benchmarks are Targets documents option-order and symbol effects, including a 24.5% accuracy gain for Llama2-7b when the correct answer is moved to position A. SENSEL uses disagreement across perturbed prompts at inference time to decide when to abstain. It does not optimize the prompts that disagree. None of these works optimizes a set of prompts for complementary errors. That is the gap we target.

Core Mechanism

For a prompt $p$, a validation question $x$ and a presentation perturbation $\pi$, let $c(p,x,\pi)\in\{0,1\}$ record whether the model answers correctly. The perturbations include option shuffles, symbol relabeling, whitespace and politeness padding, and wording changes in the question stem. A portfolio $S$ of $k$ prompts answers by majority vote, and its robust accuracy $R(S)$ is the vote's accuracy averaged over questions and over the perturbations used in training. Each generation, we form the current portfolio $S^\*$ greedily from the population. Every individual is then scored by

$$ F(p) = (1-\lambda)\,\bar c(p) + \lambda\,\big[R(S^\* \cup \{p\} \setminus \{w(p)\}) - R(S^\*)\big], $$

where $\bar c(p)$ is the prompt's own mean accuracy across perturbations. The bracket is the gain in committee accuracy from swapping $p$ in for the member $w(p)$ it would best replace. $\lambda\in[0,1]$ trades individual strength against complementarity. This rule resembles fitness sharing in evolutionary computation. It works against the diversity collapse that the research file lists as a known weakness of genetic algorithms, because a copy of an existing member adds nothing to the committee and earns no bonus.

We keep EvoPrompt's LLM-based crossover and mutation unchanged, since that is the established fix for random token mutations breaking grammar. The new element is a change to the mutation instruction. The operator is shown the questions and perturbations on which the current committee's vote fails, and it is asked to write a variant that would answer those questions correctly.

The fitness function needs only the full matrix of $c$ values for each prompt. That matrix is computed once per individual and cached, so scoring a candidate portfolio costs only voting arithmetic. Most of the expense comes from the LLM calls that fill each prompt's matrix of $c$ values over questions and perturbations.

Research Program

The work has three parts. First, we measure the premise before building anything. For an EvoPrompt final population on each task, we compute pairwise error correlations across questions and perturbations. We compare them with the correlations among random paraphrases of the best prompt, which tells us whether evolved prompts are naturally more complementary.

Second, we build the portfolio optimizer described above. We sweep $\lambda$ and $k\in\{1,3,5\}$.

Third, we analyze where the gains come from. Using the Brittlebench decomposition, we ask whether the portfolio lowers the brittleness share of variance or only raises mean accuracy. Using ProSA's confidence finding, we check whether committee members disagree mainly on questions where each member's output distribution is flat. If they do, that supports the explanation that voting averages away noise near the decision boundary.

The most important design choice is the split of perturbation families. The perturbations used to compute fitness are disjoint from those used for evaluation. For example, training might use option shuffles and padding, while evaluation uses symbol relabeling and paraphrased question stems. This prevents a result in which the method simply memorizes the perturbation set. It also guards against the "noise benefit" effect reported in Robustness-aware Automatic Prompt Optimization, where injected noise sometimes raises accuracy for reasons unrelated to real robustness.

Baselines

The naive reference point is a single hand-written prompt with chain-of-thought, evaluated under the same held-out perturbations. Brittlebench reports that chain-of-thought reduces the accuracy drop under perturbation by only about 17%, so we expect a large gap that any serious method must close.

The first optimized baseline is EvoPrompt in its genetic-algorithm mode, run with our population size, number of generations and operator LLM, outputting its best single prompt. EvoPrompt's reported figure is a gain of up to 25% over chain-of-thought on BIG-Bench Hard. The file gives no per-task numbers for the tasks we use, so we rerun it.

The strongest single-prompt competitor is ATARE from TARE. The file reports 91.0% accuracy on Object Counting with GPT-3.5, against 88.0% for TextGrad. We rerun ATARE on our tasks with the same total budget of model calls during optimization. We also give it our presentation perturbations as its neighborhood, so the comparison does not depend on perturbation type.

The baseline that most directly threatens our claim is cost-matched voting without evolution. It takes the best EvoPrompt or ATARE prompt and votes over $k$ inputs, either $k$ random paraphrases of the prompt or $k$ random option permutations of the question. This is the SENSEL idea of querying under multiple perturbations, used for voting instead of abstaining. SENSEL reports a +4.1 point gain in area under the F1-coverage curve on GPT-J-6B for its abstention use, but the file has no number for voting accuracy.

On open-weight models we also run the hybrid scoring of When Benchmarks are Targets, which combines the probability of the option symbol with the probability of the option text. No reported result was found on Lacuna for its accuracy under held-out perturbations.

Two ablations isolate the key ingredient. Setting $\lambda=0$ gives a portfolio made of the top-$k$ individuals of an accuracy-only run. Setting $\lambda=0$ while keeping the failure-targeted mutation prompt separates the effect of the operator from the effect of the fitness function.

We count the method as winning only if the $\lambda>0$ portfolio beats cost-matched voting and ATARE at the same $k$, in held-out robust accuracy and in Brittleness Score, with confidence intervals from bootstrapping over questions. A gain over EvoPrompt alone does not count.

Why not just…?

Why not just vote over random rewordings of one good prompt? This is the real threat. Averaging over option permutations directly cancels position bias, the 24.5% effect documented in When Benchmarks are Targets. For purely positional brittleness it may be all that is needed. Our claim depends on errors from evolved, complementarity-selected prompts being less correlated than errors from random rewordings. ProSA's finding that equally accurate prompts fail on disjoint question sets makes this plausible but not certain. The premise measurement in the first part of the research program tests this directly, before the optimizer is built. If random rewordings match the portfolio on held-out perturbations, we will report that the evolutionary component is unnecessary and redirect the work toward cost reduction.

Why not just use one robust prompt from TARE? A single prompt costs one call per question, while a portfolio costs $k$. That is a fair objection to any ensemble. TARE's worst-case objective, however, raises the floor of one prompt's performance and cannot turn independent failures into correct votes. We compare at $k=1$, where our method reduces to a complementarity-free search, and at matched $k$, where ATARE gets $k$ votes from its own neighborhood. If ATARE with $k$ votes ties our portfolio, the single-robust-prompt approach wins on simplicity.

Why not just calibrate the outputs or use hybrid scoring? On multiple-choice tasks with access to output probabilities, hybrid scoring may remove most symbol and order effects at almost no cost. We run it as a baseline for exactly that reason. It cannot be applied to black-box APIs or to free-form tasks, and it does not address sensitivity to wording in the question stem. We therefore report results separately for the logit-access multiple-choice setting and for the black-box and BIG-Bench Hard generation setting.

Why not just add few-shot examples? ProSA finds that one example reduces instance-level sensitivity sharply. Brittlebench finds that few-shot prompting increases sensitivity to formatting, and SENSEL shows that results depend on the order of the examples. Given this conflict, we include a fixed 3-shot variant of every baseline. We let the genetic operators edit the choice of examples only in a separate condition, so that any effect from examples is not mixed into the main result.

Proposed Experiments

The tasks are MMLU, ARC-Challenge and GPQA, chosen because Brittlebench and When Benchmarks are Targets show strong presentation effects on them. GPQA's main set has 448 questions, and domain experts score 65% on it. We add six BIG-Bench Hard tasks, Object Counting among them, to connect with the TARE and EvoPrompt results. For each task, we split questions into an evolution set, a set used to select $\lambda$, and a test set, and we use the disjoint train and test perturbation families described above.

We run one open-weight target model, Llama 3.1 8B, which TARE also used as a weaker optimizer, and one commercial model, because Brittlebench reports roughly 50% versus 25% brittleness shares for the two kinds of model.

The metrics are clean accuracy, held-out perturbed accuracy, the Brittleness Score, PromptSensiScore, answer-flip rate across perturbations, and model calls spent on optimization and per question at inference.

The decisive checks are three. First, error correlation among portfolio members on held-out perturbations should be lower than among random rewordings. Second, the portfolio's advantage over cost-matched voting should persist on perturbation families never seen during evolution. Third, given the transfer failure in the secure code GA study, a portfolio evolved on one model should be applied to the other. Partial transfer would be informative, and total failure would limit the method to per-model use.