Document Parsing Engines in Production RAG: Comparing Docling, Marker, MinerU, and Unstructured Architecture, Layout Analysis, Table Extraction, and Serving Economics

Retrieval-Augmented Generation (RAG) systems frequently fail not in their embedding models or vector databases, but at the initial document ingestion layer. When enterprise documents (including financial 10-K filings, clinical trial reports, technical manuals, and multi-column academic papers) are parsed using legacy text scrapers such as basic pypdf or pdfminer, structural semantics are lost. Multi-column reading orders interleave across paragraphs, header and footer noise pollutes vector indic

8 min
Document Parsing Engines in Production RAG: Comparing Docling, Marker, MinerU, and Unstructured Architecture, Layout Analysis, Table Extraction, and Serving Economics

Retrieval-Augmented Generation (RAG) systems frequently fail not in their embedding models or vector databases, but at the initial document ingestion layer. When enterprise documents (including financial 10-K filings, clinical trial reports, technical manuals, and multi-column academic papers) are parsed using legacy text scrapers such as basic pypdf or pdfminer, structural semantics are lost. Multi-column reading orders interleave across paragraphs, header and footer noise pollutes vector indices, and nested tables collapse into unaligned token sequences.

To solve this ingestion bottleneck, production RAG architectures increasingly rely on vision-augmented document parsing engines. These frameworks combine computer vision models for layout analysis, optical character recognition (OCR), transformer-based table structure recognition, and structural abstract syntax tree (AST) builders.

This analysis evaluates four leading open-source document parsing frameworks: IBM Docling, Marker, OpenDataLab MinerU, and Unstructured. We examine their architectural designs, benchmark performance across layout detection and Table Tree Edit Distance Similarity (TEDS), downstream chunking strategies, and compute economics.


Architectural Decomposition

Each framework adopts distinct engineering trade-offs regarding model specialization, license permissiveness, and output representations:

1. IBM Docling

  • Primary Maintainer: IBM Research, hosted under the Linux Foundation AI & Data
  • License: MIT
  • Layout Detection: RT-DETR model trained on the DocLayNet dataset
  • Table Extraction: TableFormer dual-decoder vision transformer
  • OCR Backends: EasyOCR, Tesseract, or RapidOCR fallbacks
  • Formula Extraction: LaTeX extraction via layout tagging
  • Output Data Model: Typed DoclingDocument JSON abstract syntax tree and structural Markdown
  • Format Coverage: PDF, DOCX, PPTX, HTML, and ASCIIDoc

2. Marker

  • Primary Maintainer: Datalab (Vik Paruchuri)
  • License: GPL-3.0 / PolyForm Noncommercial
  • Layout Detection: Surya Layout segmentation model
  • Table Extraction: Surya layout heuristics with optional vision-language model post-processing
  • OCR Backends: Surya OCR (line-level transformer covering 90+ languages)
  • Formula Extraction: Native LaTeX equation extraction ($$...$$)
  • Output Data Model: Clean Markdown with embedded LaTeX formulas
  • Format Coverage: PDF, EPUB, and document images

3. OpenDataLab MinerU

  • Primary Maintainer: OpenDataLab / Shanghai AI Lab
  • License: Apache-2.0
  • Layout Detection: DocLayout-YOLO (YOLO-v10 backbone trained on DocSynth300K)
  • Table Extraction: RapidTable and StructEqTable pipelines
  • OCR Backends: PaddleOCR and custom OCR weights
  • Formula Extraction: UniMERNet mathematical expression recognition network
  • Output Data Model: Structured JSON and Markdown
  • Format Coverage: PDF

4. Unstructured

  • Primary Maintainer: Unstructured.io
  • License: Apache-2.0
  • Layout Detection: Detectron2, YOLO, and Chipper layout models
  • Table Extraction: Table Transformer and OCR bounding-box alignment
  • OCR Backends: Tesseract, PaddleOCR, and EasyOCR
  • Formula Extraction: Text-level capture
  • Output Data Model: Flat list of standardized Element objects (Title, NarrativeText, Table, ListItem)
  • Format Coverage: 60+ enterprise document types (PDF, Office files, Email MSG/EML, HTML)

Deep Dive: Core Framework Implementations

IBM Docling

Developed by IBM Research, Docling uses a modular, vision-first pipeline designed to output a deterministic, typed document AST (DoclingDocument).

