A field guide · Vision-language models

How VLMs Read Documents

From pixels to page structure. A page is an image that is mostly text, layout and structure. This is what a vision-language model needs in order to read one well, and what it should write down when it has.

Document AIOCRVision-language models

Give a vision-language model a photograph of a street and ask what is in it. A good answer names a few objects and their relations. Now give it a scanned invoice and ask the same thing. A good answer is now hundreds of exact characters, in the right order, with the table rows kept apart and the total tied to the word "Total". One wrong digit makes the answer wrong.

This post asks one question. A document is an image whose content is mostly text, layout and structure. What does a VLM need in order to read it well, and what should it write down when it has?

We will build the answer in order. First, what makes a page different from a natural image. Then the two traditions that grew up around that difference: pipelines of specialist models, and end-to-end models that read pixels directly. Then the questions every system has to answer, whichever tradition it comes from: how many pixels and tokens a page needs, what format to write, how to handle tables, formulas and reading order, where training data comes from, and how to measure any of it. The post ends with grounding: answers that show where on the page they came from.

This is the area of my own research, so one caution up front. My group's work on grounded document intelligence appears below as one line among many. It argues one position (keep everything on the page, and ground with masks). Other strong systems make different choices, and the post presents them on their own terms.

Why a page is not a photograph

Start with what a vision encoder sees. It sees a grid of pixels, cut into patches. For a natural image, most of the meaning survives if you shrink it. A dog at 224 by 224 pixels is still a dog. The encoders behind most VLMs were trained on exactly such images, which is why they work at low resolution (the vision encoder post covers how they are trained).

A page breaks this assumption in several ways at once.

So reading a page is not one task. It is a stack of tasks. Figure 1 takes a single page through that stack, one layer at a time.

Figure 1 · One page, seven layers of structure

Figure 1. The same page, decomposed. A model receives only pixels (step 1). Reading it means finding text lines (2), grouping them into labelled blocks (3), ordering the blocks the way a person reads (4), recovering the grid of the table (5), nesting blocks into a tree (6), and finally writing all of it down in some format (7). The running header and page number are found but left out of the reading order.

Each layer depends on the ones below it. Reading order needs blocks. Blocks need lines. A table's structure needs its cells. An error low in the stack flows upward. Any system that reads documents has to recover these layers somehow, either one at a time or all at once. The rest of the post is about the choices that follow from that.

Two ways to read a page

There are two broad ways to build the stack in Figure 1. The older one assigns each layer to its own model and chains them. The newer one trains a single model to go from pixels to the final output. A third, hybrid way has emerged since 2024. We start with the pipeline, because the end-to-end models were built in reaction to it.

The pipeline tradition

A classic document pipeline has four or five stages. Each one is a separate model, trained on its own data.

Text detection finds where the text is. Modern detectors segment text regions as a probability map. DBNet made the final thresholding step differentiable so the detector could learn its own boundaries. Text recognition reads each detected line. For years the standard design was CRNN: a convolutional network reads the line image, a recurrent network models the sequence, and CTC loss aligns the outputs without needing per-character positions. TrOCR later replaced both halves with pretrained Transformers.

Open engines package these steps. Tesseract is the long-standing open-source engine. PaddleOCR's PP-OCR is a practical, very small system. Its first version recognized 6,622 Chinese characters with a 3.5M-parameter model. PaddleOCR 3.0 now ships PP-OCRv5 for multilingual recognition and PP-StructureV3 for full-page parsing.

Layout detection finds blocks and labels them: title, paragraph, table, figure, caption, header, footer. It is usually an object detector trained on page images. PubLayNet supplied over 360 thousand automatically labelled pages from PubMed Central. Its labels came for free by matching the XML of each article to its PDF. But every page was a scientific article. DocLayNet answered with 80,863 human-annotated pages from diverse sources and 11 classes. Its authors showed that detectors trained on it are more robust on varied layouts, and that the best detectors still fell about 10% short of the agreement between human annotators. DocLayout-YOLO later pre-trained on 300 thousand synthetic pages to get both speed and accuracy. LayoutParser made such detectors easy to reuse.

Table structure recognition turns a table crop into rows, columns and spanning cells. PubTabNet framed this as image-to-HTML and introduced the TEDS metric we will meet later. TableFormer predicted the structure and the cell boxes, then copied cell text straight from the PDF instead of reading it. Table Transformer, trained on PubTables-1M, treated it as object detection. Reading order sorts the blocks. LayoutReader learned it from 500 thousand Word documents, whose XML already stores the order.

Toolkits assemble these pieces. MinerU (version 1) combined PDF-Extract-Kit models with hand-tuned pre- and post-processing rules. Docling runs a DocLayNet-trained layout model and TableFormer and produces a structured document object. Marker converts PDFs to Markdown, JSON or HTML with its own models for layout and OCR, and can optionally call an LLM to clean up. These tools are fast, cheap and easy to debug, because every stage writes an output you can look at.

Why pipelines fall short, and what replaced them

The weakness of a pipeline is in its joints. Each stage sees only the output of the stage before. If the OCR misreads a digit, the table model fills the wrong value into a correct cell, and nothing downstream ever looks at the pixels again to fix it. If the layout detector merges two columns, the reading-order model faithfully orders a block that should not exist. The Donut paper listed this error propagation as one of three reasons to drop OCR entirely, along with the cost of running OCR and its inflexibility across languages.

End-to-end models take the opposite position. One network reads the page image and writes the output. There are no joints, so there is nowhere for an error to be passed along. But there is also nothing to inspect. A single long output can go wrong anywhere, and autoregressive decoders have a characteristic failure on long pages: they start repeating a line and never stop. Figure 2 traces one number through both designs and through the hybrid design that most 2025 parsers settled on.

Figure 2 · Where errors live in three designs

Figure 2. The amount "1,500.00" travels through three designs. In the pipeline (top), a zero misread as an 8 is inherited by every later stage, but each stage leaves an inspectable output. In the end-to-end model (middle) there are no joints, but the whole page is one long generation and a failure such as a repeated row can appear anywhere. In the two-stage design (bottom), one model first finds the layout on a small image, then reads each element from a full-resolution crop, so an error stays inside one element.

