TL;DR
Docling is an efficient, MIT-licensed open-source toolkit designed to convert complex documents like PDFs and MS Office files into rich, structured formats (Markdown, JSON). By leveraging specialized local AI models instead of large Vision-Language Models, it eliminates hallucination risks and high operational costs while delivering state-of-the-art layout and table parsing.
What Problem Does This Paper Address?
Document conversion remains a major bottleneck for LLM applications like Retrieval-Augmented Generation (RAG). PDFs and scanned images discard structural metadata, leaving text as an unformatted stream. While proprietary Vision-Language Models (VLMs) like GPT-4o can parse document images, they are expensive, require cloud deployment, and are prone to hallucinations.
Existing open-source alternatives often suffer from restrictive licensing (e.g., GPL) or struggle with complex layouts and tables. Docling bridges this gap by providing a fast, accurate, and permissively licensed local solution that runs efficiently on commodity hardware.
Methods
Docling uses a modular architecture centered around three components: parser backends, pipelines, and a unified DoclingDocument data model (built on Pydantic).
As shown in the pipeline architecture below, it routes inputs through either a StandardPdfPipeline or a SimplePipeline:
For PDFs, Docling uses a custom-built parser backend (docling-parse based on qpdf) to extract programmatic text tokens and render page bitmaps. It then applies two specialized AI models page-by-page:
- Layout Analysis Model: Derived from RT-DETR and trained on the DocLayNet dataset, this object detector predicts bounding boxes for paragraphs, headers, lists, captions, and figures.
- TableFormer: A specialized vision-transformer model that predicts the logical row/column structure, cell spans, and headers of complex tables.
Scanned elements are processed via integrated OCR engines (EasyOCR or Tesseract), and a final post-processing model corrects the reading order and matches figures with captions.
Datasets
To evaluate performance, the authors compiled a benchmark dataset consisting of 89 PDF files spanning 4,008 pages, 56,246 text items, 1,842 tables, and 4,676 pictures. This dataset draws heavily from DocLayNet (a human-annotated document layout dataset) and is augmented with samples from CCpdf to maximize structural diversity across categories like annual reports, manuals, and patents.
Key Insights and Ideas
- Task-Specific Models > Generative VLMs for Extraction: By relying strictly on layout detection and matching text back to programmatic PDF cells, Docling guarantees 100% faithful text transcription, completely avoiding the hallucination risks inherent to generative models.
- OCR is the Ultimate Bottleneck: Profiling reveals that OCR is by far the most computationally expensive step, consuming roughly 50-60% of total runtime across CPU and GPU setups. Disabling it saves up to 60% of processing time.
- Asymmetric GPU Benefits: Not all models scale equally with hardware accelerators. On an Nvidia L4 GPU, the layout model saw a massive 14x speedup compared to an x86 CPU, whereas the table structure model (TableFormer) only achieved a 4.3x speedup, highlighting areas for future engineering optimization.
Key Results
Docling delivers highly competitive processing speeds compared to other popular open-source tools like Marker, MinerU, and Unstructured:
- CPU Performance: Without GPU acceleration, Docling leads the pack on x86 CPUs at 3.1 seconds per page, closely followed by MinerU (3.3 s/page) and Unstructured (4.2 s/page), while significantly outperforming Marker (16+ s/page).
- GPU Performance: With CUDA acceleration on an Nvidia L4 GPU, Docling processes pages in 0.49 seconds, trailing only MinerU (0.21 s/page).
- Apple Silicon: On an M3 Max SoC, Docling achieves a swift 1.27 seconds per page, whereas MinerU failed to complete execution in this environment.
Limitations and Future Work
While highly proficient at layout and table parsing, Docling currently lacks specialized models for extracting mathematical equations, code blocks, and fine-grained figure classifications (e.g., charts vs. photos).
The authors plan to introduce dedicated models for these components in future releases. Additionally, they aim to develop an open-source quality evaluation framework to enable transparent benchmarking against public datasets like DP-Bench and OmniDocBench.
Summary updated