Abstract
We present Autonomous Data Selection (AutoDS), a method that leverages base language models as zero-shot “generative classifiers” to automatically curate high-quality mathematical texts. Unlike prior approaches that require human annotations or training a dedicated data filter, AutoDS relies solely on a model’s logits to determine whether a given passage is mathematically informative and educational. By integrating AutoDS into a continual pretraining pipeline, we substantially boost downstream performance on challenging math benchmarks (MATH, GSM8K, and BBH) while using far fewer tokens than previous methods. Empirically, our approach achieves roughly a twofold improvement in pretraining token efficiency over strong baselines, underscoring the potential of self-directed data selection in enhancing mathematical reasoning. We will release our curated dataset to facilitate future research in automated domain-specific data curation.
Introduction
Building Large Language Models (LLMs) capable of advanced mathematical reasoning requires massive amounts of high-quality, domain-specific text. However, well-curated math corpora are scarce. Current methods for filtering web data typically rely on binary classifiers trained on expensive human annotations or labels from proprietary models like GPT-4. These approaches are often unscalable and fail to capture the fine-grained nuances of educational value, treating all "math-related" content with equal weight regardless of its instructional quality.
Methodology: AutoDS
To address these limitations, we introduce AutoDS (Autonomous Data Selection), a fully autonomous, self-directed data selection pipeline. Instead of training a separate classifier, AutoDS utilizes a strong base language model (e.g., Qwen-72B) as a zero-shot "generative classifier."
Zero-Shot Meta-Prompting
The core of AutoDS involves feeding candidate documents into the base model with a meta-prompt that asks two critical questions regarding the text's mathematical intelligence and educational suitability.
Logit-Based Scoring
Rather than generating a text response, we extract the model's logits (raw, unnormalized predictions) for the "YES" and "NO" tokens. We calculate a continuous LM-Score using a softmax function over these logits:
LM-Score = exp(YES) / (exp(YES) + exp(NO))
The final quality score is the product of the scores for both questions. This results in a granular, real-valued metric from 0 to 1, allowing for precise thresholding. This method circumvents the need for supervised fine-tuning or external reward models, relying instead on the base model's intrinsic statistical confidence.
Experimental Setup
We applied AutoDS to a corpus of 11.26 million documents (~200 GB) from OpenWebMath, arXiv, and the Algebraic Stack, resulting in the filtered AutoMathText dataset. We then continually pretrained three mid-scale models—Gemma-2B, LLaMA2-7B, and Mistral-7B—on approximately 2.5 billion tokens of this auto-selected data.
Evaluation was conducted on math-heavy benchmarks including MATH, GSM8K, and BIG-Bench Hard (BBH), alongside general reasoning tasks to monitor for catastrophic forgetting.
Results and Discussion
AutoDS consistently outperformed sophisticated baselines, including DSIR (KL-divergence based) and QuRating (reward-model based), across all tested models and benchmarks.
Key Findings
- Accuracy Gains: On the Mistral-7B model, AutoDS achieved 16.14% accuracy on the MATH benchmark, significantly higher than the 14.26% achieved by uniform sampling.
- Token Efficiency: AutoDS reached superior performance levels using roughly 2.36x fewer tokens than baseline methods, demonstrating that data quality is a more critical factor than raw volume in domain-specific pretraining.
- Cost-Effectiveness: Curating 11.26 million documents cost under $10,000 in GPU compute, a fraction of the estimated $10 million required for manual expert annotation.
- General Capability Preservation: Performance on general world knowledge and reading comprehension remained stable, indicating that specialized math training does not necessarily degrade general language skills.
Conclusion
AutoDS demonstrates that base models possess an emergent ability to judge the quality of domain-specific data without explicit alignment or human labels. By leveraging continuous logit-based scores, researchers can build highly efficient training curricula. Future work will explore the transferability of this framework to other specialized domains such as code and legal text.
Summary updated