Reading OCR words with their positions

Before end-to-end models, there was a middle path. Keep the OCR engine, but stop throwing away where each word was. This is the LayoutLM line, and it shaped how the field thinks about layout.

The idea is simple. A language model like BERT gets a sequence of word tokens, each with a 1D position. On a page, a word also has a 2D position: its bounding box. LayoutLM adds embeddings for the box corners to each word's embedding, with coordinates normalized to a fixed grid. Now the model can learn that a number sitting to the right of "Total" is probably the total, even if the OCR wrote them far apart in its output. LayoutLM was pre-trained with masked language modelling on scanned pages from the IIT-CDIP collection. On FUNSD form understanding it raised the state of the art from 70.72 to 79.27.

The next versions added the image itself. LayoutLMv2 fed visual features into the same Transformer and added a spatial-aware attention bias, so attention could depend on the relative positions of two words. It reached 86.72 ANLS on DocVQA. LayoutLMv3 replaced the CNN image backbone with simple linear patch embeddings and pre-trained with masking on both text and image, plus an objective that checks whether a word's image patch is masked. LayoutXLM extended the recipe to many languages and introduced XFUND, a form benchmark in seven languages. DocFormer shared spatial embeddings across text and vision. UDOP unified vision, text and layout in one encoder-decoder that could also generate document images. DocLLM went the other way and dropped the image encoder entirely, giving an LLM only the text and the boxes.

Figure 3 · What a layout-aware model actually receives

Figure 3. The LayoutLM recipe. An external OCR engine turns the receipt into words and boxes. Each word becomes a token whose embedding adds a text embedding, a 1D position, and embeddings for the box coordinates on a 0 to 1000 grid. Later versions also add image patch tokens. The encoder then labels tokens, for example linking the key TOTAL to the value 7.00. The last step shows the catch: an OCR error is an input, so the model has no way to correct it.

These models were strong on forms and receipts, where the job is to label words that OCR has already found. But they inherited two limits from the pipeline. They could only see words the OCR engine produced, and they took the OCR's reading order as given. They were encoders that label tokens, not decoders that write. That is the gap end-to-end models set out to close.

Reading without an OCR engine

The end-to-end idea is to treat reading as image captioning with a very demanding caption. An image encoder reads the page. A text decoder writes the output token by token. The training loss is ordinary next-token cross-entropy. Everything else is in the data.

Donut and the pseudo-OCR objective

Donut (2021) made this work for documents. Its encoder is a Swin Transformer at a high fixed input size of 2560 by 1920. Its decoder is the first four layers of a multilingual BART. Pre-training is a pseudo-OCR task: read all the text on the page, roughly from top-left to bottom-right. The real images were 11M English scans from IIT-CDIP, with text labels from a commercial OCR API. To reach other languages, the authors built SynthDoG, a synthetic document generator, and rendered 0.5M pages each in Chinese, Japanese, Korean and English from Wikipedia text. Fine-tuning then teaches the decoder to write a task-specific output, such as a JSON-like sequence of field tags for a receipt.

Donut's DocVQA score was modest: 67.5 ANLS against 78.1 for LayoutLMv2 trained on the same split. But it ran faster, needed no OCR, and its resolution ablation showed scores climbing steadily as input size grew. That last result set the agenda for the next five years.

Learning from rendered sources

The next idea was about data. Many documents exist in two forms: a source (HTML, LaTeX) and its rendering (a screenshot, a PDF). The source is a free, perfect label for the rendering.

Pix2Struct (2022) pre-trained on 80M web screenshots, asking the model to output a simplified version of each page's HTML, with parts of the screenshot masked. The authors argued this objective subsumes OCR, language modelling and captioning. Pix2Struct also introduced a variable-resolution input. Instead of resizing every image to a fixed square, it rescales the image to fit as many fixed-size patches as the sequence length allows, keeping the aspect ratio. A tall receipt stays tall. It came in two sizes (282M and 1.3B parameters) and set the state of the art on six of nine tasks across documents, illustrations, user interfaces and natural images.

Nougat (2023) applied the same logic to science. It paired the LaTeX source and compiled PDF of 1,748,201 arXiv articles, converted the LaTeX to HTML with LaTeXML and then to a lightweight Markdown with LaTeX math. A Swin encoder at 896 by 672 and an mBART-style decoder (350M parameters in total) learned to write the Markdown from the page image. On its arXiv test set it reached an edit distance of 0.071, against 0.255 for the PDF's own embedded text. Two of its practical lessons have stayed relevant. First, page breaks in the source had to be aligned to the PDF pages, which is harder than it sounds. Second, the decoder sometimes fell into repetition, so the authors added a detector that watches the logits and stops generation.

Kosmos-2.5 (2023) unified two outputs in one model. With one prompt it writes text lines with their bounding boxes. With another it writes Markdown. Its pre-training corpus was 357.4M pages. It mixed scanned documents, web PDFs, arXiv papers, web pages, design images and README files, with Markdown labels derived from DOCX, LaTeX and HTML sources. It used a Pix2Struct-style encoder with a resampler that compresses the image into a fixed number of tokens.

Dessurt was another early end-to-end reader that took a task string and wrote arbitrary text. By 2023 the question was no longer whether OCR-free reading works. It was how to make it work with the large language models that were taking over everything else.

When large language models learned to read

General VLMs of 2023, such as LLaVA and mPLUG-Owl, could read a little. They had one problem: their vision encoders were CLIP models trained at 224 or 336 pixels. A full page squeezed into that is a grey blur. The first wave of document MLLMs was mostly about getting more pixels into a frozen low-resolution encoder.

UReader cut the page into up to 20 crops of the encoder's native size with a shape-adaptive cropping module, encoded each crop separately, and fed all of them to the LLM. It fine-tuned only 1.2% of the parameters, with LoRA, on a mix of document, table, chart, natural-image and web-page tasks. It reached 65.4 ANLS on DocVQA without any OCR. Monkey did the same with 448-pixel tiles and an adapter per tile, reaching inputs of 1344 by 896. InternVL 1.5 made tiling dynamic: 1 to 40 tiles of 448 pixels, chosen by aspect ratio, up to 4K inputs. LLaVA-UHD argued the same way for variable-sized slices.

