Abstract
High-quality web data is the foundational requirement for training Large Language Models (LLMs), yet extracting clean main content from raw HTML remains a significant challenge. Traditional heuristic methods often fail on complex modern layouts, while massive LLMs are computationally expensive and prone to hallucinations. We introduce Dripper, a lightweight framework that utilizes a 0.6B parameter Small Language Model (SLM) to achieve extraction accuracy comparable to frontier models like GPT-4, but at a fraction of the cost. By reframing extraction as a constrained sequence labeling task and utilizing a dual-branch representation, Dripper prunes 84% of input tokens, enabling high-speed, high-fidelity web-scale data curation.
Introduction
The curation of web-scale datasets faces a persistent "trilemma": the need for semantic reasoning to understand complex layouts, computational efficiency to process billions of pages, and strict fidelity to ensure the extracted text remains unaltered. Traditional tools like Trafilatura are efficient but struggle with structural noise such as advertisements or sidebars. Conversely, using state-of-the-art LLMs for extraction is prohibitively expensive and limited by context window constraints.
Dripper addresses these challenges by specializing a small language model (SLM) for the specific task of identifying main content blocks within a page's structure, rather than generating the text from scratch.
The Dripper Framework
The core innovation of Dripper is its Dual-Branch Representation and its shift from generative extraction to classification-based labeling.
Dual-Branch Strategy
Instead of feeding raw, noisy HTML into the model, Dripper splits the input into two parallel, aligned sequences:
- Simplified HTML: This branch aggressively prunes visual noise, such as style tags and non-essential attributes. This reduction allows the 0.6B model to process the entire structure of long pages within a standard context window.
- Mapping HTML: This branch retains full DOM fidelity. It is not processed by the model but serves as a reference at the end of the pipeline to reconstruct the final output with 100% fidelity to the source.
Constrained Sequence Labeling
Rather than asking the model to rewrite the content, Dripper requires the model to label blocks of the Simplified HTML as either "main" or "other." To ensure reliability, the framework employs Regex-Based Constrained Decoding, forcing the model to output a valid JSON map of block IDs. This eliminates the risk of the model "hallucinating" or altering the original text.
Evaluation and Benchmarking
To rigorously test the framework, the authors introduced WebMainBench, a high-precision benchmark consisting of 7,809 human-annotated pages across 46 languages. Unlike previous benchmarks that focused on plain text, WebMainBench is annotated at the HTML tag level, allowing for precise evaluation of structural preservation.
The underlying model, Dripper-0.6B (based on the Qwen architecture), was fine-tuned on nearly 1 million diverse web samples using a "Layout-Aware Sampling" strategy to ensure robustness across various web designs.
Key Results and Impact
Dripper-0.6B achieved an F1 score of 0.8779 on WebMainBench, significantly outperforming traditional tools (Trafilatura: 0.6402) and approaching the performance of proprietary giants like GPT-4.
Efficiency and Cost Reduction
The dual-branch strategy provides a massive reduction in computational overhead. By focusing the model's attention on the "skeleton" of the page rather than the full text, the input token count is reduced by an average of 84.4%.
As shown in the data above, the computational cost (measured in FLOPs) is reduced to just 4.42% of a naive LLM extraction approach. This efficiency allows Dripper to reach a throughput of 3.08 pages per second on a single A100 GPU, making it viable for massive dataset curation.
Infrastructural Value
The authors demonstrated that better extraction directly improves downstream model performance. A 1B parameter model pre-trained on 63 billion tokens curated by Dripper significantly outperformed versions trained on data from traditional tools, proving that high-fidelity extraction is a critical bottleneck in foundation model training.
Conclusion
Dripper proves that specialized Small Language Models, when paired with intelligent data representations, can match the reasoning capabilities of much larger models for specific structural tasks. Future work will focus on improving the handling of complex nested tables and LaTeX equations, further scaling the framework to support the next generation of high-quality AI training data.
Summary updated