Baidu has released Unlimited OCR 2, an open-source model designed to turn ordered page images into structured text in a single request, MarkTechPost reported on 26 October. The 3.34B-parameter model handles text, tables, formulas, figures, headings and reading order. Its central change is a way of limiting how much earlier material the model examines while producing each new piece of text, so a longer document need not make every decoding step slower.
Key points
- Unlimited OCR 2 selects visual references from a fixed working set of 512 tokens.
- Baidu reports a score of 77.1 on its hundred-page MarathonDocBench benchmark.
- Code and weights are available under the MIT licence.
SR-SWA narrows the pages in view
Baidu’s first Unlimited-OCR, released in June, extended parsing from individual pages to dozens of consecutive pages using reference sliding window attention, Pandaily reported. The replacement, Sparse Reference Sliding Window Attention, or SR-SWA, first selects pages relevant to the text being generated. It then draws on the highest-scoring groups of visual tokens from those pages, retaining access to material further back in the document without scanning every page at every step.
The distinction is between keeping a document available and keeping all of it on the desk at once. As the model writes, its attention mechanism needs references to the page images. SR-SWA reduces those text-to-image references to a fixed working set of 512 tokens, rather than letting the amount inspected at each step grow with the document. The model also uses a local window for nearby text. This arrangement is intended to keep the latency and memory needed for each decoding step nearly constant as page counts rise.
Reading a long report with tables and formulas could become a continuous extraction task rather than a series of separate page extractions, if its images were supplied in order. The fixed set of references would limit how much earlier visual material the model had to inspect for each new token, while still allowing it to draw on other pages when their content was relevant.
That fixed cost applies to a decoding step, not to processing the entire document: image encoding and total running time still increase with the number of pages. Baidu puts SR-SWA’s per-step decoding speed on a 100-page document at seven times that of full attention, and at 5.6 times that of its earlier reference sliding window design. Baidu also demonstrated a single run through all seven Harry Potter books, comprising more than 3,600 pages.
Baidu’s MarathonDocBench score reaches 77.1
Baidu reports a score of 84.6 on MPDocBench, which tests parsing across multiple pages, and 77.1 on MarathonDocBench, its benchmark for documents of hundreds of pages. The MPDocBench parsing set contains 433 documents and 3,246 pages. These are scores for structured document extraction, including more than plain text recognition; they are not measurements of how quickly an entire document is processed.
On Baidu’s MarathonDocBench chart, Kimi-K3 scored 33.7 and Gemini-3.8-Flash scored 28.6; Baidu’s preceding Unlimited-OCR scored 0.0. The same chart gives Unlimited OCR 2 a heading-hierarchy score of 48.2, its lowest component result on that benchmark. All of those comparisons come from Baidu’s tests, rather than independent evaluations. Independent evaluations had not been published when Pandaily reported the release.
The two benchmarks also put different demands on the model. MPDocBench covers documents spanning multiple pages, while MarathonDocBench tests much longer ones. Baidu released MarathonDocBench alongside Unlimited OCR 2, so its 77.1 score measures performance on a test introduced by the organisation that built the model. The chart supplies a comparison with other models on that test, as well as the result for Baidu’s earlier version.
MIT release offers two deployment routes
Code and weights are available on GitHub and Hugging Face under the MIT licence, with access also offered through Baidu AI Cloud and the Baidu AI Open Platform. The model runs on one CUDA GPU using BF16, a reduced-precision number format, and its BF16 weights occupy about 6.7 GB. Transformers is listed for quick tests and SGLang for serving, giving developers a route to run the model themselves as well as Baidu’s hosted options.
Those routes have implementation details that matter in deployment. Loading the model through Transformers requires setting trust_remote_code=True, which executes Python code from its repository. SGLang serving uses a customised wheel supplied by Baidu rather than the standard SGLang package. Baidu’s example divides work into windows of 10 pages and reuses material from the previous window; smaller windows reduce peak memory but weaken the merging of information across pages.
Baidu plans to show more of Unlimited OCR 2 at Baidu World 2026 on 12 November, Pandaily reported.