TL;DR
This paper introduces Error Taxonomy-Guided Prompt Optimization (ETGPO), a novel method for automatically improving large language model (LLM) prompts. ETGPO tackles the inefficiency of existing trial-and-error prompt optimization techniques by analyzing model failures, categorizing them into a taxonomy, and generating targeted guidance to address the most common error patterns. This top-down approach significantly reduces computational cost while achieving comparable or superior performance to state-of-the-art methods.
What Problem Does This Paper Address?
Large Language Models (LLMs) are highly sensitive to the way prompts are phrased, structured, and exemplified. While this sensitivity allows for performance improvements without altering the model's weights, manually crafting optimal prompts is a laborious and expertise-intensive process. Existing Automatic Prompt Optimization (APO) methods often rely on extensive trial-and-error, which can be computationally expensive. Furthermore, many current APO approaches adopt a "bottom-up" strategy, iteratively refining prompts based on feedback from individual examples. This can lead to a loss of global perspective, potentially causing the optimization to overfit to specific instances and miss broader failure patterns. The paper addresses this by proposing a "top-down" approach that analyzes the overall landscape of model errors to create more generalizable and efficient prompt improvements.
Methods
The core of ETGPO is its "top-down" approach to prompt optimization, which involves four main steps:
- Error Collection: The system runs the base prompt on a validation set multiple times (controlled by parameter K) to capture a diverse range of potential errors due to the LLM's stochastic nature. Failed traces (problem, reasoning, and predicted answer) are collected.
- Error Taxonomy Creation: An "optimizer LLM" analyzes batches of failed traces. For each trace, it identifies the root cause of the error, explains why it led to an incorrect answer, and assigns it to an error category. The system aims to create general, self-contained categories that can be understood without reference to the original problems. For subsequent batches, the optimizer LLM is prompted to reuse existing categories or create new ones if necessary.
- Error Category Selection: The created error categories are filtered to include only those that occurred in at least two problems. The categories are then ranked by their failure count, and the top G categories are selected for guidance generation. This step focuses on the most prevalent failure modes.
- Guidance Generation: The optimizer LLM is prompted with information about the selected error categories (summary, description, example, error type, and explanation of why it leads to wrong answers). It then generates actionable guidance text, including a preamble, for each category. This guidance is appended to the original system prompt to create the optimized prompt.
Datasets
The paper evaluates ETGPO on six diverse datasets:
- AIME (Art of Problem Solving): A challenging high-school mathematics competition dataset.
- HMMT (Harvard-MIT Mathematics Tournament): Another high-school mathematics competition dataset.
- MMLU-Pro: A more challenging variant of the MMLU benchmark for general-domain question answering, featuring ten answer choices per question.
- MuSiQue: A multi-hop reasoning dataset requiring answering multiple implicit subquestions.
- AR-LSAT: An analytical reasoning dataset derived from Law School Admission Test (LSAT) questions.
- FOLIO: A dataset designed to test complex logical reasoning abilities, specifically focusing on whether conclusions logically follow from premises.
The paper also mentions using publicly available datasets from MathArena for MMLU-Pro.
Key Insights and Ideas
- Top-Down vs. Bottom-Up: The paper highlights a crucial distinction between bottom-up APO methods (iteratively fixing individual errors) and their proposed top-down approach (analyzing global error patterns). The top-down method is hypothesized to lead to more generalizable prompt improvements and greater efficiency.
- The Power of Taxonomy: Creating a structured taxonomy of errors provides an interpretable view of an LLM's weaknesses. This structured understanding allows for targeted interventions rather than random trial-and-error.
- Focusing on Prevalent Errors: By selecting the most frequent error categories, ETGPO prioritizes improvements that are likely to have the biggest impact across a dataset, avoiding the trap of optimizing for rare, specific issues.
- Efficiency Gains: A significant insight is that ETGPO achieves comparable or better accuracy while requiring substantially less computational resources (roughly one-third of the token usage) compared to other state-of-the-art APO methods. This suggests that a more structured approach can be more efficient than brute-force optimization.
Key Results
- Accuracy: ETGPO consistently matches or outperforms state-of-the-art APO methods on average across multiple benchmarks spanning mathematics, question answering, and logical reasoning. For instance, on FOLIO, ETGPO achieved improvements of approximately 6-7 percentage points in accuracy.
- Efficiency: ETGPO uses approximately one-third of the optimization-phase token usage compared to other methods like GEPA. This makes it a much more computationally efficient approach.
- Error Reduction: Figure 3 demonstrates that ETGPO effectively reduces the count of failed traces across various error categories, supporting the hypothesis that targeted guidance mitigates specific error patterns.
- Ablation Studies: Ablation experiments confirmed the importance of each component of ETGPO: error taxonomy creation, LLM-generated guidance, and detailed guidance descriptions all contribute significantly to the method's effectiveness.
Limitations and Future Work
- Dataset Dependency: The optimal number of error collection runs (K) and selected error categories (G) can vary depending on the dataset, suggesting that hyperparameter tuning might be beneficial for specific tasks.
- Domain-Specific Knowledge: For datasets like MMLU-Pro, which require highly specific domain knowledge, the gains from general guidance are modest. The authors suggest that retrieval-based approaches might be more suitable for such tasks.
- Future Work: The paper implicitly suggests that further exploration of hyperparameter tuning and the application of ETGPO to a wider range of tasks and LLMs would be valuable. The structured error taxonomy could also be used for other purposes, such as model analysis or targeted fine-tuning.
Summary updated