TL;DR
Iterative prompt optimization using natural language feedback (textual gradients) is powerful but notoriously unstable. This paper introduces STEVE, a framework that stabilizes this process by generating feedback exclusively from model failures and gating prompt updates against a preservation set. STEVE consistently discovers concise, robust prompts, outperforming state-of-the-art optimization methods by an average of 3.5% across ten diverse reasoning benchmarks.
What Problem Does This Paper Address?
Automating prompt engineering via Automated Prompt Optimization (APO) has shifted toward using "textual gradients"—where an LLM evaluator critiques a prompt's outputs and an LLM optimizer refines the prompt based on that feedback. However, this iterative process is highly unstable. The authors identify two primary culprits for this instability:
- Noisy Gradients from Correct Examples: When an executor model already answers a training example correctly, forcing an evaluator LLM to generate feedback produces low-signal, high-noise critiques. This often leads to destructive edits that degrade overall prompt performance.
- Over-Specialization to Hard Cases: Conversely, if you optimize only on failed examples, the optimizer overfits. It attempts to solve complex edge cases by packing the prompt with hyper-specific, multi-step constraints. This causes the prompt to balloon in size and confuses the model on simpler, general tasks.
Methods
STEVE (Stabilizing Textual Gradients via Error-Driven Refinement and Regularized Verification) introduces two coupled mechanisms to tackle these instabilities:
- Error-Driven Refinement: Instead of sampling from the entire training set, STEVE dynamically filters it to create a "hard case pool" consisting only of examples the current prompt failed to solve. Textual gradients are exclusively computed from these informative failures, maximizing the learning signal-to-noise ratio.
- Regularized Verification: To prevent the prompt from overfitting to these hard cases, STEVE introduces a discrete gating mechanism inspired by continuous regularization techniques like Elastic Weight Consolidation (EWC). It maintains a "Generalization Preservation Pool" of examples the initial prompt got right. For every iteration, multiple candidate prompts are generated, and an update is only accepted if its improvement on the hard cases outweighs any performance regression on a sample from the preservation set.
Datasets
The authors evaluated STEVE across 10 diverse reasoning benchmarks spanning four domains:
- Mathematical Reasoning: GSM8k, MultiArith
- Complex Commonsense Reasoning: StrategyQA, Navigate
- Symbolic & Procedural Reasoning: Object Counting, Penguins in a Table, Geometric Shapes, Date Understanding
- Expert-Level Knowledge Reasoning: MMLU College Physics, MMLU Machine Learning
For a modernized evaluation, they also tested newer models on larger sets: GSM8K-Platinum, DS-1000 (code generation), and Big-Bench Extra Hard (BBEH) subsets.
Key Insights and Ideas
- Critiquing Success is Destructive: Forcing an LLM to critique a successful output results in superficial or stylistic changes that act as random, destructive perturbations to the prompt space.
- Prompt Space Overfitting Mimics Catastrophic Forgetting: Without a verification gate, prompts quickly grow from ~200 tokens to over 1000 tokens within 12 steps, becoming brittle algorithmic descriptions that fail at basic tasks.
- Discrete Regularization Works: Even though prompts are discrete and symbolic (unlike continuous neural network weights), applying a regularized objective function to gate updates effectively balances specialization and generalization.
Key Results
STEVE was tested using gpt-3.5-turbo as the executor and three different models (gpt-4o, gemini-2.5-flash, and gpt-5) as the evaluator/optimizers.
- Substantial Accuracy Gains: Across all 30 experimental settings, STEVE achieved an average absolute improvement of over 15% compared to the initial Zero-shot CoT baseline.
- Outperforming the State-of-the-Art: STEVE consistently beat top-performing iterative optimization baselines like TextGrad and REVOLVE, outperforming REVOLVE by an average of 3.5%.
- Exceptional on Symbolic Tasks: STEVE showed massive improvements on complex procedural tasks. For instance, using
gemini-2.5-flash, it achieved accuracy gains of over 27% on Navigate and 30% on Penguins in a Table. - Concise Prompts: While unregularized methods produced bloated 1000+ token prompts, STEVE's verification gate kept prompts concise (~300 tokens) while reaching higher accuracy (e.g., 95.1% on Object Counting).
Limitations and Future Work
- Model and API Dependency: Because STEVE relies on an LLM-in-the-loop framework, its optimization stability and prompt quality are tightly bound to the specific behavior and API versions of the evaluator/optimizer models used.
- Increased Computational Cost: Generating multiple diverse prompt candidates and running a regularized verification step on a preservation set inherently introduces significant computational overhead, requiring roughly $n \times (b + k)$ additional executor LLM calls per iteration.
Summary updated