Traditional OCR extracts characters from images. DeepSeek OCR-2 does something different: it reads documents the way humans do — selectively, with order, prioritizing structure over raw pixel sequence.
The architectural change that enables this is significant: OCR-2 replaces the vision encoder (the CLIP-style component that normally handles visual understanding) with a language model. The result is a system where the "looking at the image" step is governed by a language model's causal reasoning, not by a fixed left-to-right pixel scan.
Numbers: SOTA on OmniDocBench v1.5 using a maximum of 512 visual tokens — while competing models require 1,120 to 1,156 tokens. Overall accuracy +3.73% over OCR-1. Reading order error rate down 33% (R-order Edit score: 0.085 → 0.057). MIT licensed, models on HuggingFace.
The Problem With "Mechanical Reading Order"

A standard vision encoder processing a 1,024×1,024 image splits it into 4,096 patches of 16×16 pixels, then feeds them to a Transformer from left to right, top to bottom, without distinction. The heading, the footnote, and the table cell all receive identical treatment in sequence order. The model has no concept of document hierarchy, no ability to choose what to read first.
This is fine for simple documents. It fails systematically on complex ones: multi-column layouts, tables with merged cells, documents with hierarchical headings, forms with non-linear reading sequences. The character extraction often comes out correct; the reading order comes out wrong. And wrong reading order in a document pipeline is often worse than missing characters — you don't notice the problem until downstream parsing collapses.
The paper names this PreNorm dilution of document structure: treating all visual tokens equally means structural signals (which region belongs to which heading, what reads before what) get diluted in the flat token sequence. The right fix isn't better character recognition — it's better reading order understanding.
LM as Vision Encoder

OCR-2's core architectural change: replace the vision encoder with a language model, then add a mechanism for the LM to generate reading queries that determine what to attend to and in what order.
The pipeline:
- ViTDet encodes the full image to a visual token map
- Token Compression — CNN + Channel Mixer reduces tokens by 16×, from up to 6,400 (for a 1,280×1,280 image) to a maximum of 512 tokens. The compression is adaptive: information-dense regions retain more tokens, sparse regions are aggressively merged.
- Qwen2 (language model) generates Causal Flow Query — dynamic reading queries that determine which document regions to attend to and in what sequence
- DeepSeek-3B generates structured output using both the compressed visual tokens and the Causal Flow Query
The Causal Flow Query is what makes OCR-2 behave like a reader rather than a scanner. Previous document AI approaches either used fixed queries (DETR: fixed 100 queries for object detection, order-agnostic) or representative token extraction (BLIP2: Q-former picks "representative tokens" from image features). OCR-2 lets a language model generate the reading queries based on document content, which means the queries adapt to the document's own structure — a two-column academic paper gets different queries than a receipt.
The token compression efficiency is notable. 512 visual tokens maximum versus 1,156 for OCR-1 and 1,120 for Gemini. Same or better accuracy at 55% of the compute cost for the visual encoding step.
What the Benchmarks Show

On OmniDocBench v1.5 — the current standard evaluation for document understanding — OCR-2 achieves SOTA among all models that use 1,120 or fewer visual tokens. More precisely: it is the only model using ≤1,120 tokens that outperforms all "large token" models across the benchmark categories.
Specific improvements over OCR-1:
| Metric | OCR-1 | OCR-2 | Change |
|---|---|---|---|
| Overall accuracy | baseline | +3.73% | +3.73% |
| R-order Edit (reading order error) | 0.085 | 0.057 | -33% |
| Visual tokens (max) | 1,156 | 512 | -56% |
The R-order Edit metric is the most significant from a practical standpoint. It measures how wrong the reading sequence is — lower is better. Going from 0.085 to 0.057 means OCR-2 produces usably correct reading order on a substantially wider class of documents. This is the metric that determines whether the extracted text can be directly ingested into a RAG pipeline or knowledge base without manual correction.
What This Changes for Document Pipelines
The practical reframe: OCR-2 isn't just better at extracting text from images. It extracts text in the right order, from the right logical regions, with the right hierarchical structure preserved.
For developers building document processing pipelines — PDF ingestion, receipt parsing, structured data extraction from forms, academic paper processing — the difference between OCR-1 and OCR-2 quality is the difference between outputs that need post-processing and outputs that don't. The reading order error is the category of problem where you have to read the entire extracted document before realizing something went wrong, and then you can't easily fix it programmatically.
Specific use cases where OCR-2's improvements are most material:
Multi-column documents: Academic papers, newspaper layouts, regulatory filings. Standard OCR reads across columns, producing garbled text when two columns are juxtaposed. OCR-2's Causal Flow Query identifies column boundaries and sequences them correctly.
Tables with merged cells: The reading order problem is especially severe for table data. OCR-2's structure-aware querying preserves cell relationships that flat token sequences lose.
Documents with hierarchical headings: Legal documents, technical manuals, long-form reports. Reading order that incorrectly interleaves heading levels produces text that appears correct character-by-character but is semantically scrambled at the section level.
Knowledge base ingestion: When documents go into a vector database for RAG retrieval, wrong reading order means retrieval chunks contain arbitrarily mixed content from different document sections. OCR-2's output is more directly usable as retrieval chunks.
Availability
MIT license. Models available on HuggingFace. GitHub at deepseek-ai/DeepSeek-OCR-2 with the paper PDF included in the repository.
The model uses Qwen2 + DeepSeek-3B as the generation backbone — both relatively lightweight, making the full OCR-2 pipeline runnable on consumer hardware with appropriate quantization. No commercial API announced at time of writing; self-hosting is the current path.
Bottom Line
OCR-2 reframes what an OCR model should do. Extracting characters was the floor — the new baseline is extracting content in the right order, with structure preserved. The LM-as-vision-encoder architecture, Causal Flow Query, and 512-token compression achieve SOTA document understanding at lower token cost than competitors. The 33% reduction in reading order error is the number that matters for real pipeline work: it's the difference between OCR output you can use and OCR output you have to manually verify.
Resources
- DeepSeek OCR-2 GitHub — code + paper PDF (MIT license)
- DeepSeek OCR-2 HuggingFace — model weights
- OmniDocBench — benchmark used for evaluation
- DeepSeek Official Site — main product
DeepSeek OCR-2 weights are available at huggingface.co/deepseek-ai/DeepSeek-OCR-2 under MIT license. No commercial API endpoint has been announced.