Baidu has released Unlimited OCR 2, an open document-reading model that its authors say can parse a document of almost any length in one request. The weights are on Hugging Face under the MIT license, the code is on GitHub, and the release note in the model card is dated 2026/10/27. The technical report is credited to the Baidu ERNIE Team.
OCR (optical character recognition) turns page images into text. Unlimited OCR 2 is a small vision-language model that reads page images and writes out text, tables, formulas and layout. Baidu's report says the hard part is length: as a document grows to hundreds of pages, the visual context grows and each decoding step costs more. Unlimited OCR 2 is Baidu's attempt to keep that cost flat.
What Baidu released
- A document parser with a mixture-of-experts decoder. The report describes "3B total parameters and 500M activated parameters per token." The Hugging Face file listing counts about 3.34 billion parameters in total, in BF16.
- It builds on Baidu's first Unlimited OCR, which the model card says was released on 2026/06/22 and aimed "to push Deepseek-OCR one step further." The report says both versions use DeepSeek OCR as their foundation. That is about four months between the two versions.
- A new benchmark, MarathonDocBench, made by the same team. It has 100 documents of 103 to 300 pages, with 205k annotated layout elements.
- Two ways to run it: Hugging Face Transformers for quick tests, and a customized SGLang build that the model card recommends for serving. The card says the Transformers path was tested on an NVIDIA A800-80GB. The model loads with
trust_remote_code=True, so it runs Baidu's own model code.
The model card also shows a replay of what it calls "a full-length book parsed in a single request."
How it keeps long documents cheap

The first version already capped how much of its own past output the model looks back at. But it still attended to the visual tokens of every page. The new version changes that with what Baidu calls Sparse Reference Sliding Window Attention (SR-SWA). It has two parts:
- Page Gate narrows each step to blocks from designated target pages, so the model concentrates on the page it is transcribing.
- Token Sieve keeps only a fixed number (top-k) of the most relevant of those blocks, which the report says captures long-range visual dependencies at small cost.
The model card says this compresses the interactions "down to a fixed-size set of working references (e.g., 512 tokens)," so per-step speed and memory stay "nearly constant regardless of document length."
A second change splits a long file into overlapping chunks of pages. Each chunk shares one boundary page with the next, and memory for finished chunks is released. In the report's test on MarathonDocBench, this cut peak KV cache memory from 47.00 GB to 1.77 GB for a single document, and raised throughput from 360 to 1,315 tokens per second with 16 documents at once. At the hundred-page scale, the report claims per-step speedups of 7.0x over full attention and 5.6x over the first version's method.
Baidu's benchmark numbers

All scores below are Baidu's own, from its October 2026 technical report. We found no independent check of these numbers as of October 27, 2026.
- MPDocBench (documents of up to 30 pages), overall score: Unlimited OCR 2 84.59, Qwen3.8-Max 78.30, Qwen-3.8-Flash-Next 77.36, Gemini-3.8-Flash 76.25, Gemini-3.1-Pro Preview 71.79, GLM-5.3-Flash 68.02, DeepSeek-4.1-Flash 66.25, Kimi-K3 60.77.
- MarathonDocBench (100 to 300 pages), overall score: Unlimited OCR 2 77.06. The best general model in Baidu's table is Kimi-K3 at 33.74. Gemini-3.8-Flash scored 28.61, Qwen-3.8-Flash-Next 27.83, Qwen3.8-Max 22.93, MiniMax-M3 17.97, DeepSeek-4.1-Flash 12.34 and GLM-5.3-Flash 7.51. The first Unlimited OCR is not scored here because of its 40-page input limit.
- OmniDocBench v1.6 (single pages): Unlimited OCR 2 scored 94.02. That is not the top score in Baidu's own table. TeleOCR (96.91) and OvisOCR2 (96.47) scored higher.
Two cautions apply. MarathonDocBench is Baidu's own benchmark, released with the model. And the general models in the comparison are chat models, not tools built only for OCR.
What Baidu says it cannot do yet
The report lists two limits. Its training data "remains limited in diversity." And "the current sparse-attention mechanism does not preserve global document information, limiting its understanding of document-level structures such as heading hierarchies." The heading scores bear that out: 60.10 on MPDocBench and 48.20 on MarathonDocBench, the lowest of its category scores.
The report says training used 2 million multi-page and 10 million single-page documents, on 25 nodes of 8 NVIDIA H800 GPUs.
Why it matters
Recent China AI launches covered here, such as Kimi K3.1 Pro and MiniMax M3.1 Flash, are large general models. This release is narrower: a document parser. A small open model under MIT terms that claims to read hundreds of pages in one pass, with memory that does not grow with length, is something teams can download and test on their own files. For pipeline-based parsers, see our comparison of Docling, Marker, MinerU and Unstructured.
It also shows how open Chinese work builds on itself. Baidu's model is built on DeepSeek's OCR work, and it is tested against models from Alibaba, Zhipu, Moonshot, MiniMax and DeepSeek. The claims to check are the ones Baidu makes on its own benchmark: whether accuracy holds on real 300-page files, and whether the flat memory use survives outside Baidu's serving setup.
