Unlimited OCR: A 3B Model That Keeps the KV Cache Constant to Read Dozens of Pages in One Pass
Unlimited OCR is a 3B-parameter OCR model from Baidu researchers that replaces every attention layer in the DeepSeek OCR decoder with Reference Sliding Window Attention (R-SWA), keeping the KV cache at a constant size no matter how long the output grows. Released in June 2026, the technical report "Unlimited OCR Works" (arXiv 2606.23050, Youyang Yin et al.) cuts the problem of a decoder that balloons in memory and slows down as generation lengthens, transcribing dozens of pages of documents in a single forward pass under a standard maximum length of 32K tokens. The weights are released under an MIT license.
Why End-to-End OCR Slows Down on Long Outputs
End-to-end OCR uses an LLM as the decoder to leverage the prior distribution of language, but it carries a clear downside: as the output sequence lengthens, the accumulated KV cache drives up memory consumption and progressively slows generation. The DeepSeek OCR family that exemplifies this approach is powerful at turning document images into text, yet costs rise as the amount handled in one pass grows.
The report contrasts this with human working memory. People show no such efficiency decline during long copying tasks, while a conventional decoder grows steadily slower as tokens accumulate.
What R-SWA Changes: Replacing Decoder Attention Wholesale
Reference Sliding Window Attention (R-SWA) is a new attention that takes DeepSeek OCR as the baseline and replaces all of the decoder's attention layers. R-SWA reduces attention computation cost while maintaining a constant KV cache throughout the entire decoding process.
The core idea is refusing to grow memory without bound. Because the cache stays fixed as output lengthens, the generation curve that used to slow with length flattens out. As its name suggests, the design imitates human parsing working memory.
One Forward Pass, Dozens of Pages, a Standard 32K Length
Unlimited OCR combines the high compression rate of DeepSeek OCR's encoder with R-SWA's constant KV cache to transcribe dozens of pages of documents in a single forward pass under a standard maximum length of 32K tokens. Unlike pipelines that split long documents page by page across many calls, this model is defined by reading long stretches in one pass.
The combination has a clear meaning. The encoder compresses pages into few tokens, and the decoder takes those tokens with constant memory, so efficiency does not collapse as length grows.
Release and Metrics: MIT License and ParseBench
Unlimited OCR is a 3B-parameter model published on Hugging Face under an MIT license and runs on Transformers and SGLang. The model card reports evaluation on llamaindex's ParseBench, scoring 46.17 mean, 86.81 on text content, and 0.97 on text formatting.
Reading these scores calls for care. A high text-content score alongside a low formatting score shows that reading characters and reconstructing layout, tables, and formatting are different axes. OmniDocBench scores and throughput figures cited by some secondary outlets are not confirmed in the primary sources (the arXiv report and the model card), so they are omitted here.
Why a Constant KV Cache Matters at the Architecture Level
Viewing this model only through a benchmark leaderboard misses the point. The bottleneck in earlier end-to-end OCR was scalability, not accuracy. When memory and latency grow in proportion to output length, even a highly accurate decoder sees costs balloon to an unmanageable level on long documents. R-SWA touches the slope of that curve itself. What sets it apart is that it is not an improvement that lifts accuracy by a few points, but one that tries to remove the premise "the longer it gets, the more expensive it becomes."
Read this way, the competitor the research targets is not another OCR model but the pipeline practice of chopping long documents page by page across repeated calls. Reading a document in one continuous pass without splitting removes both the problem of tables and paragraphs being cut at page boundaries and the overhead repeated on every call. It is also worth noting that this picture only holds when the encoder's high compression rate and the constant cache are paired together.
How to Read This Model for Real-World Deployment
Many document workflows involve documents that are both long and complex in formatting, such as multi-page contracts, papers, and official government forms. A design that reads long stretches in one pass can reduce the call cost and post-processing burden of parsing such long documents. That said, the low 0.97 formatting score in the published metrics should be read as a signal that self-verification is needed before applying it directly to densely laid-out documents with tables and structure.
The limits should be stated plainly too. The quantitative evidence is concentrated on the single axis of ParseBench, and generalization to specific document types or large-scale real use remains unverified. Thanks to the MIT license and support for running on Transformers and SGLang, the barrier to running your own benchmark in-house to check is relatively low. From the perspective of a model that changed the cost curve rather than a ranking, adoption decisions are better weighed by the total cost of long-document processing than by a few points of accuracy.
Reference: Unlimited OCR Works (Youyang Yin et al., Baidu, 2026, arXiv 2606.23050) · Model card (baidu/Unlimited-OCR, MIT)

AI & tech,
read in depth
Beyond the headlines — into the context and the structure
AGI Soon As Possible · asapai.co.kr