Introduction
In the era of Large Language Models (LLMs), the "garbage in, garbage out" principle has driven researchers to focus heavily on data filtering and deduplication. However, a critical initial step has often been overlooked: the extraction of text from raw HTML. Researchers from the Shanghai AI Laboratory argue that traditional heuristic-based scrapers act as a hidden ceiling on model performance. To address this, they have released AICC, a massive 7.3-trillion token multilingual corpus built using a specialized model-based parser, MinerU-HTML.
The Extraction Bottleneck
Most large-scale datasets, such as FineWeb or RefinedWeb, rely on rule-based tools like Trafilatura or Resiliparse. These tools use simple heuristics, such as text density, to distinguish main content from boilerplate (ads, menus, sidebars). While efficient, these rules frequently mangle structured data. Code blocks lose indentation, mathematical formulas lose LaTeX delimiters, and tables are flattened into unreadable strings. These "extraction artifacts" degrade the quality of pretraining data, particularly for reasoning and technical domains.
MinerU-HTML: A Model-Based Parser
To overcome the limitations of heuristics, the authors developed MinerU-HTML, a 0.6B-parameter decoder-only language model (based on Qwen3). Unlike rule-based systems, MinerU-HTML treats content extraction as a sequence labeling problem.
The pipeline consists of three main stages:
- Pre-processing: Raw HTML is simplified by removing non-content tags and chunking blocks to create a compact input for the model.
- Classification: The 0.6B model classifies each block as "main content" or "other," leveraging its semantic understanding to preserve narrative flow.
- Post-processing: The system projects labels back to the original HTML structure, pruning "other" blocks and assembling a valid DOM subtree (Main-HTML) that preserves structural integrity.
Scaling and Iterative Refinement
Processing hundreds of billions of web pages with a GPU-heavy model is computationally expensive. The researchers employed template-aware optimization to scale. By clustering pages by subdomain, they ran the model on a single representative page to derive extraction rules (XPath/CSS), which were then applied to the rest of the cluster using fast CPU processing. This allowed them to process the entire web while only running the model on 0.4% of total pages.
To ensure high precision, the parser was refined through an iterative loop. An "LLM-as-a-judge" identified potential "badcases" in pair-wise document comparisons, which were then human-verified to create a high-quality training set for subsequent model iterations.
Results and Impact
The resulting AICC corpus contains 7.3 trillion tokens. Evaluation on the new WebMainBench—a benchmark of 7,887 human-annotated pages—showed that MinerU-HTML significantly outperforms traditional tools. It achieved a ROUGE-N F1 score of 81.82%, compared to Trafilatura’s 63.58%.
The impact on technical content is even more pronounced. MinerU-HTML achieved 90.93% edit similarity for code blocks (vs. 13.05% for Trafilatura) and 93.99% for formulas (vs. 61.07%). In controlled pretraining experiments, models trained on AICC outperformed those trained on FineWeb and RefinedWeb by an average of 1.08 percentage points across 13 benchmarks, with the most significant gains in reading comprehension and general knowledge.
Conclusion
The AICC project demonstrates that how we extract text is as important as what we filter. By moving from heuristic rules to model-based semantic extraction, researchers can preserve the structural and contextual nuances of the web, creating a "virtuous cycle" where better parsers lead to better models, which in turn can be used to build even better parsers.
Summary updated