Back to Flash News

Baidu open-sources Unlimited OCR 2 for parsing 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), keeping step-by-step decoding latency and memory usage nearly constant as documents get longer, thereby supporting the 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 its baseline and processed 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-page-scale MarathonDocBench, and its code and weights have also been uploaded to 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 tail of the KV cache from the previous window to control peak memory usage. The GitHub repository currently has about 29,000 stars.

Original sources:

  1. 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 concerned Verification status: The full post and subsequent links were actually read for this report; verification date 2026-10-26 Supporting content: release of Unlimited OCR 2, SR-SWA mechanism, arbitrary-length parsing, constant latency and memory, SOTA benchmarks, GitHub and Hugging Face links.

  2. 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 status: The README release notes, What's New, and inference section were actually read for this report; verification date 2026-10-26 Supporting content: SR-SWA details, unlimited-span parsing, benchmark SOTA, page-window scheduling configuration, model name baidu/Unlimited-OCR-2.

  3. 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 status: The model page content was actually read for this report; verification date 2026-10-26 Supporting content: model release and availability, technical highlights, inference instructions.

ABAB AI Insight

Baidu has long invested in the field of 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, together with the R-SWA mechanism, to process dozens of pages of documents, and on OmniDocBench it improved by about 6 percentage points relative to the baseline. The second generation continues along this path, with the core change being further compression of attention computation to cover a longer span.

On the capital and business path, the model is open-sourced under the MIT license, with weights and code placed directly on Hugging Face and GitHub; the first-generation model once exceeded one million downloads in a single month on Hugging Face. Previous 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 adopt the model and also provides the technical foundation for cloud-based long-document processing APIs, enabling capabilities such as cross-page table handling and paragraph continuity to be transformed into structured-data products for enterprise customers.

Compared with the first generation, the second generation expands the processing scope from a single parse of dozens of pages to arbitrary length within a limited window, and controls memory through window scheduling. Compared with the sibling PaddleOCR-VL (smaller parameter count and higher scores on some OmniDocBench versions) or the DeepSeek OCR series, Unlimited OCR 2 places greater emphasis on constant decoding-stage complexity rather than peak single-page accuracy. The difference is that the former focuses on lightweight deployment and robustness for complex layouts, while the latter targets end-to-end coherence in ultra-long documents, avoiding the cross-page table and paragraph breaks caused by traditional page-by-page stitching.

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-length materials a more feasible option and reducing context loss after chunking. The actual effect still depends on the visual encoder's resolution for extremely small text and complex cross-page elements, as well as the stitching accuracy at window boundaries. The key metric to watch is whether the error rate in cross-page table merging and reading order on real thousand-page documents remains stable as page counts increase.

ABAB News · Cognitive Laws

  1. A fixed working reference set compresses attention computation from quadratic growth with length into something nearly constant.

  2. Open-source weights exchange for downloads and cloud service access, making long-document coherence a sellable capability.

  3. Window scheduling reuses boundary states, making “infinite span” possible within limited VRAM.