[Image blocked: Three Docling ducks with hammers and chisels carving a granite statue of a duck that holds a DocLang scroll]
Granite Docling V2 2B
Lean on compute, rich in structure: any page becomes DocLang, with text, tables, formulas, layout and every picture described.
📄 Technical report ·
📊 Benchmark Explorer ·
🤗 Demo ·
🦆 Docling ·
⚡ 500M sibling
Granite Docling V2 2B is a compact vision-language model that 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.
- 🏆 Top accuracy: 96.5% content 1 − NED pooled over 16,205 pages from nine benchmarks, ahead of every
system we compared, including models up to 2.1× its size. The edit distance falls from 20.6% with
Granite-Docling 258M to 3.5%, six times lower.
- 🧱 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 10 pages per second on one H100 with vLLM and MTP speculative decoding, about 7 without. Runs in 🤗 Transformers, vLLM and MLX.
[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. The format is strict enough to validate mechanically. 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.
⚡ 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 10 pages per second, compared with about 7 without MTP.
Python client (sends many pages in parallel)
Send one page per request and keep 64 or more in flight. --api-server-count 8 spreads the image preprocessing
over eight processes; give the server about 32 CPU cores. --max-num-batched-tokens 16384 fits the largest pages
(two-page spreads).
Offline batch (no server)
For a PDF, render each page to an image (for example with pypdfium2 at 144 DPI) and pass the pages as one batch.
🍎 MLX
Runs on Apple silicon with MLX-VLM, with no conversion.
The output keeps the DocLang tags and location tokens.
Command line, batches, 8-bit weights and speculative decoding
Command line
Several pages. batch_generate adds the chat template itself, so give it the bare prompt. For a PDF, render
each page to an image (for example with pypdfium2 at 144 DPI).
Less memory. The checkpoint needs about 6 GB in bfloat16. An 8-bit copy needs about 4 GB and is faster.
Give ./granite-docling-v2-2b-8bit as the model after this:
Speculative decoding. The multi-token prediction heads of the checkpoint draft up to three tokens for each
step, and the model verifies them. The drafter is in MLX-VLM's main branch and not yet in a release, so install
it from GitHub. Give the original checkpoint as the draft model:
Greedy decoding of one page is about 1.9× faster. The gain is smaller in a batch and with sampling.
📝 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.
† 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.