ReScraper: Unified Scraping and Cleaning of Web Data for Effective LLM Pretraining

Zichun Yu, Jiarui Yan, Shlok Sanghvi, Nihar Atri, Chenyan XiongarXiv 2026

TL;DR

ReScraper is a compact 0.6B parameter language model designed to replace the entire traditional pipeline of heuristic scrapers and rule-based filters used for LLM pretraining. By unifying extraction, filtering, editing, and rewriting into a single adaptive step, it achieves a 3.8–4.7% relative improvement in downstream accuracy over state-of-the-art baselines, demonstrating that a small model can effectively curate high-quality data for much larger ones.

What Problem Does This Paper Address?

The quality of an LLM is fundamentally limited by the quality of its pretraining data. Currently, cleaning massive web crawls like Common Crawl relies on a "stack" of hand-written heuristics. First, a scraper attempts to pull the main text from messy HTML. Then, dozens of rule-based filters (checking for things like symbol-to-word ratios or line length) decide whether to keep or drop the entire page.

This approach has three major flaws:

  1. Coarseness: Rules usually drop or keep a whole page. If a page has one great paragraph buried in ads, it’s often discarded.
  2. Inaccuracy: Heuristic rules are surprisingly bad at judging what is "worth keeping." As shown in Figure 1a, between 31% and 65% of the pages dropped by common rules are actually judged as valuable by stronger LLMs.
  3. Error Propagation: If the initial scraper fails to extract the right text, no subsequent filter can fix it. Errors compound down the pipeline.
Figure 1: Keep-or-drop decisions on 5,000 pages la- belled by gpt-oss-120b (Agarwal et al., 2025). (a) Share of the pages each rule drops that are worth keeping. (b) Keep–drop accuracy (agreement of each pipeline’s keep or drop with the judge’s label) against average down- stream accuracy of 1.4B model pretraining.

Methods

The authors propose ReScraper, a single 0.6B parameter model (based on Qwen3-0.6B) that takes raw, line-numbered text from HTML and outputs a sequence of cleaning operations.

Instead of just "keep" or "drop," ReScraper can choose from four distinct operations:

  • KEEP: The extracted text is clean and ready.
  • DELETE: The page is valueless (e.g., spam, pure navigation).
  • EDIT: The model identifies specific noisy lines or spans to remove while keeping the rest.
  • REWRITE: If a page is informative but poorly written (e.g., a messy forum post), the model generates a clean, faithful paraphrase.

To train this "student" model, the authors used Supervised Fine-Tuning (SFT) with data curated from three "teacher" models:

  1. Dripper (0.6B): A structure-based extraction teacher.
  2. Qwen3.8-27B: A semantic refining teacher that identifies noise within the text.
  3. RePro-1B: A rewriting teacher that rescues educational content.

The training happened in two stages: first learning the basic removal operations, then strengthening the model's ability to perform complex rewrites.

Figure 2: Overview of ReScraper's unified architecture vs. the traditional heuristic stack.

Datasets

  • Source Data: 18.0 million English Common Crawl documents (approx. 17.69B tokens).
  • Training Data: 1.38M SFT targets in Stage 1 and 131K targets in Stage 2.
  • Evaluation: The DCLM Core benchmark, which averages accuracy across 22 downstream tasks (reasoning, language understanding, etc.).
  • Judge Model: gpt-oss-120b was used as an independent "LLM-as-a-judge" to evaluate the quality of the curated pages.

Key Insights and Ideas

  • Weak-to-Strong Curation: One of the most significant findings is that a tiny 0.6B model can curate data that improves the performance of much larger models (up to 2.8B). This suggests that data curators don't necessarily need to scale in size alongside the models they are training.
  • Unification is Key: Performing extraction and cleaning in a single pass outperforms a "cascade" of separate models. Because ReScraper sees the raw input, it can make more holistic decisions and avoid the "compounding error" problem of multi-stage pipelines.
  • Rescuing "Trash": The REWRITE operation is a game-changer. Rather than just filtering out low-quality web text, ReScraper transforms it into high-quality training data, preserving information that would otherwise be lost.
  • Efficiency: Despite its sophistication, ReScraper is highly efficient, using only about a third of the GPU hours required by the Dripper scraper alone.

Key Results

ReScraper consistently outperformed all baselines, including widely used rule-sets like C4, RefinedWeb, and FineWeb, as well as complex multi-agent systems.

  • Downstream Performance: Pretraining a 1.4B model on ReScraper-curated data improved the DCLM Core score by 7.9% relative over the strongest rule-based baseline.
  • Comparison to Multi-Agent Systems: It outperformed DataOrchestra (a pipeline using 1.7B, 0.6B, and 4B models) by 6.6% relative at the 1.4B scale, despite being a single, smaller model.
  • Accuracy: ReScraper achieved a "Keep-drop" accuracy of 85%, significantly higher than the 63-76% range of other model-based refiners (see Figure 1b).
Figure 3: DCLM Core scores at 400M and 1B scales, showing ReScraper's consistent lead.

Limitations and Future Work

  • Context Window: The model is limited by its context window (32k tokens). Very long web pages must be truncated, potentially losing information at the end of long documents.
  • Teacher Dependence: The student's performance is inherently capped by the quality of the teacher models used to generate the SFT data.
  • Future Directions: The authors suggest moving toward recursive self-improvement, where each generation of models curates the pretraining data for the next, potentially leading to a virtuous cycle of data and model quality.

Summary updated

BibTeX
@misc{yu2026rescraper,
  author = {Zichun Yu and Jiarui Yan and Shlok Sanghvi and Nihar Atri and Chenyan Xiong},
  title = {{ReScraper: Unified Scraping and Cleaning of Web Data for Effective LLM Pretraining}},
  year = {2026},
  eprint = {2609.34287},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.34287},
}
Figure