Tiling solves resolution but creates a token problem. Every tile costs hundreds of tokens, and a page can need dozens of tiles. The next models tried to make those tokens count.

mPLUG-DocOwl 1.5 made two contributions. Its H-Reducer merges each run of four horizontally adjacent visual features with a 1-by-4 convolution. The reasoning is that text runs left to right, so horizontal neighbours belong together. It also trained on "unified structure learning": parsing documents, tables, charts, web pages and natural images into structure-aware text, plus locating text at word, phrase, line and block level. Its DocStruct4M dataset built these targets from public images. DocOwl 1.5-Chat reached 82.2 ANLS on DocVQA. DocOwl2 then compressed each high-resolution page to 324 tokens, guided by a low-resolution global view, so that many pages fit in one context.

TextMonkey measured the redundancy directly. It counted visual tokens whose similarity to another token exceeded 0.8. At 448 pixels, 26.6% of tokens were redundant. At 1344, 59.5% were. It then kept only the distinctive tokens. It also trained the model to output text positions, which made answers easier to check. Vary took yet another route. It argued that CLIP's "vocabulary" lacks dense text, and trained a second encoder (a SAM-pretrained ViTDet at 1024 by 1024) on document OCR and charts, then merged it with CLIP. Fox extended the same family to focus on any region of single or multi-page documents.

Meanwhile, general model families absorbed all of this. Qwen2-VL introduced native dynamic resolution: the image is cut into 14-pixel patches at its own size, and 2-by-2 groups of patches are merged into one token, so a page of any shape becomes as many tokens as it needs. Qwen2.5-VL kept that design, added window attention to the encoder for speed, and trained on a large synthetic "document omni-parsing" corpus written in an HTML format with a bounding box on every element. Qwen3-VL extended the context to 256K tokens so that long documents fit. The architecture gallery compares these designs, and the open-family survey covers each family in detail.

Resolution and the token budget

Every design above runs into the same trade. Text needs pixels. Pixels become tokens. Tokens cost compute in the language model, and attention cost grows faster than linearly with their number. It is worth doing the arithmetic once.

How many tokens a page costs

Take an A4 page, 8.27 by 11.69 inches, rendered at d dots per inch. Its pixel size is 8.27d by 11.69d. In a native-resolution encoder like Qwen2.5-VL's, each 14-pixel patch is one feature, and 2-by-2 groups of features are merged into one token. So one token covers a 28-by-28 pixel square.

tokens ≈ (8.27d / 28) × (11.69d / 28) ≈ 0.123 d272 dpi ≈ 640 tokens · 150 dpi ≈ 2,780 · 200 dpi ≈ 4,930 · 300 dpi ≈ 11,100

The cost grows with the square of the resolution. Doubling the dpi quadruples the tokens. Now compare the text. A dense page of prose holds several hundred words, which is on the order of a thousand text tokens. At 200 dpi, the page costs about five vision tokens for every text token it contains. The image is a far less compact way to carry the text than the text itself.

Why not just lower the resolution? Look at the glyphs. Ten-point text at d dpi is 10d/72 pixels per em. At 72 dpi that is 10 pixels, so a single 14-pixel patch spans more than a full letter height and a patch-based encoder has little room to separate neighbouring letters. The pixels still hold them: in the companion lab, a small CRNN trained on this font read 99.5% of 10-point lines exactly at 72 dpi (91.5% of 6.5-point footnote lines), so the limit is the encoder's patch size, not the page. At 150 dpi it is about 21 pixels, and small text becomes legible. Footnotes, subscripts and superscripts in formulas, and table digits are usually the first to go. Figure 4 lets you move the resolution and watch both effects at once.

Figure 4 · Small text dissolves as the token count falls

110 dpi
Fixed-budget encoder:

Figure 4. Left: a crop of a page rendered at the chosen resolution and then enlarged, so you see what the encoder gets. The footnote and the subscripts go first, then table digits. Right: the token cost of a full A4 page at that resolution under three input schemes, against an assumed 1,000 text tokens of content. Native resolution uses one token per 28-pixel square (Qwen2.5-VL style). Tiling uses 448-pixel tiles at 256 tokens each plus a thumbnail (InternVL 1.5 style, up to 40 tiles). The fixed-budget encoder spends a constant number of tokens per page (the four native modes of DeepSeek-OCR). The ratio is text tokens per vision token. DeepSeek-OCR reports about 97% decoding precision below a 10× ratio and about 60% at 20×, measured on English pages from the Fox benchmark.

Three ways to spend fewer tokens

The literature has tried three broad ways to break the trade. The post on efficient VLMs covers token compression in general. Here are the parts specific to text-heavy images.

Merge or drop tokens after the encoder. DocOwl 1.5's horizontal merge and TextMonkey's similarity-based filtering both belong here. Pixel shuffle, which folds a 2-by-2 block of features into one token, is now standard (SmolDocling, MinerU2.5 and the Qwen models use a version of it). DocOwl2 compresses a page to 324 tokens with cross-attention guided by a global view.

Use an encoder designed for dense text. GOT-OCR2.0 uses an 80M-parameter ViTDet encoder at 1024 by 1024, whose local window attention keeps high resolution affordable, and compresses every image to 256 tokens. Its 0.5B decoder supports 8K output tokens. DeepSeek-OCR pushes this further. Its DeepEncoder runs window attention (an 80M SAM-base) on the full-resolution patches, compresses them 16× with convolutions, and only then applies global attention (a 300M CLIP-large) on the few remaining tokens. Its native modes cost 64, 100, 256 or 400 tokens per image, and a tiled "Gundam" mode handles larger pages.

Decouple layout from recognition. MinerU2.5 looks at a downsampled page to find the layout, then reads each element from a crop of the original image at native resolution. Small elements get many pixels only where they are needed. We return to this design below.

