Error-guided reasoning: enhanced framework for mathematical reasoning and multi-incorrect feedback in LLMs
摘要
Enhancing the mathematical reasoning capabilities of prompt-based large language models (LLMs) is crucial for improving their performance in complex problem-solving tasks. Previous research, exemplified by the wrong-of-thought (WoT) framework, has introduced a multi-perspective verification mechanism that evaluates reasoning across assertion, process, and result. While WoT aimed to mitigate recurrent generating errors by addressing prior incorrect reasoning, its utility was constrained by a narrow focus, guiding the model away from only a singular incorrect reasoning path. Furthermore, the direct utilization of incorrect reasoning in the form of mathematical equations or Python code snippets as negative guidance has often proved ineffective, leading to persistent inaccuracies, unsolvable mathematical problems, or non-executable code in subsequent iterations. To overcome these limitations, we introduce error-guided reasoning (EGR), an integrated framework which systematically leverages the full spectrum of past incorrect reasoning instances to refine subsequent reasoning. EGR employs a principle of multi-error utilization, leveraging the most prevalent errors to guide the model’s iterative refinement. To effectively translate these errors into actionable guidance, EGR analyzes them effectively, extracting generalized guiding principles articulated in natural language. These principles are then integrated into enhanced prompts, specifically designed to mitigate the recurrence of similar mistakes. By learning from diverse patterns of incorrect paths, EGR significantly enhances reasoning accuracy and substantially reduces the generation of incorrect outputs. Empirical experiments using three LLMs across six widely used datasets demonstrate that EGR consistently outperforms all established baselines. EGR also improves high-performance computing (HPC) oriented inference efficiency by reducing refinement iterations, LLM calls, and token consumption through more effective use of prior errors. Moreover, this approach encourages the generation of accurate and executable solutions for complex mathematical tasks.