Baidu Open-Sources Unlimited OCR 2 for Hundred-Page Document Parsing
Baidu released Unlimited OCR 2, a 3.34B open-source OCR model it says can parse hundreds-page documents in one request.
The model is built on a DeepSeek-OCR-style layout: a SAM ViT-B plus CLIP-L encoder feeds a 12-layer mixture-of-experts decoder that routes each token to 6 of 64 experts, plus 2 shared experts. Baidu does not disclose active parameters for version 2. The configuration supports a maximum position length of 131,072 tokens; in multi-page mode each page costs 273 image tokens. BF16 weights total about 6.7 GB, and Baidu tested the model on one NVIDIA A800-80GB GPU.
The core change is SR-SWA, or Sparse Reference Sliding Window Attention. It compresses text-visual attention into a fixed working reference set, illustrated as 512 tokens, pairing a 128-token local window with top-16 selection over 32-token blocks. Baidu says this keeps per-step decoding latency and memory nearly flat as documents grow, an approach it calls “unlimited-horizon” parsing within a finite context window. Image encoding and total runtime still rise with page count, according to MarkTechPost.
Baidu reports 84.6 on MPDocBench and 77.1 on MarathonDocBench for Unlimited OCR 2. On Baidu’s chart, Kimi-K3 follows at 33.7 on MarathonDocBench and Gemini-3.8-Flash at 28.6; on MPDocBench, Qwen3.8-Max follows at 78.3. The figures are self-reported and appear only in a chart image, MarkTechPost reported. The same report said MPDocBench-Parse is public with 433 documents and 3,246 pages, but it could not find a public release of MarathonDocBench.
The sub-scores show uneven performance. On MPDocBench and MarathonDocBench respectively, Baidu reports text at 94.8 and 89.6, formulas at 89.4 and 87.9, reading order at 92.3 and 85.3, tables at 87.8 and 74.8, and heading hierarchy at 60.1 and 48.2. The predecessor, Unlimited-OCR, scores 0.0 on MarathonDocBench in Baidu’s chart, while Qwen3.8-Max falls from 78.3 on MPDocBench to 22.9 on the hundred-page benchmark. Those comparisons are from Baidu’s own chart.
Chinese tech outlet Leiphone reported that Baidu tested the model on all seven Harry Potter books, more than 3,600 pages in total, in one pass, maintaining accuracy and processing efficiency as length increased. Leiphone also reported that SR-SWA improved single-step decoding speed by 7 times over full attention and 5.6 times over the previous R-SWA in hundred-page documents, and described the release as the first to allow parsing of an arbitrary number of pages. Those claims were attributed to Baidu and were not independently verified in the materials.
Baidu lists Transformers for quick tests and a customized SGLang wheel for serving. The model card says loading requires trust_remote_code=True, and Baidu warns that a default bias setting can trigger a 462 MiB allocation and run out of memory. Code and weights are available on GitHub and Hugging Face, and Leiphone reported they are also on Baidu Cloud and Baidu’s AI Open Platform. The first Unlimited OCR was released in June 2026; Leiphone said it reached 10 million Hugging Face downloads and 28,500 GitHub stars. Baidu plans to show the model at Baidu World 2026 on Nov. 12, Leiphone reported.