Specialist document parsers, 2024 to 2026

By 2024 general VLMs read well, but they were large and slow for converting millions of pages. A wave of specialist parsers followed. Most are small (0.25B to 7B parameters). Most output Markdown or HTML for whole pages. They differ mainly in two choices: whether to read the page in one pass or in two, and where their training labels come from.

One pass over the whole page

GOT-OCR2.0 (580M parameters) called itself "OCR-2.0". It treats every man-made optical signal as a "character": plain text, formulas, molecules, tables, charts, sheet music and geometric shapes. With a prompt it writes plain text or formatted output (Mathpix Markdown, TikZ, SMILES or Kern). It also reads a region given by coordinates or by a colour box. It mainly supports English and Chinese. On the Fox document-level OCR test it reported an edit distance of 0.035 for English pages.

olmOCR (2025) was built to turn PDFs into training text for language models. It fine-tunes Qwen2-VL-7B on 260 thousand pages from over 100 thousand crawled PDFs, labelled by GPT-4o. Its trick is "document anchoring": for born-digital PDFs, it extracts text snippets and their coordinates from the PDF itself and puts them in the prompt next to the page image. The model gets the pixels and a noisy but exact hint of the text. Pages are rendered with the longest side at 1024 pixels. The authors estimated a cost of 176 USD per million pages, against over 6,240 USD for GPT-4o through its API. olmOCR 2 started from Qwen2.5-VL-7B and added reinforcement learning, which we cover in the data section.

DeepSeek-OCR (2025) pairs its compressing DeepEncoder with a 3B mixture-of-experts decoder that activates 570M parameters per token. It was trained on 30M PDF pages in about 100 languages, plus charts, chemical formulas and geometry. DeepSeek-OCR 2 (2026) replaced the CLIP half of the encoder with a small language-model-style encoder initialized from Qwen2-0.5B. Learnable query tokens with causal attention let the encoder reorder visual tokens by content before the decoder reads them, instead of in raster order. On OmniDocBench v1.5 it reports 91.09, up 3.73 points from DeepSeek-OCR under similar training data, with at most 1,120 vision tokens per page.

dots.ocr (2025) argues for joint learning in one pass. It uses a 1.2B-parameter vision encoder trained from scratch for documents, handling native inputs of up to about 11 million pixels, and a Qwen2.5-1.5B decoder. In one generation it writes every layout element with its box, category and text, in reading order, with tables as HTML and formulas as LaTeX. Its ablations remove one data source at a time (multilingual, structured, correction data) and show each one matters. Its XDocParse benchmark spans 126 languages. SmolDocling (2025) sits at the other end of the size range: 256M parameters, a 93M SigLIP encoder and a 135M SmolLM-2 decoder, with each 512-pixel tile compressed to 64 tokens. It writes DocTags, a markup with a coarse location on every element, and the authors report it competes with VLMs up to 27 times larger.

Two passes: layout first, then content

MinerU2.5 (1.2B) decouples the two jobs inside one model. Stage one runs layout analysis on the page downsampled to 1036 by 1036 pixels and outputs a box, a category and a rotation for each element, in reading order. Stage two crops each element from the original page at native resolution and recognizes it: text, a formula in LaTeX, or a table in a compact structure language called OTSL that is converted to HTML afterwards. Its encoder is a 675M NaViT with full attention, initialized from Qwen2-VL, and its decoder is Qwen2-0.5B. It reports 90.67 overall on OmniDocBench v1.5.

PaddleOCR-VL (2025) moves the split outside the VLM. A separate model, PP-DocLayoutV2, finds the elements with an RT-DETR detector and orders them with a small pointer network. A 0.9B VLM, built from a NaViT-style encoder and the ERNIE-4.5-0.3B language model, then reads each element. It supports 109 languages and reports 92.86 on OmniDocBench v1.5. Its authors justify the split directly. They argue that end-to-end generation of long pages is slow and memory-hungry, can get the text order wrong, and can hallucinate on long or complex layouts. Dolphin (ByteDance) follows an analyze-then-parse design and parses elements in parallel. MonkeyOCR splits the job into structure, recognition and relation. Commercial services such as Mistral OCR (announced in March 2025) offer the same Markdown-with-tables output through an API, without published architecture details.

The models side by side

The table below surveys the main models along the checklist used throughout this series. Cells say "not reported" where the primary source does not state a value. Key results are only those verified in the papers, so they are on different benchmarks and are not comparable across rows.

