Failure guided method improves prompts and training data together

Failure-Guided Co-Evolution of Prompts and Training Data

Software EngineeringArtificial Intelligence

Summary

Improving computer programs that use language models often involves making better prompts, but this usually relies on the same examples over and over, causing limited improvement. The authors introduce a new way to fix this by treating mistakes as clues not only to change the prompt but also to create new example data. Their method, FORGE, cycles between updating prompts and generating fresh training cases based on where the model fails. This approach consistently improved performance across several tests and helped different prompt tuning methods work better when reusing the new data.

What this means in practice

Authors

Tianyu Yuan, Zhuzhong Qian

Abstract

Automatic prompt optimization (APO) improves language-model programs by revising prompts from task feedback, yet it typically holds its training data fixed. Repeatedly optimizing against the same instances confines feedback to weaknesses already represented in those data, leaving related failure conditions unexplored. We therefore view each failure as a dual signal: it indicates both how the prompt should be revised and what new training evidence should be synthesized. We introduce FORGE, a failure-guided framework that co-evolves prompts and training data. FORGE abstracts imperfect executions into reusable failure modes and synthesizes new training data through four complementary mutation strategies. Verified instances are fed back into prompt search, allowing updated prompts to expose the next data needs. Across eight heterogeneous benchmarks, FORGE improves the aggregate score over the unoptimized baseline by 16.52 percentage points and outperforms all evaluated APO baselines. The synthesized data also transfer beyond FORGE: in a transfer study, they improve all nine APO comparisons by 2--9 points and all three GRPO comparisons by 4--8 points under matched optimization budgets. These results establish failures as a shared interface between prompt optimization and data synthesis, and show the benefit of jointly adapting what a model is instructed to do and what it learns from.