通过分析错误模式生成训练数据,提升大模型数学推理能力。
Self-Error-Instruct: Generalizing from Errors for LLMs Mathematical Reasoning
- 从错误案例中提取关键短语并聚类,识别常见错误类型。
- 基于错误类型生成针对性训练数据,使模型在GSM8K和MATH上准确率提升。
- 适合希望提升数学推理能力的模型优化者使用。
尽管大语言模型在多个领域表现强劲,但在数学推理任务中仍存在大量失败案例。以往方法仅从孤立错误案例外推生成训练数据,难以捕捉其中的普遍模式。本文提出Self-Error-Instruct(SEI)框架,通过在GSM8K和MATH两个数学数据集上分析目标模型的错误案例,利用GPT-4o生成错误关键词并聚类识别错误类型。随后,针对每类错误采样若干错误案例,输入指导模型生成更多合成训练数据,并通过单次学习过程筛选最有效样本。最终用精选数据迭代微调目标模型,显著提升其在域内与域外数学数据集上的推理能力。结果表明,通过错误泛化实现自指导训练能有效增强大模型的数学推理性能。
原文摘要 · Abstract (English)
Although large language models demonstrate strong performance across various domains, they still struggle with numerous bad cases in mathematical reasoning. Previous approaches to learning from errors synthesize training data by solely extrapolating from isolated bad cases, thereby failing to generalize the extensive patterns inherent within these cases. This paper presents Self-Error-Instruct (SEI), a framework that addresses these model weaknesses and synthesizes more generalized targeted training data. Specifically, we explore a target model on two mathematical datasets, GSM8K and MATH, to pinpoint bad cases. Then, we generate error keyphrases for these cases based on the instructor model's (GPT-4o) analysis and identify error types by clustering these keyphrases. Next, we sample a few bad cases during each generation for each identified error type and input them into the instructor model, which synthesizes additional training data using a self-instruct approach. This new data is refined through a one-shot learning process to ensure that only the most effective examples are kept. Finally, we use these curated data to fine-tune the target model, iteratively repeating the process to enhance performance. We apply our framework to various models and observe improvements in their reasoning abilities across both in-domain and out-of-domain mathematics datasets. These results demonstrate the effectiveness of self-error instruction in improving LLMs' mathematical reasoning through error generalization.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。