[Document Page Image]
       │
       ├──> [RT-DETR Layout Model] ──────> Bounding Box & Class Prediction
       │                                     (Text, Header, Table, Code, Formula)
       ├──> [Table Region Crop] ─────────> [TableFormer Dual Decoder]
       │                                     ├──> HTML Table Topology
       │                                     └──> Cell Bounding Box Alignment
       └──> [OCR Engine (if scanned)] ───> Character/Word Token Mapping
                                                     │
                                                     ▼
                                       [Reading Order Topological Sort]
                                                     │
                                                     ▼
                                            [DoclingDocument AST]
                                                     │
                                      ├──> [Hierarchical JSON Export]
                                      ├──> [Structural Markdown]
                                      └──> [HybridChunker RAG Ingestion]
  • Layout Analysis: Docling utilizes a real-time transformer detector (RT-DETR) fine-tuned on the DocLayNet dataset. It classifies bounding boxes across seven element classes: Text, Title, Section-header, Table, Picture, Formula, and List-item.
  • Table Understanding: Its core differentiator is TableFormer, a vision transformer featuring dual decoders. One decoder predicts the topological structure of the table in an HTML-like grammar, while the other regresses normalized bounding boxes for each detected cell. This decoupling allows Docling to accurately parse complex nested headers and merged cells.
  • Hierarchical Representation: Instead of emitting flat text, Docling constructs a rooted tree containing explicit provenance data (page number, bounding coordinates, parent-child heading hierarchy).
Document Parsing Architecture Overview

Marker

Marker is an end-to-end document conversion engine optimized for converting scientific and technical PDFs into clean, LLM-ready Markdown.

  • Surya Model Family: Marker is powered by the Surya model suite. This includes a layout segmentation network, a line-level text recognition model supporting over 90 languages, and a reading-order model that constructs flow graphs across multi-column pages.
  • Formula Parsing: Marker identifies inline and display math, converting complex equations directly into standardized LaTeX blocks.
  • Throughput Profile: By optimizing batch inference across its sub-models, Marker achieves high GPU utilization, making it an efficient pipeline for bulk corpus ingestion when exact table AST hierarchy is secondary to clean Markdown text.

OpenDataLab MinerU

Developed by OpenDataLab and the Shanghai AI Lab, MinerU is a specialized extraction toolkit developed for large-scale pre-training data extraction and scientific document ingestion.

  • DocLayout-YOLO: Layout segmentation uses DocLayout-YOLO, a YOLO-v10-based architecture trained on the DocSynth300K synthetic dataset. It handles dense layouts, complex academic page splits, and multi-tier headings.
  • UniMERNet Formula Recognition: MinerU integrates UniMERNet, a vision-encoder-decoder model designed for mathematical formula recognition, capturing complicated mathematical proofs and matrices.
  • Table Processing: Employs RapidTable and StructEqTable for extracting table structures into HTML and LaTeX formats.

Unstructured

Unstructured serves as a broad ingestion and pre-processing middleware layer for enterprise data platforms.

  • Format Breadth: Unlike PDF-specialized engines, Unstructured unifies ingestion across more than 60 file formats (including DOCX, PPTX, MSG, EML, EPUB, and HTML) into a standardized element taxonomy.
  • Partitioning Strategies: Provides tiered partitioning modes:
  • strategy="fast": Extracts raw text streams from digital documents without running neural networks.
  • strategy="hi_res": Runs layout analysis models (such as Detectron2 or YOLO) alongside OCR (Tesseract or PaddleOCR) to reconstruct visual document flow.
  • Element Taxonomy: Output is structured as an ordered list of Element objects (Title, NarrativeText, Table, Header, Footer, ListItem), with metadata specifying page coordinates and extraction confidence.

Benchmark Comparison: Accuracy and Performance

To evaluate extraction fidelity and production viability, we examine layout detection mAP, table structure reconstruction accuracy, and processing throughput across standard public benchmarks.

1. Table Extraction Accuracy (TEDS)

