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:
- Coarseness: Rules usually drop or keep a whole page. If a page has one great paragraph buried in ads, it’s often discarded.
- 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.
- Error Propagation: If the initial scraper fails to extract the right text, no subsequent filter can fix it. Errors compound down the pipeline.
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:
- Dripper (0.6B): A structure-based extraction teacher.
- Qwen3.8-27B: A semantic refining teacher that identifies noise within the text.
- 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.
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-120bwas 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
REWRITEoperation 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).
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