Abstract
Pre-training Large Language Models (LLMs) on high-quality, meticulously curated datasets is widely recognized as critical for enhancing their performance and generalization capabilities. This study explores the untapped potential of Common Crawl as a comprehensive and flexible resource for pre-training LLMs, addressing both general-purpose language understanding and specialized domain knowledge. We introduce RedStone, an innovative and scalable pipeline engineered to extract and process data from Common Crawl, facilitating the creation of extensive and varied pre-training datasets. Unlike traditional datasets, which often require expensive curation and domain-specific expertise, RedStone leverages the breadth of Common Crawl to deliver datasets tailored to a wide array of domains. In this work, we exemplify its capability by constructing pre-training datasets across multiple fields, including general language understanding, code, mathematics, and question-answering tasks. The flexibility of RedStone allows for easy adaptation to other specialized domains, significantly lowering the barrier to creating valuable domain-specific datasets. Our findings demonstrate that Common Crawl, when harnessed through effective pipelines like RedStone, can serve as a rich, renewable source of pre-training data, unlocking new avenues for domain adaptation and knowledge discovery in LLMs.
Introduction
While the "Scaling Laws" of AI suggest that larger datasets lead to superior models, the industry is increasingly encountering a "quality wall." General web scrapes like Common Crawl are vast but often saturated with low-quality content, such as SEO spam, boilerplate code, and incoherent fragments. Furthermore, high-quality domain-specific data—such as clean mathematical proofs or code interleaved with natural language explanations—is frequently locked behind paywalls or requires expensive manual annotation.
RedStone addresses this challenge by providing a scalable data curation pipeline designed to transform the noisy "wild west" of Common Crawl into high-quality, domain-specific training data. By meticulously filtering and extracting 3.48 trillion tokens across general web, code, mathematics, and QA domains, RedStone demonstrates that web data can rival or exceed the performance of specialized, proprietary datasets when properly refined.
The RedStone Pipeline
The RedStone pipeline is built on two primary modules: Extraction and Filtering. The Extraction module manages the transition from raw web formats (WARC/HTML and WET/plain text) into training-ready formats. A key innovation here is the interleaved approach: rather than scraping raw code or math files in isolation, RedStone extracts these snippets along with the surrounding discussions and explanations found on the webpage. This provides the model with critical context—turning a standalone equation into a lesson.
The Filtering module employs a two-stage process to ensure data quality:
- Rule-based Filtering: Heuristics such as keyword analysis, word length, and stop-word ratios are used to discard obvious junk, such as pages consisting primarily of link lists or ellipsis.
- Model-based Filtering: Lightweight classifiers, including fastText and a 1.6B parameter transformer model trained on GPT-4 labels, score the "educational value" and "knowledge density" of the remaining text.
This process is highly selective; to reach the final token count, the pipeline discarded over 99% of the original tokens in Common Crawl, highlighting the extreme sparsity of high-quality data on the open web.
Dataset Composition and Evaluation
Using 93 Common Crawl snapshots from 2013 to 2023, the authors constructed four major datasets. These datasets were evaluated against industry standards such as FineWeb, RefinedWeb, and DCLM.
Key Results
Training 1.3B and 1.6B parameter models on these datasets yielded significant performance gains:
- General Reasoning: RedStone-Web achieved an average score of 0.4310 across common-sense benchmarks (ARC, HellaSwag), outperforming FineWeb-Edu (0.4279) and DCLM (0.4013).
- Coding Proficiency: The inclusion of RedStone-Code led to a dramatic improvement in the HumanEval benchmark (pass@1), rising from 1.25% to 5.55%.
- Mathematics: RedStone-Math, which utilizes syntactic validation via LaTeX parsers, achieved superior perplexity on GSM8k and MATH benchmarks compared to specialized datasets like OpenWebMath.
- Question Answering: The RedStone-QA dataset provided a 14.47% improvement over the baseline model on MMLU scores.
Discussion and Conclusion
The RedStone project underscores that "structure is the signal." By processing raw HTML (WARC files) rather than just plain text, the pipeline can leverage tags (like <pre> or <tbody>) to identify high-value content that text-only scrapers might mangle.
While currently focused on English-language text and code, future work aims to expand RedStone into multilingual and multimodal domains (incorporating images, audio, and video). Additionally, the authors suggest implementing real-time update mechanisms to combat "temporal decay," ensuring that LLM training data remains current with the rapidly evolving web. Ultimately, RedStone proves that with the right refinery, the open web remains a powerful, renewable resource for the continued evolution of LLMs.
Summary updated