Lune

ACL Findings2025

CoinMath: Harnessing the Power of Coding Instruction for Math LLM

Chengwei Wei, Bin Wang, Jung-Jae Kim, Guimei Liu, Nancy F. Chen

摘要

Large Language Models (LLMs) have shown strong performance in solving mathematical problems, with code-based solutions proving particularly effective.However, the best practice to leverage coding instruction data to enhance mathematical reasoning remains underexplored.This study investigates three key questions: (1) How do different coding styles of mathematical code-based rationales impact LLMs' learning performance?(2) Can generaldomain coding instructions improve performance?(3) How does integrating textual rationales with code-based ones during training enhance mathematical reasoning abilities?Our findings reveal that code-based rationales with concise comments, descriptive naming, and hardcoded solutions are beneficial, while improvements from general-domain coding instructions and textual rationales are relatively minor.Based on these insights, we propose CoinMath, a learning strategy designed to enhance mathematical reasoning by diversifying the coding styles of code-based rationales.CoinMath generates a variety of code-based rationales incorporating concise comments, descriptive naming conventions, and hardcoded solutions.Experimental results demonstrate that CoinMath significantly outperforms its baseline model, MAmmoTH, one of the SOTA math LLMs. 1 Model Comment A. S. G. M. Avg.Llama-3.1-8BNo 61.7 30.4 32.4 11.5 34.0 Concise 83.3 80.3 73.5 36.4 68.4 Detailed 80.7 83.4 73.6 35.5 68.3 CodeLlama-Python-7B No 82.7 64.4 52.2 27.3 56.7 Concise 83.0 68.7 59.7 28.1 59.9 Detailed 83.3 69.6 55.4 27.2 58.9 Gemma-2-2B No 73.0 65.3 53.6 25.8 54.4 Concise 77.3 67.6 54.7 26.6 56.6 Detailed 79.0 67.2 54.0 24.4 56.2 CodeGemma-2B No 79.0 53.1 40.9 21.4 48.6 Concise 80.0 52.0 41.0 21.7 48.7 Detailed 81.0 55.2 39.7 21.4 49.3

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Llemma: An Open Language Model for Mathematics 引用了 MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuning
  • Llemma: An Open Language Model for Mathematics 引用了 Solving Quantitative Reasoning Problems with Language Models
  • Llemma: An Open Language Model for Mathematics 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuning 引用了 Solving Quantitative Reasoning Problems with Language Models
  • MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuning 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Solving Quantitative Reasoning Problems with Language Models 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper12

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  2. LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu 等ICLR 2022 · 18,833 次引用
  3. Solving Quantitative Reasoning Problems with Language ModelsAitor Lewkowycz, Anders Andreassen, David Dohan, Ethan Dyer 等NeurIPS 2022 · 2,039 次引用
  4. MAmmoTH: Building Math Generalist Models through Hybrid Instruction TuningXiang Yue, Xingwei Qu, Ge Zhang, Yao Fu 等ICLR 2024 · 558 次引用
  5. Llemma: An Open Language Model for MathematicsZhangir Azerbayev, Hailey Schoelkopf, Keiran Paster, Marco Dos Santos 等ICLR 2024 · 433 次引用

相关 Paper

  1. Fewer is More: Boosting Math Reasoning with Reinforced Context PruningXijie Huang, Li Lyna Zhang, Kwang-Ting Cheng, Fan Yang 等EMNLP 2024 · 7 次引用
  2. MuMath-Code: Combining Tool-Use Large Language Models with Multi-perspective Data Augmentation for Mathematical ReasoningShuo Yin, Weihao You, Zhilong Ji, Guoqiang Zhong 等EMNLP 2024 · 3 次引用
  3. OpenMathInstruct-2: Accelerating AI for Math with Massive Open-Source Instruction DataShubham Toshniwal, Wei Du, Ivan Moshkov, Branislav Kisacanin 等ICLR 2025
  4. MARIO: MAth Reasoning with code Interpreter Output - A Reproducible PipelineMinpeng Liao, Chengxi Li, Wei Luo, Jing Wu 等ACL Findings 2024 · 2 次引用
  5. ClozeMath: Improving Mathematical Reasoning in Language Models by Learning to Fill EquationsQuang Hieu Pham, Thuy Duong Nguyen, Tung Pham, Anh Tuan Luu 等ACL Findings 2025
黄昏的海面,两侧是细线勾勒的悬崖