ERGO Optimizes Prompts for Text Classification via Error Analysis

Yueying Cui, Renhao Xue, Yi Zhang, Mukul Prasad· July 24, 2026 View original

Summary

ERGO (Error-Guided Optimization) is a new error-driven prompt optimization method for text classification that iteratively diagnoses failures and generates targeted decision rules. It excels on "boundary-learnable" tasks where errors concentrate in specific label pairs, offering interpretable rules and fast convergence.

Prompt optimization for text classification encompasses various approaches, including demonstration selection, exploration-based search, and error-driven diagnosis. Each method has distinct strengths and weaknesses, and no single technique consistently outperforms others across all task types. A comprehensive empirical study revealed that different paradigms excel on structurally different classification tasks. Guided by these insights, the researchers propose Error-Guided Optimization (ERGO). This error-driven method operates by iterating over the full training set in non-overlapping batches. It systematically diagnoses classification failures and then generates targeted decision rules through a "diagnose-prescribe-rewrite" feedback loop. ERGO demonstrates superior accuracy on tasks characterized by errors concentrated in specific confused label pairs, termed "boundary-learnable tasks." For instance, it achieved 90.0% on TREC and 94.4% on CLINC150, converging efficiently within 3-5 iterations. A key advantage of ERGO is its ability to produce interpretable decision rules. While it may not achieve the highest overall average across all benchmarks, ERGO fills a complementary role: demonstration-based In-Context Learning (ICL) performs best on coverage-dependent tasks, exploration-based search on many-class intent, and ERGO shines where decision boundaries can be learned from error patterns. The paper provides a framework linking task characteristics to the optimal prompt optimization paradigm.

Why it matters

Professionals working with LLMs for text classification can use ERGO to significantly improve model accuracy and interpretability, especially for tasks with clear error patterns, leading to more reliable and explainable AI systems.

How to implement this in your domain

  1. 1Analyze text classification tasks to identify if they are "boundary-learnable" with concentrated error patterns.
  2. 2Implement an error-driven prompt optimization loop similar to ERGO for specific classification challenges.
  3. 3Develop mechanisms to diagnose classification failures and generate targeted decision rules.
  4. 4Integrate interpretable decision rules generated by ERGO into LLM-based classification systems.
  5. 5Combine ERGO with other prompt optimization paradigms based on task characteristics for hybrid approaches.

Who benefits

Customer ServiceContent ModerationHealthcare (medical text classification)LegalTechMarketing

Key takeaways

  • ERGO is an error-driven prompt optimization method for text classification.
  • It excels on "boundary-learnable" tasks with concentrated error patterns.
  • ERGO generates interpretable decision rules and converges quickly.
  • Different prompt optimization paradigms are optimal for different task types.

Original post by Yueying Cui, Renhao Xue, Yi Zhang, Mukul Prasad

"arXiv:2607.20497v1 Announce Type: new Abstract: Prompt optimization for text classification spans diverse approaches, from demonstration selection to exploration-based search to error-driven diagnosis, each with known but incompletely characterized strengths and limitations. We c…"

View on X

Originally posted by Yueying Cui, Renhao Xue, Yi Zhang, Mukul Prasad on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses