Source-linked AI summary
Dripper: Token-Efficient Main HTML Extraction with a Lightweight LM
Mengjie Liu, Jiahui Peng, Wenchang Ning, Pei Chu, Jiantao Qiu, Ren Ma, He Zhu, Rui Min, Lindong Lu, Linfeng Hou, Kaiwen Liu, Yuan Qu, Zhenxiang Li, Chao Xu, Zhongying Tu, Wentao Zhang, Conghui He
TL;DR
Web-scale main-content extraction needs both semantic understanding and computational efficiency because HTML is heterogeneous, lengthy, and vulnerable to generative hallucination. Dripper addresses this with constrained sequence labeling over simplified HTML and aligned reconstruction. On WebMainBench, Dripper-0.6B reaches F1 0.8779, outperforming traditional heuristics and approaching frontier models, while Dripper-curated data improves downstream pre-training performance.
Problem
Existing extractors struggle with heterogeneous HTML, while generative LLMs face context-length, computational-cost, and hallucination barriers at web scale.
Source: §1 · pp. 1–2Method
Dripper uses constrained sequence labeling on token-efficient Simplified HTML and projects predictions onto aligned Mapping HTML for faithful reconstruction.
Source: §1 · p. 2, §3.4 · p. 6Results
Dripper-0.6B achieves F1 0.8779, outperforming Trafilatura at 0.6402 and Resiliparse at 0.6290 while approaching DeepSeek-V3.2, GPT-5, and Gemini-2.5-Pro.
Source: §1 · p. 2Takeaways & Limitations
Dripper-curated data improves downstream performance for a pre-trained 1B model, and the released weights, code, and benchmark support reproducible high-quality corpus construction.
Source: §1 · pp. 2–3Dripper operates within a fixed 32k-token context window, assigning oversized inputs a score of 0 unless the fallback variant invokes Trafilatura.
Source: §5.1 · p. 8
Abstract
from arXiv · showhide
High-quality main content extraction from web pages is a critical prerequisite for constructing large-scale training corpora. While traditional heuristic extractors are efficient, they lack the semantic reasoning required to handle the structural heterogeneity of the modern web. Conversely, well-pretrained generative Large Language Models (LLMs) offer superior document comprehension but are prohibited by excessive computational costs, limited context windows, and hallucination risks when applied at web scale. We present \textbf{Dripper}, a lightweight framework that resolves these bottlenecks through four contributions: (1) We reformulate extraction as a \textbf{constrained sequence labeling} task using SLMs (Small Language Models). This paradigm eliminates generative hallucinations and achieves exceptional efficiency, reaching a throughput of 3.08 pages per second on a single A100 GPU. (2) We construct \textbf{WebMainBench}, a rigorous benchmark of 7,809 human-annotated pages covering 5,434 unique domains and multiple languages. Evaluations show our Dripper-0.6B model \textbf{outperforms} heuristics like Trafilatura and rivals massive models like DeepSeek-V3.2(685B), GPT-5 and Gemini-2.5-Pro, offering an optimal efficiency-accuracy trade-off. (3) We demonstrate infrastructural value by \textbf{pre-training a 1B model} on a Dripper-curated corpus (63B tokens). This model significantly outperforms baselines in downstream tasks, proving the critical role of extraction quality and the effectiveness of our framework. (4) We \textbf{open-source} the Dripper-0.6B weights and codebase to facilitate the construction of high-quality datasets.
1 Introduction
Dripper addresses the difficulty of extracting faithful main content from heterogeneous web HTML by combining lightweight semantic labeling with constrained decoding and parallel representations. It introduces WebMainBench, demonstrates strong efficiency and benchmark performance, shows downstream value for pre-training, and releases its resources.
Motivation
- The framework is motivated by heterogeneous HTML, oversized contexts, lost structural cues, and hallucination risks that constrain heuristic, vision-based, and generative approaches at web scale.Common Crawl analysis found 29.3% of pages exceed 32k tokens and 21.0% exceed 128k tokens.Source: §1 · pp. 1–2
Contributions
- Dripper reframes extraction as constrained sequence labeling with a fixed label space, eliminating generative hallucinations while reaching 3.08 pages per second on one A100 GPU.The approach uses simplified block sequences and SLMs rather than unconstrained generation.Source: §1 · p. 2
- Dripper-0.6B achieves F1 0.8779, outperforming Trafilatura at F1 0.6402 and Resiliparse at F1 0.6290 while approaching DeepSeek-V3.2 at 0.9098, GPT-5 at 0.9024, and Gemini-2.5-Pro at 0.8979.These comparisons are reported on WebMainBench.Source: §1 · p. 2
- WebMainBench contains 7,809 human-annotated pages spanning 5,434 unique domains and multiple languages to support unified evaluation of modern web extraction.The benchmark targets limitations in existing evaluation resources.Source: §1 · p. 2
- A Dripper-curated corpus of approximately 63 billion tokens improves downstream performance when used to pre-train a 1B model compared with baselines trained on data from other tools.This result demonstrates the reported infrastructural value of extraction quality.Source: §1 · p. 2
- The authors publicly release Dripper-0.6B weights, the complete extraction pipeline, evaluation scripts, and WebMainBench.The release is intended to support reproducibility and higher-quality corpus construction.Source: §1 · p. 3
2 Related Work
Main-content extraction has progressed from brittle heuristics and feature-based classifiers toward graph, transformer, hybrid, and generative methods. Dripper instead combines lightweight semantic reasoning with constrained sequence labeling to target the efficiency and fidelity gap.
Heuristic and rule-based Methods
- Heuristic extractors use structural statistics, visual cues, and density features, but their efficiency comes with brittleness as web designs evolve.Examples include CETR, VIPS, Readability, and jusText.Source: §2 · p. 3
Supervised Learning Methods
- Supervised methods improve representation and structural modeling through classifiers, GNNs, and Transformers, but often require substantial labeled data and computational overhead.The cited progression includes Boilerpipe, Dragnet, and WebFormer.Source: §2 · p. 3
Hybrid Systems and Production Tools
- Production tools such as Trafilatura and magic-html blend rules and preprocessing, while crawl4ai combines selectors, machine learning, and LLMs for versatile pipelines.These systems emphasize practical deployment through hybrid architectures.Source: §2 · p. 3
Generative-Language-based Methods
- ReaderLM-v2 treats extraction as HTML-to-Markdown generation, but full-page input and one-pass generation incur heavy overhead and can produce repetitions or unescaped HTML tags.Its pipeline extends context to 512k tokens and uses SFT and DPO.Source: §2 · p. 3
Dripper
- Dripper bridges heuristic speed and LLM semantic reasoning through constrained sequence labeling, using a three-stage pipeline that separates simplified input from faithful reconstruction.The overview uses Simplified HTML for model input and Mapping HTML for reconstruction.Source: Figure 1 · p. 4
3 Methodology
Dripper separates semantic reasoning from content reconstruction through aligned Simplified HTML and Mapping HTML branches. A 0.6B model predicts valid block labels under constrained decoding, which are projected back to preserve the original DOM structure.
3.1 System Architecture Overview
- Dripper’s three-stage architecture converts raw HTML into aligned branches, predicts labels on Simplified HTML, and reconstructs output from Mapping HTML.This design combines token efficiency during reasoning with structural fidelity during reconstruction.Source: §3.1 · p. 4
3.2 Dual-Branch Generation and Reconstruction
- Simplified HTML removes visual noise, prunes attributes, and aggregates semantic blocks while preserving cohesive structures such as tables and lists.Mapping HTML bypasses aggregation to retain precise subtree structure.Source: §3.2 · p. 5
- Simplified HTML reduces mean input length from 44,590 raw tokens to 6,960 tokens, an 84.4% reduction, while Mapping HTML preserves a precise DOM subtree for output.The branches share cleaning and alignment but diverge at block aggregation.Source: §3.2 · p. 5
3.3 Sequential Block Classification Model
- Dripper-0.6B is instantiated from Qwen3-0.6B and fine-tuned on approximately 986k diverse web samples for four epochs.The model uses a 32K context window and supports over 100 languages.Source: §3.3 · p. 5
- Regex-based constrained decoding forces predictions into a JSON mapping from block IDs to binary labels, preventing format hallucinations and repetitive generation loops.This lets the model focus on semantic discrimination while the inference engine enforces syntactic compliance.Source: §3.3 · p. 5, §3.4 · p. 6
3.4 Task Formulation
- The task labels each simplified block as main content or boilerplate, then applies the predicted mask to aligned Mapping HTML blocks to reconstruct the extracted content.The resulting output is defined as a precise subset of the original DOM tree.Source: §3.4 · p. 6
4 Dataset and Benchmark
Dripper uses a staged, diversity-oriented pipeline to build training data and introduces WebMainBench as a structurally faithful benchmark for modern web extraction. The benchmark combines broad coverage, standardized annotation, rich metadata, and canonical Markdown evaluation.
4.1 Training Data Construction
- The training-data pipeline targets broad layout, language, and format coverage through layout-aware sampling, multilingual filtering, and automated annotation.It produces a final corpus of 986,442 samples after quality control.Source: §4.1 · p. 6
- Layout-aware sampling clusters DOM-derived structural features across 107 Common Crawl snapshots and selects representatives from approximately 40 million layout clusters.This yields a structurally diverse candidate pool before later filtering.Source: §4.1 · p. 6
- Multilingual and format filtering reduces candidates to approximately 1 million pages, including 485k English, 487k Chinese, and 50k pages in other languages for annotation.The preceding balanced subset contains 10 million pages.Source: §4.1 · p. 6
4.2 WebMainBench: A Modern High-Precision Benchmark
- WebMainBench contains 7,809 samples and addresses limited scale, outdated web patterns, and inconsistent annotation standards in existing benchmarks.Its construction is designed for modern web extraction evaluation.Source: §4.2 · p. 7, §4.2.2 · p. 7
4.2.1 Composition and Statistics
- The benchmark spans 5,434 domains, 150 top-level domains, and 46 languages, using 90% Common Crawl sampling and 10% high-ranking sites to balance long-tail diversity with professional layouts.GPT-5-based semantic classification covers page types from news articles to complex forums.Source: §4.2.1 · p. 7
4.2.2 Superiority over Legacy Benchmarks
- HTML tag-level annotation provides a unified source of truth for precise boundary evaluation and deterministic conversion to Markdown or text.This structural fidelity removes ambiguity present in plain-text-only benchmarks.Source: §4.2.2 · p. 7
- A unified annotation pipeline applies Contextual Integrity and Human-Generated Content rules, while multidimensional metadata records difficulty, style, and rich-content flags.The metadata supports fine-grained diagnostic analysis.Source: §4.2.2 · p. 7
4.2.3 Evaluation Metrics
- All outputs are converted to canonical Markdown and scored with ROUGE-N F1 using N=5 and jieba tokenization, rather than ROUGE-L, for efficient long-document overlap measurement.The metric standardizes comparison across tools with different output capabilities.Source: §4.2.3 · p. 7
5 Experiments
Across six experiments, Dripper combines token-efficient extraction with constrained decoding to reduce computational cost, outperform extraction baselines, generalize to WCEB, and improve downstream pre-training performance.
5.2 Computational Efficiency Analysis
- Dripper reduces mean input length to 15.61% of raw HTML and mean inference cost to 4.42% of a naive generative baseline through dual compression.The output length is compressed to 17.12% of full content by reformulating extraction as classification.Source: §5.2 · p. 8, Table 1 · p. 8
5.3 Results on WebMainBench
- Dripper achieves 0.8779 overall F1 on WebMainBench, surpassing magic-html at 0.7138 and Trafilatura at 0.6402.On hard pages, Dripper reaches 0.8313 F1 versus magic-html’s 0.6434, and reaches 0.8493 on conversational content versus Trafilatura’s 0.5769.Source: §5.3 · pp. 8–9, Table 2 · p. 10
- Dripper_fallback reaches 0.8925 F1, remaining within one percentage point of GPT-5 at 0.9024 despite using only 0.6B parameters.Frontier-model scores range from 0.89 to 0.91 after those models are integrated into the Dripper pipeline.Source: §5.3 · p. 9
5.4 Generalization on Legacy Benchmarks
- On WCEB, standalone Dripper achieves 0.8156 F1 versus Trafilatura’s 0.7832, while Dripper_fallback reaches 0.8317 under the Html+TEXT protocol.The evaluation adapts structural output to WCEB’s primarily plain-text ground truth.Source: §5.4 · pp. 9–10, Table 3 · p. 11
5.5 Ablation Study
- Overall F1 rises from 0.7875 at 2k training samples to 0.8779 at 986k, while regex-constrained decoding consistently improves performance and structural stability.The Compact output format reduces inference time from 3301 to 2530 seconds, a 23.3% reduction, and regex constraints raise F1 from 0.8726 to 0.8779.Source: §5.5 · pp. 10–11, Table 4 · p. 11, Figure 3 · p. 12
5.6 Impact on Downstream Pre-training
- At 63B training tokens, the Dripper-trained 1B model reaches 50.82% average accuracy across 13 benchmarks, exceeding Trafilatura at 49.74% by 1.08 percentage points.It also surpasses RefinedWeb at 49.13% and FineWeb at 49.61% overall, with a particularly strong General Knowledge result of 47.54% versus 45.61%.Source: §5.6 · pp. 12–13, Figure 4 · p. 13, Table 5 · p. 13
6 Conclusion
Dripper bridges heuristic efficiency and LLM semantic reasoning through constrained sequence labeling, while the paper also derives decoder-only Transformer costs across prefill and decoding. The framework is presented as infrastructure for reducing hallucination risks and deployment costs.
6 Conclusion
- Dripper bridges heuristic speed and LLM semantic reasoning via constrained sequence labeling, mitigating hallucination risks and deployment costs.Source: §6 · p. 14
A Computational Cost Estimation Details
- P ≈12Ld2 approximates model parameters using attention and feed-forward contributions for a Transformer with L layers and hidden dimension d.Source: A Computational Cost Estimation Details · p. 18
A.1 Prefill Phase
- 24Ld2N and 4LdN2 capture per-layer prefill costs from linear transformations and self-attention over an input of length N.Source: §A.1 · p. 18
A.2 Decode Phase
- 24Ld2M captures decode-phase linear transformations, while self-attention processes context length N + i for each generated token.Source: §A.2 · p. 18
A.3 Total Computational Cost
- 24Ld2M + 4LdMN + 2LdM2 estimates total decoder-only inference cost from linear transformations and attention across input and output tokens.The total combines prefill and autoregressive decode costs.Source: §A.3 · p. 19
B Benchmark Construction
WebMainBench combines broad web sampling with explicit annotation principles and multi-stage quality control. The benchmark is positioned alongside diverse extraction baselines spanning heuristics, supervised methods, hybrid systems, and pretrained language models.
B Benchmark Construction
- 90% of WebMainBench samples come from Common Crawl and 10% from top-ranking websites, covering 5,434 unique domains and 5,904 second-level domains.Source: B Benchmark Construction · p. 19
- Annotations include contextually integral article material and human-generated content, while independent sidebars, footers, usernames, and timestamps are excluded.Source: B Benchmark Construction · p. 19
- Each page undergoes initial annotation, independent review and correction, and senior quality assurance, with rendering failures discarded.Source: B Benchmark Construction · p. 19
- Difficulty uses normalized DOM complexity, sparsity, content diversity, and link density, with rich-content tags identifying tables, code, and formulas.Source: B Benchmark Construction · p. 19
C Baseline Methods for Web Content Extraction
- The evaluation compares heuristic, supervised, hybrid, and pretrained-language-model extractors, including Trafilatura and ReaderLM-v2.Source: C Baseline Methods for Web Content… · p. 20, Table 6 · p. 20
D Standard Benchmarks Details
The standard-benchmark section describes WCEB as a legacy, text-oriented evaluation resource and documents the annotation interface and structural schema used for WebMainBench. Together, these components support both historical comparison and precise HTML-grounded evaluation.
D Standard Benchmarks Details
- WCEB aggregates over 3,000 pages from news, blogs, and raw web crawls, with most ground truth represented as plain text rather than structural HTML.Source: D Standard Benchmarks Details · p. 20, Table 7 · p. 21
E Annotation Tool Interface
- The annotation tool lets annotators select DOM elements in a rendered-page pane and verify extracted content through a real-time preview.Source: E Annotation Tool Interface · p. 22, Figure 6 · p. 22
- Ground truth is captured as selected HTML tags directly from the DOM, preserving structural rather than merely textual annotations.Source: E Annotation Tool Interface · p. 22
F WebMainBench Data Schema
- WebMainBench records raw HTML, selected main_html, canonical Markdown conversion, and metadata for difficulty, style, and rich-content flags.Source: F WebMainBench Data Schema · p. 23, Figure 7 · p. 23
G Detailed Benchmark Statistics
WebMainBench is designed for broad coverage across sampling sources, domains, page categories, and languages. Its synthesis prompt explicitly separates core content from interface and metadata elements.
- WebMainBench contains 7,809 samples drawn 90% from Common Crawl and 10% from top-ranking websites.Source: G Detailed Benchmark Statistics · p. 23
- The benchmark spans 5,434 domains and 150 top-level domains, indicating broad geographic and website-category coverage.Source: G Detailed Benchmark Statistics · p. 23
- GPT-5 classification assigns pages diverse semantic categories, including news articles, forums, and product pages.Source: G Detailed Benchmark Statistics · p. 23, Figure 8 · p. 26
- The dataset includes pages in 46 languages, with partial top-ten language statistics reported in Table 10.Source: G Detailed Benchmark Statistics · p. 24, Table 10 · p. 25
- The synthesis prompt instructs extraction to retain core webpage content while removing auxiliary UI, navigation, and metadata elements.Source: G Detailed Benchmark Statistics · p. 27, Figure 9 · p. 27
H Analysis of Classification Metrics
The section prioritizes ROUGE-N because block-level classification metrics can overvalue many tiny blocks while missing a large main-content block. It also details Dripper’s preprocessing pipeline, which compresses HTML while preserving block-aligned information for reconstruction.
H Analysis of Classification Metrics
- ROUGE-N better reflects extraction utility because it weights overlap by information content rather than treating every block equally.A classifier can score highly by labeling many tiny boilerplate blocks correctly while missing one large article block.Source: H Analysis of Classification Metrics · p. 28
- ROUGE-N also maintains consistency with established web-extraction benchmarks that use ROUGE-L or ROUGE-N.Source: H Analysis of Classification Metrics · p. 28
I Detailed Pre-processing Algorithm
- HTML simplification removes boilerplate and most attributes, while preserving semantic markers such as class, id, image src, and alt attributes.The process removes elements including scripts, styles, headers, footers, navigation, and hidden content.Source: I Detailed Pre-processing Algorithm · p. 28
- Semantic block segmentation preserves atomic elements, aggregates inline content, and treats complex tables and lists as single units where appropriate.Source: I Detailed Pre-processing Algorithm · pp. 28–29
- Parallel Simplified and Mapping HTML share block segmentation, allowing compressed model inputs to map labels back to untruncated content for reconstruction.A unique item_id links corresponding blocks across both representations.Source: I Detailed Pre-processing Algorithm · p. 29
J Training configurations
The training-configuration section directs readers to Table 12 for the supervised fine-tuning setup. The table records the specific hyperparameters and training configurations used for the model.
J Training configurations
- The documented setup includes the model’s specific hyperparameters and training configurations.Source: J Training configurations · p. 29
- The configuration information is presented as a table rather than enumerated in the surrounding prose.Source: J Training configurations · p. 29, Table 12 · p. 29
- Table 12 reports the supervised fine-tuning configuration details.Source: Table 12 · p. 29
K Domain-Specific Evaluation Results
Dripper_fallback is robust across the benchmark’s topic and format categories, ranking first and outperforming the strongest existing baseline by about 25%. The standalone Dripper model ranks second and remains ahead of heuristic methods.
K Domain-Specific Evaluation Results
- 0.89 ROUGE-N F1 versus 0.71 for magic-html gives Dripper_fallback an average advantage of approximately 25% across topic and format categories.Source: K Domain-Specific Evaluation Results · p. 30, Table 15 · p. 31
- Dripper_fallback consistently ranks first across diverse topic and format categories.The evaluation covers 24 topics and 24 formats across all 7,809 WebMainBench samples.Source: K Domain-Specific Evaluation Results · p. 30
- The standalone Dripper model consistently ranks second while maintaining a significant lead over heuristic methods.Source: K Domain-Specific Evaluation Results · p. 30
- Tables 13 and 14 provide the detailed ROUGE-N F1 breakdowns for individual formats and topics.Source: K Domain-Specific Evaluation Results · p. 30, Table 13 · p. 30, Table 14 · p. 30