Baidu Open-Sources Unlimited OCR 2 to Parse Hundred-Page Documents at Once
Baidu's 3B open-source vision-language model parses hundred-page documents in a single request using a sparse attention trick that keeps memory flat.
- Baidu open-sources Unlimited OCR 2, a 3B MIT-licensed vision-language model for hundred-page document parsing.
- New SR-SWA attention caps context at a 512-token reference pool, keeping memory and latency flat.
- Scores 77.1 on MarathonDocBench vs 33.7 for Kimi-K3, with 7x faster decoding than full attention.
- Retains 94.02% on single-page OmniDocBench, so no regression on short documents.
- Runs on one 80GB GPU in BF16 (~6.7GB weights); supports Transformers, SGLang, and vLLM.
- Weakest at heading hierarchy (48.2 TEDS); MarathonDocBench scores are self-reported pending independent eval.
Baidu has open-sourced Unlimited OCR 2, a 3-billion-parameter vision-language model designed to parse documents spanning hundreds of pages while preserving cross-page context. The release uses the MIT license, includes source code, and offers a live demo on Hugging Face Spaces.
- Model size: 3 billion parameters and about 6.7 GB of BF16 weights.
- Maximum sequence length: 131,072 tokens, shared by the input and generated output.
- Tested hardware: One NVIDIA A800 GPU with 80 GB of memory.
- Inference options: Transformers for experiments, SGLang for serving, and community vLLM support.
Why standard OCR loses the thread
Conventional full attention becomes expensive as a document grows. Prefill computation scales quadratically with sequence length, while every generated token must attend to an expanding key-value cache. At the model’s reported rate of 273 image tokens per page, a 100-page document contributes 27,300 input tokens before generation begins.
Many OCR pipelines control those costs by processing each page independently and stitching the results together. That approach can break reading order, split tables across outputs, and lose relationships among footnotes, headings, clauses, and references on different pages.
Unlimited OCR 2 reduces that overhead with Sparse Reference Sliding Window Attention, or SR-SWA. The mechanism combines a 128-token local window with a fixed remote reference budget. Baidu’s published configuration selects 16 blocks containing 32 tokens each, producing a 512-token remote reference set.
This story is for Pro members
You've reached the end of the free preview. Upgrade to AlphaSignal Pro to read the full article - and everything else behind the paywall.