[Paper Review] Common 7B Language Models Already Possess Strong Math Capabilities
This paper demonstrates that the LLaMA-2 7B language model inherently possesses strong mathematical reasoning capabilities without specialized pre-training, achieving 97.7% accuracy on GSM8K and 72.0% on MATH when selecting the best answer from 256 generations. By scaling supervised fine-tuning (SFT) data using synthetic math questions generated via GPT-4 Turbo, the authors improve stability and achieve 82.6% on GSM8K and 40.6% on MATH—surpassing prior models by 14.2% and 20.8%, respectively.
Mathematical capabilities were previously believed to emerge in common language models only at a very large scale or require extensive math-related pre-training. This paper shows that the LLaMA-2 7B model with common pre-training already exhibits strong mathematical abilities, as evidenced by its impressive accuracy of 97.7% and 72.0% on the GSM8K and MATH benchmarks, respectively, when selecting the best response from 256 random generations. The primary issue with the current base model is the difficulty in consistently eliciting its inherent mathematical capabilities. Notably, the accuracy for the first answer drops to 49.5% and 7.9% on the GSM8K and MATH benchmarks, respectively. We find that simply scaling up the SFT data can significantly enhance the reliability of generating correct answers. However, the potential for extensive scaling is constrained by the scarcity of publicly available math questions. To overcome this limitation, we employ synthetic data, which proves to be nearly as effective as real data and shows no clear saturation when scaled up to approximately one million samples. This straightforward approach achieves an accuracy of 82.6% on GSM8K and 40.6% on MATH using LLaMA-2 7B models, surpassing previous models by 14.2% and 20.8%, respectively. We also provide insights into scaling behaviors across different reasoning complexities and error types.
Motivation & Objective
- To investigate whether common 7B language models like LLaMA-2 7B possess strong mathematical reasoning abilities without specialized pre-training.
- To address the instability in generating correct answers despite inherent capabilities, especially when relying on a single generation.
- To explore the scalability of supervised fine-tuning (SFT) data for improving mathematical reasoning reliability.
- To evaluate the effectiveness of synthetic math questions as a scalable alternative to real data for SFT.
- To analyze scaling behaviors across different reasoning complexities and error types in mathematical problem-solving.
Proposed method
- Used the LLaMA-2 7B model as a base, leveraging its pre-trained weights without additional pre-training on math-specific data.
- Employed a two-stage approach: first, evaluated model performance via sampling 256 generations per question to select the best answer; second, applied supervised fine-tuning (SFT) on curated math question datasets.
- Generated synthetic math questions using GPT-4 Turbo via a 'brand-new' generation strategy, prompting it to create novel problems based on existing ones.
- Applied a GPT-4 Turbo-based verifier to filter and ensure the quality of synthetic questions, improving training data reliability.
- Scaled SFT data from real datasets (GSM8K and MATH) and synthetic data up to ~1 million samples to study performance trends.
- Conducted ablation studies on question verification and data size to isolate the impact of data quality and quantity on model performance.
Experimental results
Research questions
- RQ1Can a 7B-parameter language model like LLaMA-2 7B exhibit strong mathematical reasoning without specialized pre-training or fine-tuning?
- RQ2Why does the model fail to consistently generate correct answers despite high accuracy when selecting from multiple generations?
- RQ3How does scaling supervised fine-tuning (SFT) data impact the stability and accuracy of mathematical reasoning in small language models?
- RQ4To what extent can synthetic math questions match the effectiveness of real math questions in improving model performance?
- RQ5How do different types of errors (e.g., calculation vs. logical reasoning) scale with increasing SFT data size?
Key findings
- The LLaMA-2 7B model achieves 97.7% accuracy on GSM8K and 72.0% on MATH when selecting the best answer from 256 random generations, indicating strong inherent mathematical capabilities.
- With only one generation per question, accuracy drops to 49.5% on GSM8K and 7.9% on MATH, revealing a significant instability issue in consistent output generation.
- Scaling SFT data from real datasets improves performance almost linearly, with no sign of saturation even at 7.5K samples on GSM8K and MATH.
- Synthetic SFT data is nearly as effective as real data: using 7.5K synthetic samples achieves 49.5% on GSM8K and 7.9% on MATH, comparable to real data at similar scale.
- Scaling synthetic data to ~1 million samples results in 82.6% accuracy on GSM8K and 40.6% on MATH, surpassing previous models by 14.2% and 20.8% respectively.
- Question verification using GPT-4 Turbo improves performance on MATH by 0.8–1.0 percentage points, with a more pronounced effect on harder problems, while having minimal impact on GSM8K.
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.