---
schema_version: "newruntime-agent-readable-v0.2"
type: "post"
stable_id: "post:unlimited-ocr-long-horizon-parsing"
slug: "unlimited-ocr-long-horizon-parsing"
title: "Unlimited OCR Treats a Long Document as One Parsing Horizon"
description: "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_nugget: "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."
status: "published"
published_at: "2026-07-30"
updated_at: "2026-07-30"
record_date: "2026-07-30"
date_kind: "published_at"
topics: ["ai-models","infrastructure"]
source_urls: ["https://huggingface.co/baidu/Unlimited-OCR","https://arxiv.org/abs/2606.23050"]
visuals: [{"id":"unlimited-ocr-long-horizon-parsing-nano-banana","kind":"editorial-diagram","role":"hero","src":"https://newruntime.com/images/posts/unlimited-ocr-long-horizon-parsing-nano-banana.webp","alt":"Hand-drawn multi-page document stream passing through one long-horizon parsing runtime into a coherent structured document with preserved order and tables.","caption":"Unlimited OCR keeps an ordered page sequence inside one parsing horizon instead of reconstructing the document after isolated page jobs.","credit":"New Runtime synthesis from the Unlimited OCR paper","source_url":"https://arxiv.org/abs/2606.23050","generated_with":"gemini-3.1-flash-image","width":1600,"height":900,"legend":[]}]
telegram_message_id: 2890
telegram_url: "https://t.me/qwgai/2890"
telegram_message_ids: [2890,2891]
telegram_delivery_mode: "text_then_media"
telegram_media_url: "https://t.me/qwgai/2891"
routes: {"html":"https://newruntime.com/posts/unlimited-ocr-long-horizon-parsing/","markdown":"https://newruntime.com/posts/unlimited-ocr-long-horizon-parsing.md","json":"https://newruntime.com/posts/unlimited-ocr-long-horizon-parsing.json"}
source_format: "markdown"
---

# Unlimited OCR Treats a Long Document as One Parsing Horizon

## 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.

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

- [Baidu Unlimited-OCR model card](https://huggingface.co/baidu/Unlimited-OCR)
- [Unlimited OCR Works](https://arxiv.org/abs/2606.23050)
