Artificial Intelligence

DeepSeek-OCR 2 Brings Visual Causal Flow to Open-Source Document Understanding

DeepSeek-OCR 2 introduces Visual Causal Flow for human-like visual encoding. Now open-source on GitHub, the model supports vLLM and Transformers, dynamic resolution (up to 1,216 visual tokens), and document-to-markdown conversion.

Emmanuel Fabrice Omgbwa Yasse

2026-07-09 · 2 min read

DeepSeek-OCR 2 Brings Visual Causal Flow to Open-Source Document Understanding
Sources : DeepSeek-OCR-2 …·README Installa…·DeepSeek-OCR 2:…·DeepSeek-OCR: C…

texte

On March 6, 2025, DeepSeek quietly released the latest version of its optical character recognition model, DeepSeek-OCR 2, and made the entire thing available on GitHub. The accompanying paper, titled “DeepSeek-OCR 2: Visual Causal Flow,” explains how the team moved beyond standard OCR by building in a visual causal framework that, in essence, tries to mimic the way humans actually look at and encode visual information.

What is Visual Causal Flow?

Here's the gist: Visual Causal Flow reimagines image understanding as a causal chain of events. Instead of chewing through an entire picture in one flat pass, the model learns to zero in on regions based on their semantic importance, a bit like how a person scans a printed page. That approach turns out to be especially useful for tricky layouts, tables, and anything that mixes text with images.

The architecture also handles dynamic resolution on the fly. Out of the box, DeepSeek-OCR 2 carves images into grids of zero to six tiles at 768×768 pixels, plus one central tile at 1024×1024. Depending on the image, that yields anywhere from 144 to 1,216 visual tokens. The model dumps more tokens into dense areas and skimps on simpler parts.

Open-Source Availability and Installation

DeepSeek has posted the full model and inference code on GitHub under an open-source license. The repo comes with detailed installation instructions for both vLLM and Hugging Face Transformers. The recommended stack is CUDA 11.8 plus PyTorch 2.6.0, and the team provides a pre-built vLLM wheel for version 0.8.5 to keep things simple.

“Our environment is cuda11.8+torch2.6.0,” the developers note in the repository, adding that users can dodge version conflicts by sticking to the supplied conda environment.

Prompt Modes and Inference

DeepSeek-OCR 2 comes with two main prompt modes. For document processing, the default prompt, “<image>\n<|grounding|>Convert the document to markdown.”, spits out structured markdown that respects the original layout. A simpler mode, triggered by “<image>\nFree OCR.”, handles plain text extraction without worrying about formatting.

On the vLLM side, the team includes scripts for streaming single-image inference, concurrent PDF processing (matching the speed of the original DeepSeek-OCR), and batch evaluation on benchmarks like OmniDocBench v1.5. The Transformers integration is just as straightforward, with a minimalist Python snippet in the repo.

Benchmark-Ready and Modular

The model was put through its paces on the OmniDocBench v1.5 suite, a well-known benchmark for document understanding. A batch evaluation script lives in the repo, letting researchers reproduce those results. The team tips its hat to earlier work, DeepSeek-OCR, Vary, GOT-OCR2.0, MinerU, and PaddleOCR, and credits the OmniDocBench dataset.

Citation and References

The research is backed by two papers: the original DeepSeek-OCR (arXiv:2510.18234, 2025) and the new DeepSeek-OCR 2 (arXiv:2601.20552, 2026). Authors Haoran Wei, Yaofeng Sun, and Yukun Li appear on both. The citation for the current model is:

Wei, H., Sun, Y., & Li, Y. (2026). DeepSeek-OCR 2: Visual Causal Flow. arXiv preprint arXiv:2601.20552.