Abstract
In math reasoning with large language models (LLMs), fine-tuning data augmentation by query evolution and diverse reasoning paths is empirically verified effective, profoundly narrowing the gap between open-sourced LLMs and cutting-edge proprietary LLMs. In this paper, we conduct an investigation for such data augmentation in math reasoning and are intended to answer: (1) What strategies of data augmentation are more effective; (2) What is the scaling relationship between the amount of augmented data and model performance; and (3) Can data augmentation incentivize generalization to out-of-domain mathematical reasoning tasks? To this end, we create two new datasets, AugGSM8K and AugMATH, by complicating and diversifying the queries and sampling multiple reasoning paths from GSM8K and MATH. We obtained a series of LLMs called MuggleMath by fine-tuning LLaMA models on AugGSM8K and AugMATH. MuggleMath substantially achieves new state-of-the-art on GSM8K and MATH. A log-linear relationship and a segmented log-linear are presented between MuggleMath’s performance and the amount of augmented data on GSM8K and MATH, respectively. We also find that it is weak in out-of-domain math reasoning generalization from AugGSM8K to MATH and from AugMATH to GSM8K, which suggests that augmenting queries that cover a broader range of subjects is more beneficial for generalization.
Introduction
While proprietary models like GPT-4 excel at mathematical reasoning, open-source models have historically struggled to close the gap. Researchers have long used Supervised Fine-Tuning (SFT) on augmented datasets to bridge this divide, but the underlying principles of this augmentation remained largely unstudied. The MuggleMath project provides a systematic deep dive into how varying math queries and sampling multiple reasoning paths boosts the mathematical prowess of open-source LLMs like the LLaMA series.
Augmentation Strategies: Complexity is King
The researchers employed a two-pronged augmentation strategy involving both query and response augmentation. For queries, they used proprietary models to rewrite existing problems in five ways: changing specific numbers, introducing fractions/percentages, combining multiple concepts, adding conditional statements, and increasing overall complexity.
As shown in Figure 1, "Increasing Complexity" emerged as the most effective strategy across different model sizes. Simply swapping numbers provides marginal gains compared to making the underlying logic more intricate. For response augmentation, the authors generated multiple distinct reasoning paths (Chain-of-Thought) for each problem, ensuring high quality through manual filtering and consistent formatting.
Scaling Laws for Synthetic Data
A striking finding of the study is that synthetic, model-generated data scales model performance at a rate almost identical to human-written data. The authors identified predictable mathematical relationships governing this growth. On the GSM8K dataset, they observed a log-linear relationship where accuracy improves linearly as the amount of augmented data doubles.
For the more challenging MATH dataset, the relationship is "segmented log-linear," as illustrated in Figure 3. This suggests that models may need to reach a certain threshold of data or capacity before performance begins to climb rapidly on high-school-level competition problems.
Performance and the Generalization Gap
MuggleMath achieved impressive performance jumps across the board. MuggleMath-70B reached 82.7% on GSM8K and 36.3% on MATH, setting a new high-water mark for open-source models at the time. Even the smaller MuggleMath-7B jumped from a baseline of 14.6% to 69.8% on GSM8K, outperforming many models ten times its size.
However, a significant "generalization gap" remains. Being proficient at elementary school math (GSM8K) does not necessarily translate to success in high-school competition math (MATH). Visualizations using t-SNE indicate that these datasets occupy distinct spaces in the model's internal representations. This suggests that to build a truly general math solver, augmentation must cover a vast range of subjects rather than just scaling up a single domain.
Conclusion
The MuggleMath series demonstrates that strategic data augmentation can significantly narrow the gap between open-source and proprietary LLMs in mathematical reasoning. While scaling laws provide a roadmap for performance gains, the lack of transferability between math domains highlights the need for broader subject coverage in future synthetic datasets. Future work will likely focus on self-augmentation techniques and expanding these strategies to other technical fields like formal logic and coding.
Summary updated