Document-reading models compared along the survey checklist
Model (year)Input resolution handlingVision encoderDecoderOutput formatTraining data (key)LanguagesTasksKey result (verified)
LayoutLM v1 to v3 (2019–22)External OCR words and boxes; page image as low-resolution patches (v2, v3)None (v1); CNN (v2); linear patches (v3)None: a BERT-style encoder with task headsToken labels, spansIIT-CDIP scans with OCR textEnglish; LayoutXLM adds XFUND's 7 languagesForms, receipts, DocVQA, classificationv2: DocVQA 86.72 ANLS; v1: FUNSD 70.72 → 79.27
Donut (2021)Fixed 2560×1920Swin-BBART, first 4 layersJSON-like tag sequence11M IIT-CDIP pages (pseudo-OCR) + SynthDoG, 0.5M per languageEnglish, Chinese, Japanese, KoreanClassification, KIE, DocVQADocVQA 67.5 ANLS (72.1 on handwritten subset)
Pix2Struct (2022)Variable resolution: as many fixed patches as fit, aspect ratio keptViTTransformer decoder (282M or 1.3B total)Simplified HTML (pretraining), text80M web screenshots with HTMLEnglishDocuments, illustrations, UIs, natural imagesState of the art on 6 of 9 tasks
Nougat (2023)Fixed 896×672SwinmBART-style, 10 layers (350M total)Markdown with LaTeX math1.75M arXiv articles (LaTeX → HTML → Markdown), PMC, IDLMainly EnglishAcademic PDF conversionarXiv test edit distance 0.071
Kosmos-2.5 (2023)Variable resolution, Pix2Struct style, then a resamplerViT from Pix2Struct-LargeTransformer decoder (1.3B total)Text lines with boxes, or Markdown357.4M pages (scans, PDFs, arXiv, web, READMEs)Not reported per languageOCR, image-to-Markdown, text-rich VQAComparable to 7B generalists on 9 text-rich VQA benchmarks
UReader (2023)Shape-adaptive cropping, up to 20 cropsFrozen CLIP ViT-L/14 (mPLUG-Owl)LLaMA-based LLM, LoRA (1.2% trained)TextInstruction mix over docs, tables, charts, web, natural imagesEnglishVQA, information extraction, captioningDocVQA 65.4 ANLS
DocOwl 1.5 (2024)Shape-adaptive croppingCLIP ViT-L/14mPLUG-Owl2 LLM (8.1B total)Structure-aware text; text with boxesDocStruct4M, DocReason25KEnglishParsing, text localization, VQADocVQA 82.2 ANLS (Chat)
TextMonkey (2024)Sliced windows at 896 or 1344 with shifted-window attention; token resamplerViT (from Qwen-VL)Qwen-VL LLMText, optional positions409K scene-text and document samplesMainly EnglishText spotting, grounding, VQA, KIEOCRBench 561
GOT-OCR2.0 (2024)1024×1024 → 256 tokens; tiling and multi-page modesViTDet-base, 80MQwen 0.5B, 8K output (580M total)Plain, Mathpix Markdown, TikZ, SMILES, KernRendered PDFs, formulas, charts, sheet musicEnglish, ChinesePage, region and scene OCRFox page OCR edit distance 0.035 (en)
Qwen2.5-VL (2025)Native resolution, sides multiple of 28; window attentionViT trained from scratchQwen2.5 (3B, 7B, 72B)QwenVL HTML with a box on every element; Markdown; JSONSynthesized "omni-parsing" documentsMultilingualGeneral VLM incl. parsing, KIE, groundingOmniDocBench v1.5 87.02 (72B)
olmOCR / olmOCR 2 (2025)Longest side 1024; PDF text-layer anchors in the prompt (v1)From Qwen2-VL-7B / Qwen2.5-VL-7BSame 7B VLMLinearized text in reading order, Markdown tables, LaTeX math260K pages labelled by GPT-4o; v2 adds synthetic HTML pages and RL on unit testsEnglish benchmarkPDF to clean textolmOCR-Bench 68.2 → 82.4
DeepSeek-OCR / OCR 2 (2025–26)Native 512² to 1280² (64 to 400 tokens) or tiledSAM-base 80M → 16× conv → CLIP-L 300M; v2 swaps CLIP for a Qwen2-0.5B-style causal-query encoderDeepSeek-3B MoE, 570M activeText or Markdown, optional layout30M PDF pages in about 100 languages, plus charts and formulasAbout 100Page OCR, parsing, chartsAbout 97% precision below 10× compression; OmniDocBench v1.5 91.09 (v2)
dots.ocr (2025)Native resolution up to about 11M pixels, one pass1.2B encoder trained from scratchQwen2.5-1.5BJSON elements (box, category, text) in reading order; HTML tables; LaTeXThree-stage synthetic multilingual data engineMultilingual; XDocParse covers 126Layout, recognition, reading orderOmniDocBench v1.5 88.41
SmolDocling (2025)512-pixel tiles, 64 tokens each (pixel shuffle)SigLIP base/16-512, 93MSmolLM-2 135M (256M total)DocTags: locations on a 0–500 grid, OTSL tablesDocLayNet-PT, synthetic charts, tables, equations, codeMainly EnglishFull-page conversionCompetes with VLMs up to 27× larger
MinerU2.5 (2025)Layout on 1036×1036 thumbnail, content on native cropsNaViT 675M, full attentionQwen2-0.5B (1.2B total)Markdown; OTSL → HTML tables; LaTeXData engine with hard-case mining (IMIC)Chinese and English, balancedLayout, text, formulas, tables, orderOmniDocBench v1.5 90.67
PaddleOCR-VL (2025)Separate layout model (RT-DETR + pointer network), then native-resolution element cropsNaViT-style, from Keye-VLERNIE-4.5-0.3B (0.9B VLM)Markdown and JSONLarge curated and synthetic sets; not fully itemized109Text, tables, formulas, chartsOmniDocBench v1.5 92.86

How to read this table. Read down the resolution column first. Every model after 2022 either keeps the aspect ratio and native resolution, tiles the page, or splits layout from content. None of the strong recent ones squash the page into a fixed small square. Then read the output column: it drifts from labels (LayoutLM) to free text (UReader) to structured markup with positions (dots.ocr, SmolDocling, Qwen2.5-VL). The decoders also shrink. The best whole-page parsers of 2025 have language models of 0.3B to 1.5B parameters, because transcription needs a strong eye more than a large brain.

Pipeline, end-to-end or hybrid

With the models laid out, the original choice can be made more precisely. The table compares the three designs from Figure 2 along the aspects that matter in practice.

Three designs for reading a page
AspectPipeline of specialistsEnd-to-end VLM (one pass)Hybrid (layout first, then crops)
Accuracy on dense textGood on clean print; weak on handwriting and unusual scriptsGood when resolution suffices; drops when the page is downscaledStrong: each element read at native resolution
Layout fidelityExplicit boxes from a detectorOnly if the output format carries positionsExplicit boxes from stage one
Speed and costFast, runs on CPU for small modelsOne long generation per page; slow for dense pagesShort parallel generations; two model calls
Error propagationErrors cascade across stagesNo joints, but loops and hallucinated text can appear anywhereLayout errors propagate; recognition errors stay local
ControllabilitySwap or tune any stagePrompt onlyPrompt per element type; reorder or skip elements
GroundingEvery output has a boxPossible if trained to emit boxesEvery element has a box
ExamplesTesseract, PP-StructureV3, Docling, Marker, MinerU v1Donut, Nougat, GOT, olmOCR, dots.ocr, general VLMsMinerU2.5, PaddleOCR-VL, Dolphin, MonkeyOCR

