On Oct 27, Baidu's official @Baidu_Inc account announced the open-source release of Unlimited OCR 2 on Hugging Face under the MIT license. Its new SR-SWA attention compresses text-visual interactions into a fixed-size reference set, which Baidu says lets it parse documents of any length within a finite context window. Baidu reports 84.6 on MPDocBench (dozens of pages) and 77.1 on MarathonDocBench (hundreds of pages), both self-reported.
Key Takeaways
- ✓SR-SWA compresses text-visual attention over very long sequences into a fixed-size reference set (e.g. 512 tokens), which Baidu says keeps per-step decode latency and memory nearly flat as page count grows
- ✓Per Baidu: 84.6 overall on MPDocBench, 6.3 points above the next best, Qwen3.8-Max (78.3)
- ✓Per Baidu: 77.1 overall on MarathonDocBench, 43.3 points above the next best, Kimi-K3 (33.7); the first Unlimited-OCR scores 0 there
- ✓Weights are on Hugging Face under MIT, about 3.3B parameters by the HF weight count, with Transformers and a customized SGLang build for serving
- ✓All scores are Baidu's own measurements with no third-party reproduction yet

Key Decision Metrics at a Glance
Turn your technical choice into a development budget
Compare 40 dev plans & simulate token costs vs $20/mo subscriptions
Project Links & Resources
Direct AccessIn-Depth Technical Analysis
Background and pain points
When RAG pipelines and agents read contracts, filings or books, they need dozens to hundreds of scanned pages turned into structured text in one pass. Page-by-page OCR loses tables and paragraphs that span pages, while feeding a whole document to a multimodal model makes attention compute and KV memory grow quickly with page count. Baidu open-sourced the first Unlimited-OCR in June, building on the DeepSeek-OCR approach, and on Oct 27 its official @Baidu_Inc account announced the open-source Unlimited OCR 2.
Architecture and mechanism
The core change is SR-SWA (Sparse Reference Sliding Window Attention). It compresses text-visual attention interactions over very long sequences into a fixed-size set of working references (512 tokens in the model card's example), which bounds per-step decode compute. Baidu says this lets the model parse documents of any length within a finite context window, with decode latency and memory nearly flat as documents grow. It has about 3.3B parameters by the Hugging Face weight count and ships under the MIT license.
Benchmarks
All figures are Baidu's own. On MPDocBench (dozens of pages) it scores 84.6 overall, ahead of Qwen3.8-Max at 78.3 and Gemini-3.8-Flash at 76.2. On MarathonDocBench (hundreds of pages) it scores 77.1, while the next best, Kimi-K3, scores 33.7 and the first Unlimited-OCR scores 0. There is no third-party reproduction yet.
Getting started
Weights are at baidu/Unlimited-OCR-2 on Hugging Face. Use Transformers' infer_multi to pass all page images in one request for cross-page parsing, or install Baidu's customized SGLang wheel to run an OpenAI-compatible server. The model card suggests 10-page windows for very long documents and mem-fraction-static 0.7 for stability. Before production, compare table and reading-order accuracy on your own long documents.
Benchmark side-by-side against alternatives, or calculate monthly token cost vs subscription break-even.
Discussion & Comments
0Sign in to join the discussion
Connect with AI developers to exchange benchmark insights.