Exploring the Mystery of Influential Data for Mathematical Reasoning

Xinzhe Ni, Yeyun Gong, Zhibin Gou, Yelong Shen, Yujiu Yang, Nan Duan, Weizhu Chen · DOI

Abstract

Fine-tuning Large Language Models (LLMs) for specialized tasks like mathematical reasoning often relies on the quality rather than the quantity of data. This paper introduces Quality-aware Diverse Selection (QaDS), a method that identifies influential data by balancing structural diversity with a novel "one-shot influence" quality metric. By curating the OpenMathMix dataset, the authors demonstrate that a 7B-parameter model can achieve state-of-the-art performance (48.8% on the MATH benchmark), outperforming larger specialized models.

Introduction

The "Less Is More" hypothesis suggests that a small, high-quality dataset is often superior to a massive, noisy one for fine-tuning LLMs. While this has been validated for general instruction-following, its application to mathematical reasoning remains under-explored. Mathematical reasoning requires specific logical structures that general quality metrics—such as perplexity or sentence length—fail to capture. This research addresses how to identify data points that effectively "teach" reasoning and determines the optimal mixture of math-specific and general-purpose data.

Methodology: Quality-aware Diverse Selection (QaDS)

The researchers propose QaDS, a selection strategy that optimizes for both diversity and quality.

Diversity via K-center Greedy

To ensure broad coverage of the problem space, the method employs a K-center Greedy algorithm. This approach iteratively selects data points that are furthest from the existing pool in the embedding space, preventing the selection of redundant samples and ensuring the model encounters a wide variety of mathematical concepts.

Quality via One-shot Influence

The core innovation is the definition of quality as "one-shot influence." A sample $x$ is considered high-quality if, when used as a one-shot prompt, it significantly improves the LLM's performance on other problems compared to a zero-shot baseline. To handle the computational cost of scoring millions of pairs, the authors trained a proxy Quality Scorer to predict these influence scores across massive datasets.

The QaDS pipeline integrates diversity-based sampling with a quality scorer trained on one-shot influence to select the most impactful training samples.

Experimental Setup and Datasets

The study utilized two primary data pools:

  • $S_{base}$ (428K samples): A combination of eight math datasets (e.g., GSM8K, MATH) and two general instruction datasets (CoT, Evol-Instruct).
  • $S_{large}$ (5.0M samples): An expanded pool including OpenMathInstruct-1, MetaMath, and MMIQC.

From these pools, the authors curated OpenMathMix, an optimized mixture of influential data selected via the QaDS strategy.

Results and Discussion

The OpenMathMix dataset enabled a 7B-parameter base model to achieve 48.8% accuracy on the MATH benchmark, surpassing specialized models like WizardMath and ToRA-Coder.

Comparison with Baselines

QaDS consistently outperformed other data selection strategies, including random sampling, Instruction-Following Difficulty (IFD), and Deita. The results indicate that the combination of diversity and one-shot influence is more effective than optimizing for either factor in isolation.

Performance comparison of QaDS against various data selection baselines, demonstrating superior accuracy across different data sizes.

Key Insights

  • The Role of General Data: Including general-purpose Chain-of-Thought (CoT) data, when selected via QaDS, provides greater performance gains than simply increasing the volume of math-specific data.
  • Reasoning Quality: High-scoring samples typically feature complete, multi-step reasoning paths, whereas samples lacking reasoning steps or relying solely on code received lower scores.
  • Model Agnosticism: Influence scores appear to be a property of the data itself; a scorer trained on one model (e.g., DeepSeek) effectively selects data for fine-tuning other architectures (e.g., Mistral or LLaMA).

Conclusion

QaDS provides a robust framework for identifying influential data in reasoning-heavy domains. By focusing on "one-shot influence," researchers can curate high-impact datasets that significantly reduce the computational cost of fine-tuning while achieving state-of-the-art results. Future work will explore the application of QaDS to other specialized fields such as formal logic and code generation.

Summary updated

BibTeX
@inproceedings{ni2024exploring,
  author = {Xinzhe Ni and Yeyun Gong and Zhibin Gou and Yelong Shen and Yujiu Yang and Nan Duan and Weizhu Chen},
  title = {{Exploring the Mystery of Influential Data for Mathematical Reasoning}},
  booktitle = {COLM},
  year = {2024},
  url = {https://openreview.net/forum?id=taThoOlDNQ},
}
Figure