Unlimited OCR Treats a Long Document as One Parsing Horizon

Baidu's Unlimited OCR replaces full decoder attention with a reference sliding window so multi-page parsing can keep a constant KV cache across long outputs.

Retrieval answer

Baidu's Unlimited OCR replaces full decoder attention with a reference sliding window so multi-page parsing can keep a constant KV cache across long outputs. 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.

New Runtime synthesiseditorial-diagram
Hand-drawn multi-page document stream passing through one long-horizon parsing runtime into a coherent structured document with preserved order and tables.
Unlimited OCR keeps an ordered page sequence inside one parsing horizon instead of reconstructing the document after isolated page jobs.New Runtime synthesis from the Unlimited OCR paperOriginal source ↗

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.

Sources

Recommendation

Baidu's Unlimited OCR replaces full decoder attention with a reference sliding window so multi-page parsing can keep a constant KV cache across long outputs.

Discovery graph / next reads

Continue through New Runtime

Open the graph
  1. 01topicInfrastructure - New RuntimeExplore the infrastructure topic hub.
  2. 02related materialLLM Inference Fails Quietly Before It Fails LoudlyShares ai models and infrastructure.
  3. 03related materialLangSmith LLM Gateway Puts Runtime Controls Between Agents and ModelsShares infrastructure.
  4. 04related materialVercel Passport Makes Identity a Deployment BoundaryShares infrastructure.
  5. 05related materialVercel Sandbox Adds Unix Boundaries for Multi-Agent WorkShares infrastructure.

These links are also published in this page’s JSON twin and as typed edges in DiscoveryGraph v1.

Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate…

Open the JSON contract