MathCoder: Seamless Code Integration in LLMs for Enhanced Mathematical Reasoning. Wang, K., Ren, H., Zhou, A., Lu, Z., Luo, S., Shi, W., Zhang, R., Song, L., Zhan, M., & Li, H. October, 2023. arXiv:2310.03731 [cs]
Paper doi abstract bibtex The recently released GPT-4 Code Interpreter has demonstrated remarkable proficiency in solving challenging math problems, primarily attributed to its ability to seamlessly reason with natural language, generate code, execute code, and continue reasoning based on the execution output. In this paper, we present a method to fine-tune open-source language models, enabling them to use code for modeling and deriving math equations and, consequently, enhancing their mathematical reasoning abilities. We propose a method of generating novel and high-quality datasets with math problems and their code-based solutions, referred to as MathCodeInstruct. Each solution interleaves natural language, code, and execution results. We also introduce a customized supervised fine-tuning and inference approach. This approach yields the MathCoder models, a family of models capable of generating code-based solutions for solving challenging math problems. Impressively, the MathCoder models achieve state-of-the-art scores among open-source LLMs on the MATH (45.2%) and GSM8K (83.9%) datasets, substantially outperforming other open-source alternatives. Notably, the MathCoder model not only surpasses ChatGPT-3.5 and PaLM-2 on GSM8K and MATH but also outperforms GPT-4 on the competition-level MATH dataset. The dataset and models will be released at https://github.com/mathllm/MathCoder.
@misc{wang_mathcoder_2023,
title = {{MathCoder}: {Seamless} {Code} {Integration} in {LLMs} for {Enhanced} {Mathematical} {Reasoning}},
shorttitle = {{MathCoder}},
url = {http://arxiv.org/abs/2310.03731},
doi = {10.48550/arXiv.2310.03731},
abstract = {The recently released GPT-4 Code Interpreter has demonstrated remarkable proficiency in solving challenging math problems, primarily attributed to its ability to seamlessly reason with natural language, generate code, execute code, and continue reasoning based on the execution output. In this paper, we present a method to fine-tune open-source language models, enabling them to use code for modeling and deriving math equations and, consequently, enhancing their mathematical reasoning abilities. We propose a method of generating novel and high-quality datasets with math problems and their code-based solutions, referred to as MathCodeInstruct. Each solution interleaves natural language, code, and execution results. We also introduce a customized supervised fine-tuning and inference approach. This approach yields the MathCoder models, a family of models capable of generating code-based solutions for solving challenging math problems. Impressively, the MathCoder models achieve state-of-the-art scores among open-source LLMs on the MATH (45.2\%) and GSM8K (83.9\%) datasets, substantially outperforming other open-source alternatives. Notably, the MathCoder model not only surpasses ChatGPT-3.5 and PaLM-2 on GSM8K and MATH but also outperforms GPT-4 on the competition-level MATH dataset. The dataset and models will be released at https://github.com/mathllm/MathCoder.},
urldate = {2023-12-07},
publisher = {arXiv},
author = {Wang, Ke and Ren, Houxing and Zhou, Aojun and Lu, Zimu and Luo, Sichun and Shi, Weikang and Zhang, Renrui and Song, Linqi and Zhan, Mingjie and Li, Hongsheng},
month = oct,
year = {2023},
note = {arXiv:2310.03731 [cs]},
keywords = {artificial intelligence, computer vision and pattern recognition, large language models, machine learning, uses sympy},
}
Downloads: 0
{"_id":"M45NkzhgfM8TW3Rv2","bibbaseid":"wang-ren-zhou-lu-luo-shi-zhang-song-etal-mathcoderseamlesscodeintegrationinllmsforenhancedmathematicalreasoning-2023","author_short":["Wang, K.","Ren, H.","Zhou, A.","Lu, Z.","Luo, S.","Shi, W.","Zhang, R.","Song, L.","Zhan, M.","Li, H."],"bibdata":{"bibtype":"misc","type":"misc","title":"MathCoder: Seamless Code Integration in LLMs for Enhanced Mathematical Reasoning","shorttitle":"MathCoder","url":"http://arxiv.org/abs/2310.03731","doi":"10.48550/arXiv.2310.03731","abstract":"The recently released GPT-4 Code Interpreter has demonstrated remarkable proficiency in solving challenging math problems, primarily attributed to its ability to seamlessly reason with natural language, generate code, execute code, and continue reasoning based on the execution output. In this paper, we present a method to fine-tune open-source language models, enabling them to use code for modeling and deriving math equations and, consequently, enhancing their mathematical reasoning abilities. We propose a method of generating novel and high-quality datasets with math problems and their code-based solutions, referred to as MathCodeInstruct. Each solution interleaves natural language, code, and execution results. We also introduce a customized supervised fine-tuning and inference approach. This approach yields the MathCoder models, a family of models capable of generating code-based solutions for solving challenging math problems. Impressively, the MathCoder models achieve state-of-the-art scores among open-source LLMs on the MATH (45.2%) and GSM8K (83.9%) datasets, substantially outperforming other open-source alternatives. Notably, the MathCoder model not only surpasses ChatGPT-3.5 and PaLM-2 on GSM8K and MATH but also outperforms GPT-4 on the competition-level MATH dataset. The dataset and models will be released at https://github.com/mathllm/MathCoder.","urldate":"2023-12-07","publisher":"arXiv","author":[{"propositions":[],"lastnames":["Wang"],"firstnames":["Ke"],"suffixes":[]},{"propositions":[],"lastnames":["Ren"],"firstnames":["Houxing"],"suffixes":[]},{"propositions":[],"lastnames":["Zhou"],"firstnames":["Aojun"],"suffixes":[]},{"propositions":[],"lastnames":["Lu"],"firstnames":["Zimu"],"suffixes":[]},{"propositions":[],"lastnames":["Luo"],"firstnames":["Sichun"],"suffixes":[]},{"propositions":[],"lastnames":["Shi"],"firstnames":["Weikang"],"suffixes":[]},{"propositions":[],"lastnames":["Zhang"],"firstnames":["Renrui"],"suffixes":[]},{"propositions":[],"lastnames":["Song"],"firstnames":["Linqi"],"suffixes":[]},{"propositions":[],"lastnames":["Zhan"],"firstnames":["Mingjie"],"suffixes":[]},{"propositions":[],"lastnames":["Li"],"firstnames":["Hongsheng"],"suffixes":[]}],"month":"October","year":"2023","note":"arXiv:2310.03731 [cs]","keywords":"artificial intelligence, computer vision and pattern recognition, large language models, machine learning, uses sympy","bibtex":"@misc{wang_mathcoder_2023,\n\ttitle = {{MathCoder}: {Seamless} {Code} {Integration} in {LLMs} for {Enhanced} {Mathematical} {Reasoning}},\n\tshorttitle = {{MathCoder}},\n\turl = {http://arxiv.org/abs/2310.03731},\n\tdoi = {10.48550/arXiv.2310.03731},\n\tabstract = {The recently released GPT-4 Code Interpreter has demonstrated remarkable proficiency in solving challenging math problems, primarily attributed to its ability to seamlessly reason with natural language, generate code, execute code, and continue reasoning based on the execution output. In this paper, we present a method to fine-tune open-source language models, enabling them to use code for modeling and deriving math equations and, consequently, enhancing their mathematical reasoning abilities. We propose a method of generating novel and high-quality datasets with math problems and their code-based solutions, referred to as MathCodeInstruct. Each solution interleaves natural language, code, and execution results. We also introduce a customized supervised fine-tuning and inference approach. This approach yields the MathCoder models, a family of models capable of generating code-based solutions for solving challenging math problems. Impressively, the MathCoder models achieve state-of-the-art scores among open-source LLMs on the MATH (45.2\\%) and GSM8K (83.9\\%) datasets, substantially outperforming other open-source alternatives. Notably, the MathCoder model not only surpasses ChatGPT-3.5 and PaLM-2 on GSM8K and MATH but also outperforms GPT-4 on the competition-level MATH dataset. The dataset and models will be released at https://github.com/mathllm/MathCoder.},\n\turldate = {2023-12-07},\n\tpublisher = {arXiv},\n\tauthor = {Wang, Ke and Ren, Houxing and Zhou, Aojun and Lu, Zimu and Luo, Sichun and Shi, Weikang and Zhang, Renrui and Song, Linqi and Zhan, Mingjie and Li, Hongsheng},\n\tmonth = oct,\n\tyear = {2023},\n\tnote = {arXiv:2310.03731 [cs]},\n\tkeywords = {artificial intelligence, computer vision and pattern recognition, large language models, machine learning, uses sympy},\n}\n\n\n\n\n\n\n\n\n\n\n\n","author_short":["Wang, K.","Ren, H.","Zhou, A.","Lu, Z.","Luo, S.","Shi, W.","Zhang, R.","Song, L.","Zhan, M.","Li, H."],"key":"wang_mathcoder_2023","id":"wang_mathcoder_2023","bibbaseid":"wang-ren-zhou-lu-luo-shi-zhang-song-etal-mathcoderseamlesscodeintegrationinllmsforenhancedmathematicalreasoning-2023","role":"author","urls":{"Paper":"http://arxiv.org/abs/2310.03731"},"keyword":["artificial intelligence","computer vision and pattern recognition","large language models","machine learning","uses sympy"],"metadata":{"authorlinks":{}}},"bibtype":"misc","biburl":"https://bibbase.org/zotero-group/nicoguaro/525293","dataSources":["YtBDXPDiQEyhyEDZC"],"keywords":["artificial intelligence","computer vision and pattern recognition","large language models","machine learning","uses sympy"],"search_terms":["mathcoder","seamless","code","integration","llms","enhanced","mathematical","reasoning","wang","ren","zhou","lu","luo","shi","zhang","song","zhan","li"],"title":"MathCoder: Seamless Code Integration in LLMs for Enhanced Mathematical Reasoning","year":2023}