The math abilities of large language models can represent their abstract reasoning ability. In this paper, we introduce and open-source our math reasoning LLMs InternLM-Math which is continue pre-trained from InternLM2. We unify chain-of-thought reasoning, reward modeling, formal reasoning, data augmentation, and code interpreter in a unified seq2seq format and supervise our model to be a versatile math reasoner, verifier, prover, and augmenter. These abilities can be used to develop the next math LLMs or self-iteration. InternLM-Math obtains open-sourced state-of-the-art performance under the setting of in-context learning, supervised fine-tuning, and code-assisted reasoning in various informal and formal benchmarks including GSM8K, MATH, Hungary math exam, MathBench-ZH, and MiniF2F. Our pre-trained model achieves 30.3 on the MiniF2F test set without fine-tuning. We further explore how to use LEAN to solve math problems and study its performance under the setting of multi-task learning which shows the possibility of using LEAN as a unified platform for solving and proving in math. Our models, codes, and data are released at \url{https://github.com/InternLM/InternLM-Math}.
翻译:大语言模型的数学能力能够表征其抽象推理能力。本文介绍并开源了基于InternLM2持续预训练的数学推理大语言模型InternLM-Math。我们统一了思维链推理、奖励建模、形式化推理、数据增强和代码解释器,并将其整合为统一的序列到序列格式,使模型具备多功能的数学推理、验证、证明与数据增强能力。这些能力可用于开发下一代数学大语言模型或实现自我迭代。在上下文学习、有监督微调和代码辅助推理等场景下,InternLM-Math在GSM8K、MATH、匈牙利数学考试、MathBench-ZH和MiniF2F等多项非形式化与形式化基准测试中均达到开源模型的顶尖水平。我们的预训练模型在未经过微调的MiniF2F测试集上取得了30.3的得分。我们进一步探索了利用LEAN求解数学问题的方法,并在多任务学习设置下研究其表现,证明了将LEAN作为数学求解与证明统一平台的可能性。我们的模型、代码与数据已在\url{https://github.com/InternLM/InternLM-Math}开源。