An Integrated Data Processing Framework for Pretraining Foundation Models

Yiding Sun, Feng Wang, Yutao Zhu, Wayne Xin Zhao, Jiaxin Mao · OpenReview

Introduction

The performance of foundation models is heavily dictated by the quality of their pretraining data. However, the process of cleaning and preparing these datasets is often fragmented, manual, and opaque. Researchers frequently build bespoke pipelines for different data sources, leading to repetitive effort and a lack of standardized quality metrics. This paper introduces a unified, flexible framework designed to automate and streamline this "messy" process through an iterative loop of data processing and analysis.

The Integrated Framework

The proposed framework consists of two symbiotic modules that allow for a systematic, reproducible engineering process.

Processing Module

The "engine room" of the framework standardizes and cleans data through four key components:

  • Reformatter: Converts diverse sources into a unified jsonlines format.
  • Filter: Discards low-quality text using heuristic rules and model-based metrics like perplexity.
  • Cleaner: Strips noise such as HTML tags and advertisements using regex and exact matching.
  • Deduplicator: Employs MinHash LSH to remove near-duplicate documents, preventing overfitting and the "double descent" phenomenon.

Analyzing Module

The "control tower" enables researchers to inspect data quality iteratively:

  • Evaluator: Visualizes distributions of text length, language, and perplexity.
  • Retriever: Uses ElasticSearch and BM25 to verify the presence of specific entities or niche knowledge.
  • Debugger: Fine-tunes cleaning parameters by showing which documents are captured by specific filters.
Overview of the integrated data processing framework, illustrating the iterative loop between the Analyzing and Processing modules.

Experimental Evaluation

The framework was validated using subsets of The Pile (OpenWebText2, Wikipedia, HackerNews) and a version of CommonCrawl for end-to-end pretraining of a 110M parameter GPT-2 model.

Training Efficiency and Performance

The impact of data refinement is most evident in training efficiency. A model trained on refined data (GPT-2-ref) achieved the same validation loss in just 0.25M steps that the baseline model (trained on raw data) required 2M steps to reach—representing an 8x improvement in compute efficiency.

Training curves for GPT-2 models. The refined data (orange) leads to significantly faster convergence and lower perplexity compared to the raw data baseline (blue).

Beyond efficiency, the refined model demonstrated superior performance across multiple downstream benchmarks. For instance, on the LAMBADA dataset, perplexity dropped from 134.04 to 122.43. Automated evaluations using ChatGPT also confirmed that processed data was consistently preferred over raw data across all tested domains, particularly in noisier datasets like HackerNews.

Conclusion

By shifting data curation from an "art" to a systematic engineering process, this framework significantly reduces the manual effort and compute cost associated with training foundation models. While aggressive cleaning improves quality, it also reduces token volume; future work will focus on balancing these factors and scaling the framework to handle multi-terabyte datasets.

Summary updated

BibTeX
@inproceedings{sun2024integrated,
  author = {Yiding Sun and Feng Wang and Yutao Zhu and Wayne Xin Zhao and Jiaxin Mao},
  title = {{An Integrated Data Processing Framework for Pretraining Foundation Models}},
  booktitle = {International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year = {2024},
  url = {https://openreview.net/forum?id=ll7iLP7QJD},
}
Figure