The standard metric for table extraction accuracy is Tree Edit Distance Similarity (TEDS), which measures both cell content accuracy and topological tree structure (row spans, column spans, and header hierarchy).

  • IBM Docling (TableFormer Accurate): 96.8% overall TEDS on PubTabNet, 91.2% complex table TEDS on FinTabNet, 82.4% table score on OmniDocBench.
  • OpenDataLab MinerU (RapidTable): 93.4% overall TEDS on PubTabNet, 86.7% complex table TEDS on FinTabNet, 83.8% table score on OmniDocBench.
  • Marker (Surya / Heuristic): 78.5% overall TEDS on PubTabNet, 72.1% complex table TEDS on FinTabNet, 74.2% table score on OmniDocBench.
  • Unstructured (hi_res + Table Transformer): 84.1% overall TEDS on PubTabNet, 76.4% complex table TEDS on FinTabNet, 71.8% table score on OmniDocBench.

Docling's TableFormer leads on structured financial tables (FinTabNet), where merged rows and non-standard column headers cause heuristic parsers to misalign numerical data. MinerU demonstrates high performance across scientific tables in the OmniDocBench evaluation suite.

2. Layout Detection Precision (DocLayNet Benchmark)

Layout detection accuracy evaluated on the DocLayNet test suite:

  • DocLayout-YOLO (MinerU): 93.0% AP50, 77.7% mAP (IoU 0.50:0.95)
  • RT-DETR (Docling): 91.4% AP50, 75.2% mAP (IoU 0.50:0.95)
  • Surya Layout (Marker): 87.2% AP50, 71.0% mAP (IoU 0.50:0.95)
  • Detectron2 Layout (Unstructured hi_res): 82.6% AP50, 66.4% mAP (IoU 0.50:0.95)

DocLayout-YOLO and RT-DETR offer strong bounding box precision, avoiding the common failure mode where multi-column text blocks are merged horizontally across column gutters.

3. Processing Latency and Throughput

Processing latency per page across hardware tiers:

  • IBM Docling (Fast Mode): 3.10 seconds/page on x86 single-core CPU, 1.27 seconds/page on Apple M3 Max (Metal), 0.49 seconds/page on Nvidia L4 GPU.
  • IBM Docling (Accurate Mode): 6.80 seconds/page on x86 CPU, 2.45 seconds/page on Apple M3 Max, 0.95 seconds/page on Nvidia L4 GPU.
  • OpenDataLab MinerU: 3.30 seconds/page on x86 CPU, 0.21 seconds/page on Nvidia L4 GPU (high batch CUDA acceleration).
  • Marker: 16.20 seconds/page on x86 CPU, 4.20 seconds/page on Apple M3 Max, 0.86 seconds/page on Nvidia L4 GPU.
  • Unstructured (Fast Mode): 0.08 seconds/page on x86 CPU, 0.03 seconds/page on Apple M3 Max (text layer extraction only).
  • Unstructured (Hi-Res Mode): 4.20 seconds/page on x86 CPU, 2.70 seconds/page on Apple M3 Max, 1.40 seconds/page on Nvidia L4 GPU.

Downstream Impact on RAG Chunking and Retrieval

The choice of parser dictates how documents can be chunked for vector embedding. Traditional fixed-size token chunking (e.g., 512 tokens with 50-token overlap) causes structural fragmentation:

  1. Table Severing: Fixed-token splits cut through table rows, separating column headers from numerical values and degrading retrieval precision.
  2. Context Bleed: Footers and page numbers are chunked together with body text, introducing irrelevant tokens into semantic vector spaces.
  3. Hierarchy Loss: Section headers are isolated from their subordinate paragraphs, depriving embedding models of topical context.
# Docling Hierarchical Chunking Workflow
from docling.document_converter import DocumentConverter
from docling.chunking import HybridChunker

# 1. Convert document into typed AST
converter = DocumentConverter()
doc_result = converter.convert("https://arxiv.org/pdf/2408.09869.pdf")
doc = doc_result.document

# 2. Chunk using layout-aware hierarchical boundaries
chunker = HybridChunker(
    tokenizer="BAAI/bge-small-en-v1.5",
    max_tokens=512,
    merge_peers=True
)

chunks = list(chunker.chunk(doc))
for chunk in chunks:
    # Each chunk preserves header lineage and keeps tables intact as markdown structures
    print(f"Meta: {chunk.meta.headings} | Content: {chunk.text[:100]}...")

