AI

Baidu's Unlimited OCR transcribes entire books in one go

4 min read
Abstract geometric illustration: a stack of books in book form, from which a continuous line flows into a small, consistently sized memory buffer, symbolizing constant memory requirements when processing long documents Image generated with GPT Image 2
Abstract geometric illustration: a stack of books in book form, from which a continuous line flows into a small, consistently sized memory buffer, symbolizing constant memory requirements when processing long documents

TL;DR Too Long; Didn’t read

Baidu has introduced Unlimited OCR, an open-source document recognition model released under the MIT license, which processes long documents like entire books in one pass thanks to a new architecture called Reference Sliding Window Attention (R-SWA), without the memory requirements increasing with the number of pages. The model, based on DeepSeek OCR, has 3 billion total and around 500 million active parameters and achieves a score of 93.92 on OmniDocBench v1.6 according to Baidu's own paper, just ahead of the next-ranked model in a highly competitive research field with predominantly self-reported comparison values. For books over 40 pages, the error distance remained below 0.11 with around 97 percent word accuracy, according to the paper.

Key takeaways

  • Baidu has introduced Unlimited OCR, an open-source model that processes long documents like entire books in one pass without the memory requirements increasing with the number of pages.
  • This is made possible by a new architecture called Reference Sliding Window Attention (R-SWA), which keeps the KV cache consistently sized instead of allowing it to grow with each page.
  • The model is based on DeepSeek OCR and has a comparatively compact size with 3 billion total and around 500 million active parameters.
  • On OmniDocBench v1.6, Unlimited OCR achieves a score of 93.92 according to Baidu's own paper, just ahead of the next-ranked model in a highly competitive, rapidly changing research field.
  • For books over 40 pages, the character error distance remained below 0.11 with around 97 percent word accuracy, according to the paper.
  • Model weights and code are freely available under the MIT license on GitHub and Hugging Face.

Baidu has introduced “Unlimited OCR,” an open-source model for document recognition that can transcribe entire books in a single pass without the memory requirements increasing with the document length. This is made possible by a new attention architecture that Baidu calls “Reference Sliding Window Attention” (R-SWA).

The Problem: Growing Memory Requirements for Long Documents

Most current OCR models based on large language models process documents page by page. With each additional page, the so-called KV cache grows – a temporary storage that remembers previous token representations so that the model can continue writing consistently. For very long documents like entire books, this growth eventually leads to insufficient available GPU memory or significantly slower processing.

The Solution: Reference Sliding Window Attention

According to the associated technical paper on arXiv, Baidu addresses this problem with R-SWA, an architecture that mimics how humans transcribe a book: the focus remains on the source, the immediately preceding context, and the words to be written next, while more distant, no longer needed information is deliberately “forgotten.” This keeps the size of the KV cache constant, regardless of how many pages have already been processed. According to Baidu, this allows the model to process more than 40 pages in a single forward pass without losing context or becoming noticeably slower.

Built on DeepSeek OCR

Unlimited OCR is not a completely new model but explicitly builds on the architecture of DeepSeek OCR, as stated in the GitHub repository, whose underlying principle – processing text content as a compressed image representation rather than as long character strings – was already described in the original DeepSeek-OCR paper. The model itself is relatively compact, with 3 billion total parameters, of which only about 500 million are active at runtime. Baidu releases model weights and code under the MIT license on GitHub and Hugging Face.

The Numbers in Detail

On the standard testing procedure OmniDocBench, which evaluates document recognition across text reproduction, formula recognition, table structure, and reading order, Unlimited OCR achieves a total score of 93.23 on the older version v1.5 – an increase of about 6.2 points compared to the DeepSeek-OCR model used as a baseline. On the newer version v1.6, Unlimited OCR scores 93.92 points. In a custom test set with books longer than 40 pages, the character error distance remained below 0.11, with a word accuracy (“Distinct-35”) of around 97 percent.

A Narrow Lead in a Highly Competitive Field

Important for context: The score of 93.92 on OmniDocBench v1.6 makes Unlimited OCR the best-placed model in Baidu’s own comparison table, but the gap to the next-ranked system is very narrow – on the order of a few hundredths of a point. Additionally, Baidu explicitly compares only with models listed in the official OmniDocBench repository; this is therefore a snapshot of a rapidly evolving field with predominantly self-reported values from various providers, not an independently verified overall ranking. The actual contribution of the paper lies less in a clear accuracy advantage and more in the ability to process very long documents with constant memory requirements in a single pass – an area where traditional page-by-page models structurally hit limits.

Not Really Unlimited Yet

The name “Unlimited OCR” describes more of a design direction than an absolute state. The tests documented in the paper cover books of over 40 pages; the actual practical upper limit of the method is not definitively quantified in the paper. It also remains unclear how robust the architecture is across very different document types – such as handwritten texts, multi-column layouts, or heavily damaged originals – over significantly longer stretches.

Why the Topic is Interesting Beyond OCR

The underlying idea of compressing text content through an image representation has relevance far beyond mere text recognition. As described in the DeepSeek-OCR paper, processing text as a compressed image requires significantly less computational effort than processing the same amount of text as a traditional character string. Researchers are therefore discussing whether such compression methods could be used in the future to increase the effectively usable context memory of language models without allowing the computational effort to grow proportionally.

Classification

Unlimited OCR demonstrates a concrete technical advancement in a practical problem: processing very long documents without growing memory requirements. The reported accuracy values are part of a highly competitive, rapidly changing research field with predominantly self-reported comparison values – the actual contribution lies less in a clear accuracy advantage and more in the architectural solution to the memory problem itself.

Frequently asked questions

What is Baidu's Unlimited OCR?

Unlimited OCR is an open-source document recognition model from Baidu that can process long documents like entire books in one pass thanks to a new attention architecture called R-SWA, without the memory requirements increasing with the number of pages.

How does Reference Sliding Window Attention (R-SWA) work?

R-SWA (Reference Sliding Window Attention) is modeled after human transcription: the model focuses on the source, the immediate context, and the next words to be written, while discarding unnecessary information. This keeps the KV cache consistently sized instead of growing with the document length.

Is Unlimited OCR really the most accurate OCR model?

On OmniDocBench v1.6, Unlimited OCR achieves a score of 93.92 according to Baidu's own paper, placing it just ahead of the next-ranked model in Baidu's comparison table. The margin is very small, and Baidu only compares with models from the official OmniDocBench repository, not with an independently verified overall ranking.

Is Unlimited OCR a completely new model?

No, it explicitly builds on the architecture of DeepSeek OCR, which processes text content as a compressed image representation. Baidu adds this principle with the new R-SWA architecture for constant memory requirements when processing long documents.

Can Unlimited OCR really process unlimitedly long documents?

The tests documented in the paper cover books of over 40 pages. Where the actual practical upper limit lies and how robust the method is across very different document types over even longer stretches is not conclusively clarified in the paper.

#AI

← Back to the blog