DataMan: Data Manager for Pre-training Large Language Models

Ru Peng, Kexin Yang, Yawen Zeng, Junyang Lin, Dayiheng Liu, Junbo Zhao

Abstract

As Large Language Models (LLMs) approach the "data wall," the focus of pre-training has shifted from sheer volume to data quality. Traditional human-defined heuristics and computationally expensive pairwise comparisons often fail to scale or capture the nuances of high-quality text. We present DataMan, a framework that utilizes "reverse thinking" to allow LLMs to define their own quality criteria. By training a specialized 1.5B parameter "Data Manager" model to perform pointwise scoring across 14 derived quality dimensions, we demonstrate that models can achieve superior performance with significantly less data. A 1.3B parameter model trained on 30B tokens selected by DataMan outperforms uniform sampling on 45B tokens and surpasses existing state-of-the-art selection methods.

Introduction

The "Scaling Laws" of AI have historically emphasized increasing compute and data volume. However, high-quality human-written text is a finite resource. Current data filtering methods often rely on simplistic rules (e.g., word length) or "black box" classifiers that lack transparency and granularity. While recent approaches like Qurating use pairwise comparisons to rank data, the $N^2$ complexity of such methods makes them impractical for the trillions of tokens required for modern LLM pre-training.

DataMan addresses these challenges by automating the discovery of quality traits. Instead of imposing human biases, it asks a "Super LLM" to analyze why certain documents are easy or difficult for a model to predict (perplexity anomalies). This process yields a comprehensive set of criteria that can be used to score and select data efficiently.

Methodology: The DataMan Framework

The DataMan pipeline consists of four primary stages designed to transform raw web-scale corpora into high-quality training sets.

The DataMan framework pipeline, illustrating the reverse thinking process and the automated data annotation and selection workflow.

1. Reverse Thinking and Criteria Derivation

The researchers identified documents with the highest and lowest Perplexity (PPL). A "Super LLM" (GPT-4) was prompted to analyze these extremes and explain the underlying factors contributing to the PPL scores. This "reverse thinking" led to the identification of 14 quality criteria, including Accuracy, Coherence, Knowledge Novelty, Semantic Density, and an "Overall Score." Additionally, 15 domain categories (e.g., Law, Finance) were established to facilitate balanced data mixing.

2. Pointwise Rating

To ensure scalability, DataMan employs pointwise rating rather than pairwise comparison. Each document is assigned a scalar score (1–5) for each criterion. This reduces the computational complexity from $N^2$ to $N$, making it feasible to process billions of tokens.

3. Training the Data Manager

A Qwen2-1.5B model was fine-tuned on 35,700 documents annotated by GPT-4. This specialized "Data Manager" can then be deployed to rapidly score massive datasets like SlimPajama. The resulting annotated dataset, DataPajama (447B tokens), provides a rich resource for targeted data selection.

Experimental Results

The effectiveness of DataMan was evaluated by training a 1.3B parameter Sheared-LLaMA model on various data subsets.

Performance and Efficiency

The results indicate that DataMan-selected data is significantly more "dense" in information value. A model trained on 30B tokens with an "Overall Score" of 5 outperformed a baseline model trained on 45B tokens (a 50% increase in data) using uniform sampling.

Performance comparison of various data selection methods across multiple benchmarks. DataMan's "Overall Score" (l=5) achieves the highest average performance.

As shown in the table above, the "Overall Score" (specifically at level $l=5$) consistently yields the best performance across reading comprehension, commonsense reasoning, and world knowledge tasks. It outperformed the previous state-of-the-art (Qurating's "Educational Value") by up to 4.3% in average task performance.

Instruction Following and Domain Specialization

Beyond base model performance, DataMan-selected models showed a 78.5% win rate against SOTA baselines in instruction-following tasks after fine-tuning. Furthermore, the framework allows for precise domain mixing; by filtering for high-quality data in specific fields like Law or Medicine, researchers could boost domain-specific MMLU scores without degrading general reasoning capabilities.

Discussion and Conclusion

DataMan demonstrates that LLMs can effectively serve as their own "data curators." By moving from perplexity-based filtering to a multi-dimensional, criteria-driven approach, we can overcome the limitations of human heuristics.

However, challenges remain. The framework may inherit biases from the "Super LLM" used for initial annotation. Additionally, while pointwise scoring is efficient, the initial cost of annotating hundreds of billions of tokens is substantial. Future work will explore the scalability of these criteria for larger models (70B+) and further optimize the efficiency of the Data Manager. By releasing the DataPajama dataset, the authors provide a foundation for the community to explore more intelligent, automated data management strategies.

Summary updated

BibTeX
@inproceedings{peng2025dataman,
  author = {Ru Peng and Kexin Yang and Yawen Zeng and Junyang Lin and Dayiheng Liu and Junbo Zhao},
  title = {{DataMan: Data Manager for Pre-training Large Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=eNbA8Fqir4},
}
Figure