[Paper Review] MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuning
MAmmoTH introduces open-source math-generalist LLMs trained with a hybrid CoT and PoT instruction-tuning dataset (MathInstruct) to achieve strong generalization across diverse math problems and outperforms prior open-source models.
We introduce MAmmoTH, a series of open-source large language models (LLMs) specifically tailored for general math problem-solving. The MAmmoTH models are trained on MathInstruct, our meticulously curated instruction tuning dataset. MathInstruct is compiled from 13 math datasets with intermediate rationales, six of which have rationales newly curated by us. It presents a unique hybrid of chain-of-thought (CoT) and program-of-thought (PoT) rationales, and also ensures extensive coverage of diverse fields in math. The hybrid of CoT and PoT not only unleashes the potential of tool use but also allows different thought processes for different math problems. As a result, the MAmmoTH series substantially outperform existing open-source models on nine mathematical reasoning datasets across all scales with an average accuracy gain between 16% and 32%. Remarkably, our MAmmoTH-7B model reaches 33% on MATH (a competition-level dataset), which exceeds the best open-source 7B model (WizardMath) by 23%, and the MAmmoTH-34B model achieves 44% accuracy on MATH, even surpassing GPT-4's CoT result. Our work underscores the importance of diverse problem coverage and the use of hybrid rationales in developing superior math generalist models.
Motivation & Objective
- Promote general mathematical reasoning in open-source LLMs beyond dataset-specific fine-tuning.
- Create a diverse, high-quality instruction-tuning dataset combining CoT and PoT rationales.
- Evaluate multi-scale Llama-2 and Code Llama bases on broad in-domain and out-of-domain math benchmarks.
- Demonstrate the impact of hybrid decoding (PoT-first with CoT fallback) on performance.
Proposed method
- Construct MathInstruct by aggregating 13 existing math datasets and 6 newly curated datasets.
- Incorporate a hybrid of chain-of-thought (CoT) and program-of-thought (PoT) rationales.
- Fine-tune Llama-2 and Code Llama bases at 7B–70B scales using Alpaca-like data format.
- Train with learning rates 2e-5 (7B/13B) and 1e-5 (34B/70B) with a 3-epoch cosine schedule and DeepSpeed ZeRO-3 for large models.
- Evaluate using a hybrid decoding strategy: attempt PoT first; if non-executable, fall back to CoT; report combined performance.
Experimental results
Research questions
- RQ1Can a diverse, hybrid CoT/PoT instruction-tuning dataset improve open-source LLM math generalization across in-domain and out-of-domain tasks?
- RQ2How does the choice of base model (Llama-2 vs Code Llama) and model size affect math generalization when trained on MathInstruct?
- RQ3What is the impact of hybrid decoding (PoT-first with CoT fallback) on overall problem-solving accuracy across math benchmarks?
- RQ4Do dataset-scale and data-source diversity effects compound to yield generalizable math reasoning improvements?
- RQ5How does MAmmoTH compare to closed-source models on standard math reasoning benchmarks, especially in out-of-domain settings?
Key findings
- MAmmoTH and MAmmoTH-Coder outperform prior open-source models across nine math reasoning datasets with notable gains, particularly in out-of-domain settings.
- The hybrid CoT/PoT training and hybrid decoding strategy yield the best overall performance compared to using CoT or PoT alone.
- On the MATH dataset, the 7B MAmmoTH model surpasses WizardMath by a significant margin, and the 34B MAmmoTH-Coder can even exceed some GPT-4 CoT results in certain configurations.
- Code-focused base models (Code-Llama) generally outperform plain Llama-2 in OOD scenarios, with MAmmoTH-Coder often achieving higher averages than MAmmoTH.
- Ablation studies show PoT-focused fine-tuning provides strong gains, while combining CoT and PoT data yields the strongest, most robust performance.
- Diversity of data sources in MathInstruct is crucial; adding newly curated datasets yields tangible improvements across multiple benchmarks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.