[Image blocked: Three Docling ducks with hammers and chisels carving a granite statue of a duck that holds a DocLang scroll]
Granite Docling V2 500M
Half a billion parameters, rich in structure: any page becomes DocLang, with extra vision tokens only where the page needs them.
📄 Technical report ·
📊 Benchmark Explorer ·
🤗 Demo ·
🦆 Docling ·
🏆 2B sibling
Granite Docling V2 500M is the small, fast member of the Granite Docling V2 family. It converts a page image into
DocLang, a markup language that records each element's type, position and reading order along with its
content. One generation gives you headings, paragraphs, lists, tables with merged and header cells, LaTeX formulas,
code, pictures with their captions and the text printed inside them, and page headers and footers. You can export the result to Markdown, HTML or JSON
with docling-core. It succeeds SmolDocling and
Granite-Docling 258M, from the Docling team at IBM.
- 🏆 Accuracy above its size: 94.9% content 1 − NED pooled over 16,205 pages from nine benchmarks,
ahead of Nemotron 3.5 Parse (0.6B) and Unlimited-OCR 2 (3.3B). The edit distance falls from 20.6% with
Granite-Docling 258M to 5.1%, four times lower.
- 🔀 Adaptive vision budget: a learned density router reads 64 tokens per tile on ordinary pages and re-encodes dense pages, such as newspapers or small CJK print, at 256 tokens per tile.
- 🧱 Structure is part of the output: every element carries its type and bounding box. Tables keep their full cell structure, and inline math, sub- and superscripts are marked inside the text.
- 🖼️ Pictures are read, not skipped: each picture keeps its type, its caption and the text printed inside it; the
[<detailed>] prompt adds a description.
- 🎯 Prompt for only what you need: ask for just the tables, the formulas, or the text with boxes, and the model decodes nothing else.
- 🌍 Multilingual: far stronger than Granite-Docling 258M beyond English, above all on Chinese, Japanese, Korean, Hindi, Russian and Arabic, and on mixed Chinese–English pages.
- ✍️ Handwriting: reads handwritten notes and forms far better than Granite-Docling 258M, though printed text remains more accurate.
- 🚀 Fast and light: about 18.5 pages per second on one H100 with vLLM and MTP speculative decoding, about 14 without. Runs in 🤗 Transformers and vLLM.
[Image blocked: Accuracy against speed on one H100: Granite Docling V2 2B is the most accurate system at about 10 pages per second and its Flash edition at about 12; Granite Docling V2 500M reaches 94.0% at about 18.5 pages per second and its Flash edition at about 24, ahead of Nemotron 3.5 Parse on both axes; dots.mocr, MinerU 2.5 Pro, Chandra, Unlimited-OCR 2 and LightOnOCR 3 are slower or less accurate]
Page content 1 − NED (all text on the page, including table cells, formulas and code), pooled over 20,502 pages
from ten benchmarks, against throughput on one H100 (the setup of the Throughput table:
vllm serve, each system with the settings its model card recommends, 2,078 ParseBench pages, peak over
8–256 pages in flight). Granite Docling V2 uses MTP speculative decoding and Nemotron 3.5 Parse its DFlash2 drafter.
The 2B Flash and 500M Flash points have the accuracy of the 2B and 500M and are available in the
IBM watsonx editions of Docling. Bubble area is proportional to
parameter count; a double ring marks two-pass systems.
What is DocLang?
DocLang is an XML vocabulary for documents. Each element opens with its type, then its bounding box as four
location tokens (x0 y0 x1 y1 on a 512 × 512 grid from the top-left corner), then its content. Captions sit
inside the table, picture, code or formula they describe. Tables use
OTSL cell tokens (<ched/> header, <fcel/> filled cell, <nl/> row
break, plus merge tokens). Formulas are LaTeX, and inline formatting such as bold, superscript and handwriting is
marked inside running text.
[Image blocked: A two-column page with a page header, headings, paragraphs, a numbered list, a formula, a captioned picture, a table with merged and section cells, a footnote and a page footer, numbered in reading order, next to its abridged DocLang markup, which includes a picture description from the detailed prompt]
Every tag and every coordinate is a single token, so a page's full structure costs far fewer tokens than
HTML. A DocLang page converts losslessly into a
DoclingDocument and from there into Markdown, HTML or JSON.
DocLang is the successor of the DocTags format used by
SmolDocling and
Granite-Docling 258M.
DocLang 0.9 specification →
Quick start
🤗 Transformers
Important: Decode with skip_special_tokens=False. DocLang tags and location tokens are special tokens, and skipping
them leaves bare text.
The router decision costs one pass of the vision encoder. To force a route, call prepare(fine_route=True) or
prepare(fine_route=False) directly. For batched generation, group pages by route.
⚡ vLLM
Server (highest throughput). The model drafts 3 tokens per step with its own multi-token-prediction (MTP)
heads; the output is the same as without them. On one H100 this setup converts about 18.5 pages per second, compared with about 14 without MTP. The client runs the density router and sends each page's route
with the request, which needs --trust-request-mm-kwargs.
Python client (sends many pages in parallel, runs the density router)
Send one page per request and keep 64 or more in flight. The router's image preprocessing runs in the worker
threads and only its GPU pass is serialized; routing one page after another would cap throughput. --api-server-count 8
spreads the server's image preprocessing over eight processes; give the server about 32 CPU cores.
--gpu-memory-utilization 0.8 leaves room for the router on the same GPU. Without mm_processor_kwargs, every page
takes the 64-token route.
Offline batch (no server)
Run the router before creating the vLLM engine. Without mm_processor_kwargs, every page takes the 64-token route.
For a PDF, render each page to an image (for example with pypdfium2 at 144 DPI) and pass the pages as one batch.
📝 Export to Markdown, HTML or JSON
Prompts
The default prompt <doclang> converts the whole page. A task prompt lists the tasks you want in
square brackets after <doclang>, allowing you to control what the model generates.
The complete list of supported tasks is: <ocr>, <table>, <formula>, <picture>, <code>,
<layout> and <detailed>.
The prompts in the table below are examples only, not an exhaustive list. You can use any
combination of the supported tasks, in any order, provided that the exact prompt structure is preserved.
Important: Write task prompts exactly as in the table: one space after <doclang>, tasks in angle
brackets, separated by , . Other spacing or punctuation lowers quality. The model only takes <doclang>
and these task prompts; it does not follow free-form instructions or answer questions.
[Image blocked: Outputs of four prompts on the same page: table only, formula only, text with layout, and the detailed prompt adding a picture description]
Abridged outputs for the page shown above. Small gray numbers are location tokens, shown by their values.
Task prompts also work on crops of a single element.
When the requested content is absent, the model returns an empty <doclang></doclang>.
Model size
The MTP heads are stored in the checkpoint and used only for speculative decoding: they draft tokens that the model then checks.
Evaluation
Note: We score every system against
ground truth that we converted to DocLang and revised by hand, with one
scorer and one conversion path for all models. These numbers are
not comparable with scores published on the
original benchmarks or their leaderboards. Per-page predictions for the public benchmarks are browsable in the
Docling Benchmark Explorer, a live
resource that we keep extending with new datasets, tasks and features.
Content 1 − NED (%, higher is better) is the character-level similarity of the whole page's text, weighted
by characters. Missing and invented text count as errors. Greedy decoding with the <doclang> prompt; the router sent 428 of the 1,649
OmniDocBench pages (26%) to the fine route.
† Internal held-out benchmarks; their pages and ground truth are not released. Pages per benchmark:
1,649 / 4,999 / 2,067 / 1,034 / 673 / 2,023 / 1,403 / 580 / 1,777. Other systems are mapped to DocLang with
Docling's public converters and pooled over the pages they returned (16,174–16,193 of 16,205).
Throughput
Pages per second on one H100 80GB, end to end, at the best of 8, 64 and 256 pages in flight:
(The same for every system: one H100 80GB, 32 CPU cores, vllm serve with --api-server-count 8 (SGLang with eight
tokenizer workers for Unlimited-OCR 2, which vLLM cannot load), the same 2,078 ParseBench pages and no prefix or image
caching. Each system uses the server and request settings of its model card or official client, including its own
speculative decoding; Granite Docling V2 uses the commands in the vLLM section above. Timed end to end: image file
read, the system's own preprocessing and every request until the page's final text.)
Citation
License
Released under the Apache 2.0 license.