Craw4LLM: Efficient Web Crawling for LLM Pretraining

Shi Yu, Zhiyuan Liu, Chenyan Xiong

Abstract

Current web crawling strategies for Large Language Model (LLM) pretraining are fundamentally inefficient, often fetching billions of pages only to discard over 90% during post-processing. This "crawl-then-filter" approach stems from a reliance on graph-based popularity metrics like PageRank, which are poor proxies for pretraining data quality. We introduce CRAW4LLM, an influence-aware crawler that integrates quality scorers directly into the discovery process. By exploiting "quality homophily"—the tendency of high-quality pages to link to one another—CRAW4LLM achieves the same downstream performance as traditional methods while crawling only 21% of the URLs.

The Inefficiency of Popularity-Based Crawling

The standard recipe for building high-quality pretraining datasets involves massive crawls (e.g., Common Crawl) followed by aggressive heuristic and model-based filtering. Traditional crawlers prioritize the "frontier" of unvisited URLs using metrics like indegree (the number of incoming links) or PageRank. While these metrics effectively identify popular websites for search engines, they are poorly aligned with the educational or linguistic value required for LLM pretraining.

Correlation between graph metrics and pretraining influence scores. Indegree shows almost no correlation with pretraining value (-0.11), whereas it correlates strongly with PageRank (0.88).

As shown in the figure above, a page's popularity in the web graph (indegree) has a negligible correlation (-0.11) with its "pretraining influence score"—a metric of its utility for training models. This misalignment leads to significant "crawling waste," consuming unnecessary bandwidth, storage, and energy.

CRAW4LLM: Influence-Aware Discovery

CRAW4LLM shifts the filtering step from the end of the pipeline to the very beginning. Instead of graph connectivity, it uses a lightweight pretraining influence scorer (such as DCLM fastText or FineWeb-Edu) to rank URLs in the crawler's scheduler.

The process follows three main steps:

  1. Scoring: As the crawler identifies outlinks from a visited page, it predicts the quality of the target content using the influence scorer.
  2. Priority Scheduling: URLs are placed in a priority queue based on these scores, ensuring the crawler always visits the most promising pages first.
  3. Iterative Refinement: The crawler continuously updates its frontier, "tunneling" toward high-quality clusters of the web.

The Principle of Quality Homophily

The success of CRAW4LLM relies on a key empirical observation: quality homophily. Much like social networks exhibit "birds of a feather" behavior, high-quality webpages tend to link to other high-quality webpages.

Evidence of quality homophily: A page's own quality score correlates positively with the average quality score of its 2-hop outlinks.

This correlation allows the crawler to find "gold mines" of data. By following links from high-scoring pages, CRAW4LLM can navigate the web graph more effectively than a random or popularity-based crawler, which might get stuck in "low-quality neighborhoods" of the internet.

Key Results and Performance

The researchers evaluated CRAW4LLM using a simulation on the ClueWeb22-A dataset (900 million pages). The results demonstrate a step-change in efficiency:

  • 79% Reduction in Crawling: CRAW4LLM reached the same downstream performance on 23 benchmarks as traditional crawlers while fetching only 21% of the total URLs.
  • Superior Data Quality: At a fixed data budget (1x), LLMs trained on CRAW4LLM-curated data significantly outperformed those trained on data from indegree-based crawlers.
  • Outperforming "Crawl-then-Filter": Even when a traditional crawler was allowed to collect 4x more data and then filter it down to the same size, CRAW4LLM's "filter-at-source" approach produced a more capable model.
  • Oracle Proximity: CRAW4LLM achieved over 95% of the performance of a theoretical "Oracle" crawler while visiting only a tiny fraction (2.2%) of the total available web graph.

Conclusion and Future Directions

CRAW4LLM demonstrates that the "crawl-then-filter" paradigm is no longer necessary for LLM pretraining. By moving quality assessment upstream, developers can drastically reduce the environmental and computational costs of data collection.

Future work includes testing CRAW4LLM on the live, dynamic web and integrating these influence-aware strategies into production-grade crawling engines like Apache Nutch. While the computational overhead of running a classifier on every URL is a consideration, the massive savings in downstream processing and storage make it a compelling strategy for the next generation of AI models.

Summary updated

BibTeX
@inproceedings{yu2025craw,
  author = {Shi Yu and Zhiyuan Liu and Chenyan Xiong},
  title = {{Craw4LLM: Efficient Web Crawling for LLM Pretraining}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure