# Baidu open-sources Unlimited OCR 2, a 3-billion-parameter model that parses documents of hundreds of pages in one request

> The MIT-licensed model uses a new attention method, SR-SWA, to keep memory nearly flat as documents grow. Its benchmark results are Baidu’s own.

- Publisher: JARRUS (@jarrus.tech), thejarrus.com
- Story date: Oct. 27, 2026 (2026-10-27)
- Published: 2026-10-27
- Tags: Models, Research, China
- URL: https://thejarrus.com/en/news/unlimited-ocr-2/

Baidu's ERNIE team released Unlimited OCR 2, a document parsing model, under the MIT license on October 27. The vision-language model parses ordered page images from documents hundreds of pages long in a single request. Weights are on Hugging Face and code is on GitHub, along with serving recipes for SGLang and vLLM. It builds on the first Unlimited OCR, released in June, and uses DeepSeek-OCR's DeepEncoder. The mixture-of-experts model has 3 billion total parameters, with about 500 million active.

The main change is a new attention method called Sparse Reference Sliding Window Attention (SR-SWA). It compresses text and visual interactions into a fixed-size set of reference tokens, with 512 given as an example, so each new token no longer scans the whole document. Baidu says per-step decoding latency and memory stay nearly constant as documents grow. According to its paper, at the hundred-page scale SR-SWA delivers a 7x per-step speedup over full attention. Image encoding and total runtime still grow with length.

Baidu also released MarathonDocBench, a new benchmark of 100 documents running 103 to 300 pages. By Baidu's own measurements, **the model scored 77.06 there, versus 33.74 for Kimi-K3 and 28.61 for Gemini 3.8 Flash**. On MPDocBench, with documents of up to 30 pages, it scored 84.59 to Qwen3.8-Max's 78.30. The results have not been independently verified, and the longest benchmark is Baidu's own. AlphaSignal notes that the fixed reference pool is a lossy summary, so details from much earlier pages can be lost.

## Sources

1. [Hugging Face (baidu/Unlimited-OCR-2): Unlimited OCR Works 2, Oct. 27, 2026](https://huggingface.co/baidu/Unlimited-OCR-2)
2. [Baidu ERNIE Team: Unlimited OCR Works 2: Pioneering the OCR-3.0 Era: From Long- to Unlimited-Horizon Parsing, Oct. 27, 2026](https://huggingface.co/baidu/Unlimited-OCR-2/blob/main/Unlimited-OCR-2.pdf)
3. [GitHub (baidu/Unlimited-OCR): Code repository](https://github.com/baidu/Unlimited-OCR)
4. [Hugging Face (baidu/MarathonDocBench): MarathonDocBench, Oct. 27, 2026](https://huggingface.co/datasets/baidu/MarathonDocBench)
5. [AlphaSignal: Baidu Open-Sources Unlimited OCR 2 to Parse Hundreds of Pages Without Breaking, Oct. 27, 2026](https://alphasignal.ai/news/baidu-open-sources-unlimited-ocr-2-to-parse-hundreds-of-pages-without-breaking)

Report an error: corrections@thejarrus.com
