Most OCR pipelines split a document into pages, parse each page, then try to reconstruct reading order and structure afterward. Baidu’s Unlimited OCR explores the opposite direction: keep dozens of pages inside one long parsing horizon.
The bottleneck is not only visual encoding. End-to-end OCR systems often use a language model as the decoder, which helps exploit language priors but accumulates KV-cache state as the output grows. Long documents become progressively slower and more memory-hungry.
Unlimited OCR replaces the decoder’s attention layers with Reference Sliding Window Attention. The authors say this keeps KV-cache usage constant while reducing attention computation across the full output sequence. Combined with a compressed visual encoder, the model can transcribe dozens of pages in one forward pass under a 32K maximum length.
That changes what “document OCR” can mean. Instead of independent page jobs, the system can carry ordering and working context across a multi-page sequence. The model card exposes separate paths for a single cropped image and for ordered page images or PDFs converted to images.
Where it fits
The open model is available under an MIT license and can run through Transformers, vLLM, or SGLang. The published Transformers example supports single-image parsing and infer_multi for an ordered page list. The model card also provides vLLM images and an official deployment recipe.
The research claim is broader than the current evidence. The paper proposes R-SWA as a general parsing attention mechanism that could also apply to speech recognition or translation, but the released artifact and evaluation center on OCR. Long-horizon coherence should still be tested on the layouts, languages, tables, and error costs of a real corpus.
For an agent system, the valuable output is not a wall of extracted text. It is a structured, ordered document artifact with provenance back to pages and regions. Unlimited OCR attacks the memory bottleneck that makes that whole-document path expensive.
