Large language models (LLMs) have pushed the limits of natural language understanding and exhibited excellent problem-solving ability. Despite the great success, most existing open-source LLMs (e.g., LLaMA-2) are still far away from satisfactory for solving mathematical problem due to the complex reasoning procedures. To bridge this gap, we propose MetaMath, a fine-tuned language model that specializes in mathematical reasoning. Specifically, we start by bootstrapping mathematical questions by rewriting the question from multiple perspectives without extra knowledge, which results in a new dataset called MetaMathQA. Then we fine-tune the LLaMA-2 models on MetaMathQA. Experimental results on two popular benchmarks (i.e., GSM8K and MATH) for mathematical reasoning demonstrate that MetaMath outperforms a suite of open-source LLMs by a significant margin. Our MetaMath-7B model achieves 66.4% on GSM8K and 19.4% on MATH, exceeding the state-of-the-art models of the same size by 11.5% and 8.7%. Particularly, MetaMath-70B achieves an accuracy of 82.3% on GSM8K, slightly better than GPT-3.5-Turbo. We release all the MetaMathQA dataset, the MetaMath models with different model sizes and the training code for public use.
翻译:大型语言模型(LLMs)已突破自然语言理解的极限,展现出卓越的问题解决能力。尽管取得巨大成功,现有大多数开源LLMs(如LLaMA-2)由于复杂推理过程的限制,在数学问题求解方面仍远未达到令人满意的效果。为弥合这一差距,我们提出MetaMath——一个专门针对数学推理进行微调的语言模型。具体而言,我们首先通过从多角度重写问题来自举数学问题(无需额外知识),从而构建新数据集MetaMathQA。随后基于MetaMathQA对LLaMA-2模型进行微调。在数学推理领域两个主流基准(即GSM8K和MATH)上的实验结果表明,MetaMath以显著优势超越了一系列开源LLMs。其中,MetaMath-7B模型在GSM8K和MATH上分别达到66.4%和19.4%的准确率,超过同尺寸最先进模型11.5%和8.7%。特别值得一提的是,MetaMath-70B在GSM8K上取得82.3%的准确率,略优于GPT-3.5-Turbo。我们已开源全部MetaMathQA数据集、不同规模的MetaMath模型及训练代码。