[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 MLX
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.
This repository holds the weights for MLX-VLM on Apple silicon. The original checkpoint is ibm-granite/granite-docling-v2-500m.
- 🏆 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.
- 🍎 Runs on your Mac: MLX-VLM on Apple silicon, density router included; bf16 weights of about 1.1 GB.
[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 (each system with the settings its model card recommends,
2,078 ParseBench pages, peak over 8–256 pages in flight; details in the
original model card). 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
🍎 MLX
Runs on Apple silicon with MLX-VLM.
The output keeps the DocLang tags and location tokens. The router decision costs one pass of the vision encoder.
To force a route, pass fine_route=True or fine_route=False directly.
Command line, batches and 8-bit weights
Command line. Add --processor-kwargs '{"fine_route": true}' for a dense page.
Several pages. batch_generate adds the chat template itself, so give it the bare prompt. It uses one route
for the whole batch, so group pages by route and set processor.image_processor.fine_route before each call. For
a PDF, render each page to an image (for example with pypdfium2 at 144 DPI).
Less memory. An 8-bit copy needs less memory and is faster. Give ./granite-docling-v2-500m-8bit as the model
after this:
📝 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>.
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).
Citation
License
Released under the Apache 2.0 license.