Baidu has introduced Unlimited OCR, a new OCR model focused on one of the most practical challenges in document AI: parsing long documents.
Modern OCR is no longer just about recognizing characters inside an image. It is increasingly about understanding complex documents: tables, formulas, dense layouts, reading order, notes, columns, and multi-page structures.
This is why many recent systems rely on end-to-end vision-language architectures. The document image is encoded visually, and a language-model decoder generates the structured output.
The advantage is clear: the model can use language priors to produce more coherent results.
The problem appears when the output becomes long.
The limit: longer output means more memory
In Transformer-based decoders, generation relies on an internal memory structure called the KV cache. In simple terms, it allows the model to reuse what it has already processed instead of recomputing everything from scratch.
In standard attention, however, this cache grows as the generated sequence grows.
For a single page, this is usually manageable. For dozens of pages, it becomes a real bottleneck: memory consumption increases, computation becomes heavier, and generation progressively slows down.
This is where Unlimited OCR becomes interesting.
The idea: a more human-like working memory
The paper starts from a simple observation: when humans copy a long document, they do not keep the entire already-written text in memory.
They look at the original source, keep track of a small portion of the text they have just written, and continue from there.
In other words, they maintain a stable reference to the source and a limited working memory that is enough to stay oriented.
Unlimited OCR brings this idea into the model architecture through a mechanism called Reference Sliding Window Attention, or R-SWA.
What R-SWA does
With R-SWA, each generated token attends to two things:
- all reference tokens, including the visual tokens and the prompt;
- only a recent window of previously generated tokens.
In the paper, the default window over generated tokens is 128 tokens.
This means that the model keeps full access to the original document, while retaining only a small working memory of the generated output.
As a result, the KV cache no longer grows linearly with the length of the generated text. It remains essentially constant.
Why it matters
The practical implication is important: if memory usage and latency remain stable, parsing long documents in a single flow becomes much more realistic.
According to the paper, Unlimited OCR can transcribe dozens of document pages in a single forward pass under a standard maximum length of 32K tokens. In long-document tests, it maintains strong results with 20-page inputs and also handles 40+ page cases.
Another interesting point is the model size. Unlimited OCR uses a Mixture-of-Experts architecture with 3B total parameters and around 0.5B active parameters during inference.
So the key idea is not simply scaling the model up. The interesting part is architectural: changing how attention and memory behave during long-horizon parsing.
The results
On OmniDocBench, Unlimited OCR reports highly competitive results against other end-to-end document parsing models.
The paper also reports a clear improvement over the DeepSeek OCR baseline across overall score, text recognition, formulas, tables, and reading order.
Efficiency is equally important: as output length increases, DeepSeek OCR slows down, while Unlimited OCR keeps a more stable generation speed thanks to the constant KV cache.
"Unlimited" does not mean truly infinite
The name is strong, but it should be read carefully.
The authors explicitly state that the model is not truly unlimited. It is still constrained by context length and by the prefill stage, where the source document is encoded into reference tokens.
Their future work points in two directions: longer context windows, such as 128K, and a mechanism that can dynamically retrieve chunks of reference KV cache, closer to the way a human might flip through pages while reading.
Why it caught our attention
Unlimited OCR is interesting for a simple reason: it makes OCR on long documents more practical.
Not one page at a time. Not with memory usage and latency growing with every generated token. But with a mechanism designed to keep the cost of reading stable.
For anyone working with contracts, reports, manuals, case files, or document archives, this is the key point: OCR has to handle real documents, not just clean benchmark examples.
Unlimited OCR does not solve the problem completely, but it points in a clear direction: more efficient models, able to read for longer without losing continuity.
Paper: Unlimited OCR Works
