Baidu open-sources Unlimited OCR 2 to enable parsing of documents of arbitrary length
On October 27, 2026, Baidu Inc. released and open-sourced Unlimited OCR 2. The model introduces Sparse Reference Sliding Window Attention (SR-SWA), compressing text-visual attention interactions in ultra-long sequences into a fixed-size working reference set (for example, 512 tokens), so that per-step decoding latency and memory usage remain nearly constant as documents grow longer, thereby supporting parsing of documents of arbitrary length within a limited context window.
The first-generation Unlimited OCR, released earlier on June 22, 2026, used DeepSeek OCR as the baseline and handled dozens of pages of documents through Reference Sliding Window Attention. The second generation further achieved SOTA on the dozens-of-pages-scale MPDocBench and the hundred-pages-scale MarathonDocBench, and the code and weights have also been released on GitHub and Hugging Face (baidu/Unlimited-OCR-2).
Inference supports Transformers and SGLang. SGLang can enable page-window scheduling for ultra-long documents (for example, 10 pages per window), reusing the KV tail from the previous window to control peak memory usage. The GitHub repository currently has about 29,000 stars.
Original sources:
Title: Unlimited OCR 2 is here, and it's open source. Publisher: Baidu Inc. (@Baidu_Inc) Publication date: 2026-10-27 URL: https://x.com/Baidu_Inc/status/2114910381311512987 Source type: original post by the party involved Verification: the full post and subsequent links were actually read for this report, verification date 2026-10-26 Supported content: release of Unlimited OCR 2, SR-SWA mechanism, arbitrary-length parsing, constant latency and memory, SOTA benchmarks, GitHub and Hugging Face links.
Title: Unlimited OCR Works 2 Publisher: Baidu (GitHub baidu/Unlimited-OCR) Publication date: 2026-10-27 (README updated) URL: https://github.com/baidu/Unlimited-OCR Source type: official code repository Verification: the README release notes, What's New, and inference section were actually read for this report, verification date 2026-10-26 Supported content: SR-SWA details, unlimited-span parsing, benchmark SOTA, page-window scheduling configuration, model name baidu/Unlimited-OCR-2.
Title: baidu/Unlimited-OCR-2 Publisher: Hugging Face / Baidu Publication date: 2026-10-27 URL: https://huggingface.co/baidu/Unlimited-OCR-2 Source type: official model page Verification: the model page content was actually read for this report, verification date 2026-10-26 Supported content: model release and availability, technical highlights, inference notes.
ABAB AI Insight
Baidu has long invested in document parsing. Its PaddleOCR project began around 2020 and has accumulated more than 90,000 GitHub stars, and it has spawned lightweight multimodal models such as PaddleOCR-VL. In June 2026, Baidu launched the first-generation Unlimited OCR based on DeepSeek OCR, using a MoE architecture with 3 billion total parameters and about 500 million active parameters, plus an R-SWA mechanism to process dozens of pages of documents, and it improved by about 6 percentage points relative to the baseline on OmniDocBench. The second generation advances along this path, with the core change being further compression of attention computation to cover longer spans.
In terms of capital and business path, the model is open-sourced under the MIT license, with weights and code directly placed on Hugging Face and GitHub; the first-generation model once exceeded one million downloads per month on Hugging Face. Earlier versions had already been integrated into Baidu Cloud document parsing services. Open source itself does not directly generate subscription revenue, but it lowers the barrier for developers to integrate it, while also providing the technical foundation for cloud-based long-document processing APIs, making capabilities such as cross-page tables and paragraph continuity convertible into structured data products for enterprise customers.
Compared with the first generation, the second generation pushes the processing range from one-time parsing of dozens of pages to arbitrary length within a limited window, and uses window scheduling to control memory. Compared with the PaddleOCR-VL in the same series (smaller parameters, higher scores on some versions of OmniDocBench) or the DeepSeek OCR series, Unlimited OCR 2 emphasizes constant complexity at the decoding stage rather than peak single-page accuracy. The difference is that the former focuses on lightweight deployment and robustness on complex layouts, while the latter targets end-to-end continuity for ultra-long documents, avoiding cross-page table and paragraph breakage caused by traditional page-by-page splicing.
This change reduces the bottlenecks of memory and latency growth in long-document processing, making one-shot structured output for full contracts, research reports, or book-scale materials a more feasible option and reducing context loss after chunking. Actual performance still depends on the resolution of the vision encoder for very small text and complex cross-page elements, as well as the continuity accuracy at window boundaries. The observation metric is whether the error rate for cross-page table merging and reading order in real thousand-page-scale documents remains stable as the page count increases.
ABAB News · Cognitive Law
A fixed working reference set compresses attention computation from quadratic growth with length into something nearly constant.
Open-source weights trade for downloads and cloud-service access, making long-document continuity a sellable capability.
Window scheduling reuses boundary states, making “infinite span” viable within limited GPU memory.