By leveraging typed AST representations (such as DoclingDocument or MinerU's structured output), RAG pipelines can implement Hierarchical Chunking:

  • Tables remain atomic units serialized into structured Markdown or HTML.
  • Header lineage (Document > Section 2 > Subsection A) is automatically prepended to each paragraph chunk as metadata.
  • Running headers, footers, and page numbers are stripped before vectorization.

Serving Economics and Production Sizing

Document parsing is often the most compute-intensive stage of an enterprise ingestion pipeline. Sizing infrastructure requires balancing model accuracy against inference cost.

Cost Breakdown: Parsing 1,000,000 Enterprise Pages

Assuming a corpus of 1,000,000 pages (30% complex tables, 40% multi-column layout, 30% plain digital text):

  • Docling (Hybrid Routing on 4x Nvidia L4 GPUs): $2.84/hr infrastructure cost, 42.5 hours total runtime, $120.70 total cost ($0.00012/page).
  • MinerU (CUDA Batch on 4x Nvidia L4 GPUs): $2.84/hr infrastructure cost, 18.2 hours total runtime, $51.68 total cost ($0.00005/page).
  • Unstructured (Self-Hosted 32-vCPU Cluster): $1.36/hr infrastructure cost, 36.4 hours total runtime, $49.50 total cost ($0.00005/page).
  • Commercial Document SaaS API: Standard flat rate of $0.01 per page, $10,000.00 total cost ($0.01000/page).

Self-hosting open-source vision parsers on cloud GPUs reduces ingestion costs by 98% to 99% compared to proprietary document parsing APIs.

To balance cost and accuracy at scale, production pipelines implement dynamic multi-tier routing:

                          [Incoming Document PDF]
                                     │
                    [Fast Digital Inspection (pypdf/pdfminer)]
                                     │
            ┌────────────────────────┴────────────────────────┐
     [Pure Text, Single Column]                   [Complex Layout / Scanned]
            │                                                 │
   [Unstructured Fast Mode]                       [Check Page Complexity]
   Cost: ~$0.00005/page                                       │
                                         ┌────────────────────┴────────────────────┐
                                 [Scientific / Math Heavy]                 [Financial / Table Heavy]
                                         │                                         │
                                [OpenDataLab MinerU]                         [IBM Docling]
                                Cost: ~$0.00005/page                      Cost: ~$0.00012/page

Selection Matrix

  • Choose IBM Docling when building enterprise RAG systems for financial reports, compliance documents, and corporate filings where table precision (TEDS) is critical, MIT licensing is mandatory, and hierarchical AST chunking is required.
  • Choose OpenDataLab MinerU when processing academic papers, scientific literature, patents, or Chinese-language documents with heavy mathematical formulas and dense multi-column layouts on dedicated CUDA infrastructure.
  • Choose Marker when converting books, long-form PDF publications, and technical manuals into clean Markdown with embedded LaTeX equations for direct model fine-tuning or simple RAG ingestion.
  • Choose Unstructured when building multi-modal data ingestion connectors across heterogenous enterprise repositories containing Word, PowerPoint, HTML, and email files in addition to standard PDFs.

Sources

Written by

More to read

  • OpenAI Researcher Warns Ultrafast Inference Demands Autonomous Cyber Defense

    Accelerating inference speeds in frontier artificial intelligence systems pose critical containment challenges that human security operators cannot manage in real time, according to OpenAI researcher roon. Commenting following the unveiling of custom inference hardware architectures and ultrafast model serving tiers, roon warned that unaligned or compromised agent systems running at 50 times baseline generation speeds could execute multi-stage network penetration and lateral movement before hum

    1 min
  • Google Sets Android Memory Limits as AI Data Centers Strain Chip Supply

    Google is implementing strict new memory performance thresholds for Android applications on the Google Play Store, directly citing component shortages driven by the artificial intelligence data center buildout. In an update on the Android Developers Blog, Google detailed new app quality requirements targeting dynamic memory allocation, bitmap memory usage, and execution efficiency. The policy changes reflect supply chain shifts in semiconductor manufacturing, where massive demand for high-bandw

    1 min
  • Agentic Web Scraping and Headless Browser Automation in Production: Comparing Crawl4AI, Browser-Use, Stagehand, and ScrapeGraphAI

    Agentic Web Scraping and Headless Browser Automation in Production: Comparing Crawl4AI, Browser-Use, Stagehand, and ScrapeGraphAI Web scraping has undergone a fundamental architectural transition. For decades, automated data extraction relied on deterministic parsers such as Beautiful Soup, Scrapy, and raw headless browser drivers like Playwright or Puppeteer. These tools depended on hand-crafted CSS selectors, XPath expressions, and rigid execution trees. While computationally lightweight, sel

    1 min