NTH

ESPO: Error-Structured Prompt Optimization via Diagnose, Diversify, and Stabilize

AuthorsLihao Liu, Peng Tang, Kunwar Yashraj Singh, Shabnam Ghadar

September 10, 2026 2 min read
Watch on YouTube
The one-line take

ESPO makes evolutionary prompt optimization more accurate, shorter, and more reliable by diagnosing errors, diversifying candidate prompts, and selecting them with bootstrap stability.

Key results

74.67%
ESPO average accuracy

Average accuracy across seven benchmarks with Claude Sonnet 4.5

70.91%
GEPA average accuracy

Baseline average accuracy across the same seven benchmarks

47%
Prompt length reduction

ESPO reduces average prompt length from 1878 to 1004 characters

91.40%
Qwen3 GSM8K ESPO accuracy

Accuracy achieved by ESPO on Qwen3 32B for GSM8K

-1.20%
Diversity-only ablation change

Accuracy change when adding proposal diversity without bootstrap selection

What the paper found

ESPO, or Error-Structured Prompt Optimization, replaces GEPA’s append-and-select evolutionary loop with three stages: Diagnose clusters all training errors into 3–7 structural failure patterns, Propose generates candidates through four complementary strategies—diagnostic revision, consolidation, ablation, and factual injection—and Select uses 20 bootstrap resamples to choose the most stable prompt. Across Tweet, MMLU, GSM8K, HotpotQA, ScoNe, HoVer, and PUPA, evaluated with Claude Sonnet 4.5 on deliberately weak starting instructions, ESPO reaches 74.67% average accuracy versus GEPA’s 70.91%, a 3.76-percentage-point gain, while reducing average prompt length by 47%, from 1878 to 1004 characters, with equal or lower inference latency. The method generalizes across Gemma 3 12B, Mistral 14B, Qwen3 32B, and Claude Haiku 4.5; its largest improvement occurs on Qwen3 GSM8K, where accuracy rises from 15.00% by default to 91.40% with ESPO. Ablations show that diversity alone can reduce accuracy by 1.20%, supporting the claim that candidate diversification requires reliable bootstrap selection. Theoretical analysis links diagnosis, proposal diversity, and stability selection to bias reduction, exploration gain, and lower selection error, while limitations include optimization-time evaluation cost and dependence on LLM-generated error clustering.

Original abstract

Evolutionary prompt optimizers such as GEPA suffer from prompt bloat: each iteration appends rules and caveats, producing prompts up to 3$\times$ longer yet no more accurate. We trace this to three deficiencies - incomplete error observation, limited search diversity, and unreliable selection - and propose ESPO (Error-Structured Prompt Optimization), which decomposes prompt optimization into three phases: Diagnose clusters all training errors into structural patterns in one round; Propose generates candidates via four complementary strategies with independent biases; Select applies bootstrap stability selection. On seven public NLP benchmarks - Tweet, MMLU, GSM8K, HotpotQA, ScoNe, HoVer, and PUPA - ESPO improves average accuracy by $+$3.76 pp over the state-of-the-art (74.67% vs 70.91% for GEPA), matching or exceeding GEPA on every dataset while producing prompts 47% shorter (1,004 vs 1,878 chars) and faster at inference. Cross-model experiments across four additional student models (Gemma 3 12B, Mistral 14B, Qwen3 32B, Claude Haiku 4.5) show ESPO yields the best average accuracy on every model tested, with the largest gap on Qwen3 GSM8K (15.00% $\to$ 91.40%). A generalization bound (Appendix) grounds each phase in a corresponding term of the test-time gap, and the ablation confirms a key prediction: adding diversity without bootstrap selection actually hurts performance ($-$1.20%).

Read the original paper

More in Optimization

Browse all 36 papers →