How to read this table. No column is green everywhere. The hybrid design wins most rows, which is why most 2025 specialist parsers adopted it. But it keeps one pipeline weakness: if stage one misses a block, stage two never reads it. The pipeline keeps a real advantage in cost and debuggability. A single-pass model is the simplest to train and deploy, and the only one that can, in principle, learn the interactions between layout and content.

What the model should write down

So far we have asked how a model reads. The other half of the question is what it writes. This choice is easy to treat as a detail. It is not. The output format decides what information can survive the conversion at all.

Here is the argument, which is also the starting point of my group's REPLICA work. Almost everything done with documents at scale (search, retrieval, translation, archiving, generating training data) runs on a text version of the page, not on the pixels. Whatever the text version cannot express is lost for every one of those uses. And a format can only carry what it has syntax for. Plain text has no syntax for a table cell. Markdown has no syntax for a merged cell or a position. HTML can express position and style, but it does not require them, and what a format does not require, a system tends not to produce. The grounded document intelligence post makes this argument in detail with an invoice rebuilt layer by layer.

Figure 5 renders one small page in six formats. Pick a format to see what it keeps and what it drops.

Figure 5 · The same page in six output formats


              
    Figure 5. One invoice page and six ways to write it down. Elements the selected format cannot carry are outlined in red on the page. Plain text keeps the words. Markdown adds headings and simple tables but has no merged cells or positions. HTML can express almost everything but requires little. A JSON field schema keeps only what the schema names. DocTags (SmolDocling) puts a coarse box on every element. Layout HTML (QwenVL HTML, or FID-HTML in REPLICA) puts a box on every element, and FID-HTML also requires the visual style.

    The table generalizes the figure. "Preserves" means the format has syntax for the property and the systems that use it normally fill it.

    Output formats and what survives the conversion
    FormatWords and orderHierarchyTable structurePositionsVisual styleTypical usersMain loss
    Plain textYesNoNo: cells run togetherNoNoClassic OCR, LLM pretraining corporaEverything but the words
    MarkdownYesHeadings, listsSimple grids only; no merged cellsNoBold, italicNougat, Kosmos-2.5, olmOCR, most parsersSpanning cells, geometry
    LaTeXYesSectionsFull, verboseNoSomeFormula recognition, academic pagesGeometry; many equivalent spellings
    HTMLYesNestingcolspan, rowspanPossible, rarely filledPossible, rarely filledTable recognition (PubTabNet), web-trained modelsWhatever is optional
    JSON fields (KIE)Only named fieldsSchema nestingLine items as listsOnly if the schema asksNoDonut, receipts and forms, extraction APIsAnything outside the schema
    DocTags / OTSLYesElement types, nestingOTSL cell grid with spansCoarse boxes on a 0–500 gridNot reportedSmolDocling, Docling, MinerU2.5 tablesStyle; fine geometry
    Layout-annotated HTMLYesYesYesBox on every elementRequired only in FID-HTMLQwenVL HTML, dots.ocr JSON, Kosmos-2.5 boxes, REPLICALongest outputs

    How to read this table. Read each row from left to right and stop at the first red cell. That is the first use the format cannot serve. Plain text stops at hierarchy, so section-aware chunking for retrieval is out. Markdown stops at positions, so "the figure to the right of the table" is unanswerable. The pattern to notice: richer formats cost more output tokens, and every added field is a field the model can get wrong. The right format is the poorest one that still carries what the downstream use needs.

    Tables, charts and formulas

    Three kinds of content carry their meaning in two dimensions: tables, charts and formulas. Prose can be checked by comparing strings. These cannot, and each has needed its own metric.

    Tables and the TEDS metric

    A table is a grid of cells, and some cells span several rows or columns. The obvious way to score a predicted table is to flatten both tables to text and compare strings. That fails badly. Move one cell to the wrong column and almost every character is still there, so the string score stays high while the table now says something false.

    PubTabNet's authors proposed a fix that follows the structure. Write each table as HTML. HTML is a tree: the table holds rows, the rows hold cells. Then measure the tree edit distance: the cheapest sequence of node insertions, deletions and substitutions that turns one tree into the other. Inserting or deleting a node costs 1. Substituting a cell costs 1 if its row or column span differs. Otherwise it costs the normalized edit distance between the two cells' text, a number between 0 and 1. Normalize by the size of the larger tree and subtract from one:

    TEDS(Ta, Tb) = 1 − EditDist(Ta, Tb) / max(|Ta|, |Tb|)|T| is the number of nodes. TEDS-S ignores cell text and scores structure only.

    The normalization explains the shape. Dividing by the larger tree keeps the score between 0 and 1 and makes a missing row cost the same in a small and a large table, relative to size. Figure 6 computes it for a small table where the text is almost perfect and the structure is not.

    Figure 6 · Scoring a table as a tree

    Figure 6. TEDS step by step. The prediction gets every word right except one digit, so flattened text similarity is 0.97. As trees, the two tables differ by three edits: the header cell lost its two-column span (cost 1), an extra empty cell was inserted (cost 1), and "67.5" became "67.3" (cost 0.25, one character in four). With 13 nodes in the larger tree, TEDS is 1 − 2.25/13 ≈ 0.83. TEDS-S, which ignores text, is 1 − 2/13 ≈ 0.85.

    TEDS became the standard table metric. TableFormer reported improving it from 91% to 98.5% on simple tables and from 88.7% to 95% on complex ones. OmniDocBench and most parsers report it today. It has known limits: tree edit distance is expensive on very large tables, and two HTML tables that render identically can differ in markup. But it measures the thing that matters, which is whether each value sits in the right cell.

    Charts: turn the picture back into data

    A chart is a table drawn as shapes. ChartQA collected 9.6K human-written and 23.1K generated questions about real charts. Many need arithmetic over values read off the plot. Its metric is relaxed accuracy: a numeric answer counts as correct if it is within 5% of the gold value, because reading a bar's height is inherently imprecise.

    The most useful idea in this line is to recover the data first. DePlot trains a model to translate a chart image into a linearized table, then hands that table to an LLM for reasoning. With one-shot prompting this beat a fine-tuned state-of-the-art model by 24.0% on ChartQA's human-written questions. MatCha pre-trained Pix2Struct on chart derendering (chart to table or plotting code) and math reasoning. The same idea now appears inside general models: Qwen2.5-VL's document HTML writes a chart as an image box plus a table of its content, and dots.mocr (2026) parses charts and diagrams into SVG code.

    Formulas: compare what renders, not what is typed

    Formula recognition writes LaTeX. The early benchmark was Im2LaTeX (Deng and colleagues, 2016), which used rendered expressions paired with their source. UniMERNet later supplied UniMER-1M, a million real-world formula samples. The metric problem is that LaTeX has many spellings for one formula. x^2 and x^{2} render identically. So do \frac12 and \frac{1}{2}. Edit distance and BLEU punish these harmless differences and can reward a wrong formula that happens to be spelled like the reference.

    CDM (Character Detection Matching) moves the comparison into image space. It renders both the predicted and the reference LaTeX, detects every character in each rendering with its position, and matches characters that agree in identity and location. The score is computed from the matches. Its authors show it agrees better with human judgement than BLEU or edit distance. olmOCR-Bench uses the same principle: it renders a reference equation with KaTeX and checks that the output renders to symbols in the same relative positions.

    Reading order and long documents

    Recognizing every word is not enough if the words come out in the wrong order. Reading order is easy for a person and surprisingly hard to specify. A two-column page is read column by column. A newspaper is read story by story, and a story can jump to another page. Headers, footers and page numbers repeat on every page and should usually be left out of the main text. Figure 7 lets you try it.

    Figure 7 · The reading-order puzzle

    Figure 7. Click the blocks in the order you would read them, or try a preset. "Top to bottom" sorts blocks by their top edge, the way a naive line scan would, and interleaves the two columns. "Column-aware" splits the page into columns first (a recursive XY-cut), which fixes the columns but keeps the running header and page number. The score is the normalized edit distance between a sequence and the reference, the same kind of reading-order metric OmniDocBench reports. Lower is better.

    Systems handle this in three ways. Pipelines add a dedicated model. LayoutReader learned reading order from ReadingBank, 500 thousand pages built from Word documents whose XML already stores the order, and improved the line ordering of both open-source and commercial OCR engines. PaddleOCR-VL's layout stage ends with a small pointer network that outputs the order of the detected blocks. End-to-end models simply write the page in order, which makes order part of the training target. dots.ocr writes its JSON elements in reading order, and olmOCR describes its output as "linearized plain text in natural reading order". DeepSeek-OCR 2 moves the question into the encoder: its causal query tokens learn to reorder visual tokens before the decoder ever sees them, instead of handing the decoder a raster scan.

    Many pages

    Real documents are long. MP-DocVQA extended DocVQA to multi-page documents and proposed Hi-VT5, which summarizes each page and also predicts which page holds the answer. DUDE added varied multi-page, multi-domain documents with harder question types. DocOwl2's 324-token pages exist to make multi-page input affordable. MMLongBench-Doc is the most demanding: 1,062 questions over 130 PDFs averaging 49.4 pages, with 33.2% of questions needing evidence from several pages and 22.8% designed to be unanswerable.

    When a document is too long for any context, the usual answer is retrieval: find the right pages first, then read them. ColPali showed that page images can be embedded and retrieved directly, without extracting text. The post on multimodal retrieval covers that design.

    Where the training data comes from

    Document labels are expensive to make by hand. A single page can need hundreds of boxes, a reading order and a table structure. So the field's progress has tracked its ways of getting labels without drawing them. There are four main sources.

    Real pages with machine labels. Donut pre-trained on 11M IIT-CDIP scans whose text came from a commercial OCR API. olmOCR labelled 260 thousand diverse PDF pages with GPT-4o. Docmatix took 2.4M page images from 1.3M PDFs in the PDFA collection, reused their existing transcriptions, and had Phi-3-small write 9.5M question-answer pairs. About 15% of the generated pairs were discarded as hallucinations. Machine labels scale, but they inherit their teacher's errors.

    Documents that come with their own source. This is the richest vein. PubLayNet and PubTabNet matched PubMed Central XML to the PDFs. Nougat, Vary and Kosmos-2.5 compiled arXiv LaTeX. LayoutReader read order from Word XML. Pix2Struct used web HTML. Kosmos-2.5 converted DOCX files, LaTeX and HTML into Markdown, and added GitHub README files, for 14M of its pages. The label is exact because the page was generated from it.

    Synthetic rendering. When no source exists, make one. SynthDoG pastes Wikipedia text onto varied paper backgrounds with random layouts, in any language with a font. DocLayout-YOLO generated 300 thousand synthetic layouts by treating page composition as a bin-packing problem. GOT rendered about a million formula fragments from arXiv sources through Mathpix-markdown-it, which its authors found more than 20× faster than compiling LaTeX directly. olmOCR 2 asks an LLM to write HTML pages imitating hard real documents, renders them, and extracts test cases from the known HTML.

    Data engines. The recent parsers run loops. MinerU2.5 labels a large curated corpus with its own earlier pipeline, then uses Iterative Mining via Inference Consistency (IMIC): it runs the model several times on unlabelled pages, and pages where the outputs disagree are flagged as hard cases for human annotation. dots.ocr built a three-stage engine that starts by bootstrapping a multilingual synthesis engine, because structured labels barely exist outside high-resource languages. DeepSeek-OCR extracted coarse labels directly from its PDFs with a PDF library, and made fine labels with layout (2M pages each for Chinese and English) using existing layout and OCR models. REPLICA, in my group's work, rebuilds pages into a complete text form so that every element arrives with an ID, a box and a style, which makes the page labelled by construction for downstream grounding data.

    Languages and scripts

    Most document benchmarks are English or Chinese. The rest of the world's scripts are where systems break first. Shapes differ (Devanagari's headline bar, Arabic's joined letters), direction differs, and training data is scarce. The field has extended coverage step by step. Donut's SynthDoG covered four languages. LayoutXLM's XFUND covered seven. DeepSeek-OCR trained on about 100 languages, PaddleOCR-VL supports 109, and dots.ocr's XDocParse benchmark covers 126. Layout is also language-specific. Indian newspapers, for example, have their own layout conventions, which is why benchmarks such as IndicDLP exist (my group's DocLayout-VL reports results on it).

    How document reading is measured

    Document benchmarks fall into three families. Each asks a different question, and each has its own metric. The benchmarks post covers VLM evaluation in general. Here are the parts specific to documents.

    Question answering on documents

    DocVQA has 50,000 questions on more than 12,000 document images. InfographicVQA asks about infographics, where answers need layout, graphics and simple arithmetic. ChartQA covers charts. TextVQA and ST-VQA ask about text in natural scenes. Most of these use ANLS, from ST-VQA. For each question, take the normalized edit distance NL between the prediction and the closest gold answer. If NL is below 0.5, the score is 1 − NL. Otherwise it is 0. Average over questions.

    ANLS = (1/N) ∑i maxj s(aij, oi),   s = 1 − NL if NL < 0.5, else 0The threshold forgives small OCR slips but gives no credit for a different answer.

    The threshold is the design choice. Without it, a completely wrong answer would still earn partial credit for sharing a few characters. With it, "1,580.00" still earns 0.875 for "1,500.00" (one character wrong out of eight), which is generous to a reader that misreads a digit in an amount.

    Recognition and parsing

    OCRBench gathered 29 datasets into one score that covers text recognition, scene-text VQA, document VQA, key information extraction and handwritten math. OCRBench v2 widened it to 31 scenarios and 10,000 human-verified question-answer pairs, and found most models scored below 50 out of 100. CC-OCR covers multi-scene reading, multilingual reading, document parsing and extraction across 39 subsets, and flagged repetition loops as a common failure.

    For full-page parsing, OmniDocBench is now the reference. Version 1.0 had 981 pages across nine document types, annotated with 19 layout categories and 15 attributes. Version 1.5 has 1,355 pages. It scores text with edit distance, tables with TEDS, formulas with CDM, and reading order with edit distance, and combines three of them:

    Overall = [ (1 − TextEdit) × 100 + Table TEDS + Formula CDM ] / 3OmniDocBench v1.5. Reading order is reported separately.

    olmOCR-Bench takes a different approach. Its 1,400 PDF pages carry 7,010 binary unit tests in a few types: a phrase must be present, a header or footer must be absent, two sentences must appear in the right order, a cell must sit in the right place relative to another, a formula must render the same, and the output must not contain long repetitions. Figure 8 plots OmniDocBench v1.5 results for a range of systems. Switch the metric to see how the ranking changes.

    Figure 8 · OmniDocBench v1.5, by system type

    Pipeline toolGeneral VLMSpecialized document VLM
    Show the numbers as a table
    Figure 8. OmniDocBench v1.5 scores. Most rows come from Table 2 of the PaddleOCR-VL report, which takes them from the OmniDocBench leaderboard. Qwen3-VL-235B, DeepSeek-OCR (9 crops) and DeepSeek-OCR 2 come from Table 1 of the DeepSeek-OCR 2 report. For edit distances, lower is better and bars are sorted so the best is on top. Small specialized models lead overall, but general VLMs remain competitive on formulas.

    Key information extraction and tables

    Extraction benchmarks ask for specific fields. FUNSD has 199 fully annotated noisy scanned forms with entities and their links. CORD's public release has 1,000 Indonesian receipts with a nested field schema. SROIE has 1,000 scanned receipts with four key fields. These are small, and modern models are close to their ceilings. PubTabNet, with 568 thousand table images and HTML labels, remains the main table recognition set, scored with TEDS.

    Answers that point to evidence

    A document answer is often used for something that matters: a payment, a claim, a compliance check. In those settings the reader needs to verify it. The answer should come with the place on the page it came from. The previous post on grounding covers how VLMs point in general. Documents add their own demands.

    There are three ways a document model can show evidence.

    Cite an element that already has a box. If the parse carries positions, as Kosmos-2.5's text lines, QwenVL HTML, DocTags and dots.ocr's JSON all do, then an answer can cite an element and inherit its box. This is cheap and exact, but only as fine-grained as the elements.

    Write the box as text. General VLMs such as Qwen2.5-VL output coordinates as tokens, and TextMonkey added positions to its answers to make them checkable. This works, but the numbers are ordinary next-token predictions. Nothing ties them to the pixels, a long or curved region needs many tokens, and evidence that sits in several places needs several boxes.

    Draw a mask. My group's work takes this route. A language model emits a grounding token wherever it cites evidence, and a segmentation model (SAM) turns that token's hidden state into a pixel mask. The language model decides what to highlight and at what granularity, and the segmenter draws it. M3Grounder grounds answers this way at phrase, line and block level. DoCoG grounds every step of a chain of thought. DocLayout-VL parses the whole page as a tree of masks. The training data comes from REPLICA: a language model reads the rebuilt page, writes a question, and cites an element ID instead of coordinates. Figure 9 compares the three.

    Figure 9 · From an answer to its evidence

    Figure 9. Three ways to show evidence for "How much is due, and why?". A plain answer gives nothing to check. A box typed one coordinate at a time can drift and cover the wrong rows. A mask marks the exact cell, and several masks can cover every value the answer depends on (subtotal, cancelled credit, tax). When the parse has element IDs, an answer can cite an element and inherit its region.

    Open problems

    Text extraction from clean digital pages is close to solved. The open problems are in everything around it.

    Key insights and nuances

    The points worth carrying away, each with the section that supports it.

    You should now be able to look at a document system and ask the right questions. How many tokens does it spend per page, and why? Does it read in one pass or two? What does its output format keep? How is it scored, and does that score match your use? The next post, Seeing in Time, takes the same questions of resolution and token budgets into video, where the extra dimension is time instead of text density.

    References

    Grouped by topic. Every entry links to its primary source.

    OCR-free and document VLMs

    Grounded document intelligence (author's group)