End-to-end OCR has long been stuck within ten pages because the KV cache grows linearly with output length — every additional generated character adds another slice of VRAM and latency. The Baidu team took a step back to how humans copy a book, with "working memory," and proposed Reference Sliding Window Attention (R-SWA), which compresses the KV cache to a constant on top of DeepSeek OCR's base. Overnight, the model can parse dozens of PDF pages in a single forward pass, and on OmniDocBench v1.5 it pulls another 6 points ahead of DeepSeek OCR.

On June 22, Baidu open-sourced Unlimited OCR Works simultaneously on GitHub, arXiv (2606.23050), Hugging Face, and ModelScope — a 3B-total / 500M-active MoE end-to-end model under MIT, hitting GitHub Trending and the Hugging Face multimodal-trend chart the day after release. The base is still DeepSeek OCR's DeepEncoder — 16× token compression squashes a 1024×1024 PDF page into 256 visual tokens, locking down the prefix cost of multi-page inference.

The real surgery is on the decoding side. R-SWA opens two independent channels for "reference tokens (visual + prompt)" and "the most recent n output tokens (default 128)": the reference segment L_m is length-bound by image resolution only, and once encoded it stays static throughout decoding so visual features are never "smeared" by their own output; the decoding segment is a fixed-capacity queue that slides out, so old tokens' KV keeps getting evicted, and the total cache size converges to the constant L_m + n.

The paper's contrast is intuitive: a standard MHA cache is L_m + T (linear growth); R-SWA is L_m + min(n, T) ≤ L_m + n (constant). When T is much larger than n, the cache ratio approaches 0. The Flash Attention v3 kernel latency also flattens into a horizontal line, while DeepSeek OCR spikes every time it crosses a KV-alignment boundary.

On OmniDocBench v1.5 Unlimited OCR scores 93%, 6 points ahead of DeepSeek OCR; on public eval v1.6 it hits a comprehensive 93.92%, refreshing the public record for end-to-end OCR. The longest single inference is 32K — dozens of PDF pages parsed in one forward pass. Within six days of release, vLLM added a recipe (vllm/vllm-openai:unlimited-ocr image), SGLang shipped a streaming server in parallel, and AK put up a demo on Hugging Face Spaces.

A larger signal hides in the paper's close: R-SWA is a "reference-style parsing attention" that is static for reference tokens and sliding for output tokens. That structure is a natural fit for ASR (where reference tokens are audio segments), long-document translation, and codebase-scale multi-file refactoring — every "long output + fixed reference" task. It's not just an OCR upgrade; it's a new attention paradigm: instead of bracing for ever-longer context windows, the attention itself becomes friendly to long output.