Baidu open-sources Unlimited-OCR-2 for unlimited-horizon document parsing
Baidu released Unlimited-OCR-2 on Hugging Face, an OCR model achieving unlimited-horizon parsing with Sparse Reference Sliding Window Attention (SR-SWA). The model is available under the MIT license and supports Transformers and SGLang inference.
China context
- Original name
- 百度
- Outside China
- Open weights · huggingface.co
- Claims
- Company-reported; not yet independently evaluated
- For builders
- Developers outside China can integrate Unlimited-OCR-2 via Hugging Face and use it under the MIT license for commercial applications.
- For investors
- Baidu's release of an open-weights OCR model with state-of-the-art long-document parsing may intensify competition in the document AI market.
Baidu released Unlimited-OCR-2 on Hugging Face, an OCR model that achieves unlimited-horizon parsing with Sparse Reference Sliding Window Attention (SR-SWA). SR-SWA compresses text-visual attention interactions from ultra-long sequences into a fixed-size set of working references (e.g., 512 tokens), bounding computational complexity and keeping per-step decoding latency and memory footprint nearly constant regardless of document length. The model achieves state-of-the-art performance on ultra-long document parsing benchmarks such as MPDocBench and MarathonDocBench. It is available under the MIT license and supports Transformers and SGLang inference.
Unlimited-OCR-2 introduces Sparse Reference Sliding Window Attention (SR-SWA), which compresses text-visual attention interactions from ultra-long sequences into a fixed-size set of working references (e.g., 512 tokens). This bounds computational complexity, keeping per-step decoding latency and memory footprint nearly constant regardless of document length. The model supports multi-page inference where all pages of a document are parsed in one request, enabling cross-page context. It is tested with Python 3.10, torch==2.13.0, transformers==4.52.1, huggingface-hub==0.36.0, tokenizers==0.21.4 on an NVIDIA A800-80GB.
Developers outside China can now use Baidu's Unlimited-OCR-2 under the MIT license, reducing the cost and complexity of parsing very long documents. The model's unlimited-horizon parsing capability may pressure other OCR providers to match its performance on hundred-page benchmarks.
Unlimited-OCR-2 provides a cost-effective solution for processing very long documents, potentially reducing infrastructure costs for enterprises that handle large volumes of scanned documents. Its MIT license allows commercial use without licensing fees.
The next observable signal is whether Baidu releases benchmark results on additional long-document datasets or if third-party evaluations confirm the claimed state-of-the-art performance. Adoption can be tracked via Hugging Face downloads and community contributions.