Unlimited OCR Works

📅 2026-06-22
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the inefficiency of conventional end-to-end OCR models in processing long documents, where memory consumption and inference latency grow linearly with sequence length due to KV cache expansion. Building upon DeepSeek OCR, the authors propose Reference Sliding Window Attention (R-SWA), a novel mechanism that replaces standard decoder attention layers to emulate human working memory. R-SWA maintains a constant-sized KV cache regardless of input length, thereby substantially reducing computational overhead. This approach achieves, for the first time in OCR decoding, KV cache independence from input sequence length, enabling transcription of dozens of pages in a single forward pass under a 32K-token context. The method significantly enhances long-document processing efficiency and shows promising applicability to other sequence generation tasks such as automatic speech recognition and machine translation.
📝 Abstract
Recently, end-to-end OCR models, exemplified by DeepSeek OCR, have once again thrust OCR into the spotlight. A widely held view is that employing a large language model (LLM) as the decoder allows the model to leverage the prior distribution of language, leading to improved OCR performance. However, the downside is equally evident: as the output sequence lengthens, the accumulated KV cache drives up memory consumption and progressively slows down generation. This stands in stark contrast to humans, who exhibit no such decline in efficiency during long-horizon copying tasks. In this technical report, we propose Unlimited OCR, a model designed to emulate human parsing working memory. Taking DeepSeek OCR as the baseline, we replace all attention layers in the decoder with our proposed Reference Sliding Window Attention (R-SWA), which reduces attention computation costs while maintaining a constant KV cache throughout the entire decoding process. By combining the high compression rate of DeepSeek OCR's encoder with our constant KV cache design, Unlimited OCR can transcribe dozens of pages of documents in a single forward pass under a standard maximum length of 32K. More importantly, R-SWA is a general-purpose parsing attention mechanism - beyond OCR, it is equally applicable to tasks such as ASR, translation, etc. Codes and model weights are publicly available at http://github.com/baidu/Unlimited-OCR.
Problem

Research questions and friction points this paper is trying to address.

OCR
KV cache
long-sequence generation
memory efficiency
decoding speed
Innovation

Methods, ideas, or system contributions that make the work stand out.

Reference Sliding Window Attention
constant KV cache
long-context OCR
efficient decoding
general-purpose parsing
🔎 Similar Papers
No similar papers found.