Baidu open-sources 3B OCR model for one-pass, multi-page PDF parsing
Unlimited-OCR keeps its decoder cache fixed, though the viral 100-page claim runs ahead of Baidu's published tests.
By Ryan Merket · Published
Why it matters
Baidu's fixed-cache decoder could reduce the cost and complexity of parsing long documents locally, but developers should treat 40-plus pages, not 100, as the tested range.

Baidu released Unlimited-OCR, an open-weight vision-language model designed to parse dozens of document pages in one forward pass while preventing its decoder memory from growing with every generated token.
The model appeared on June 22nd, nearly four weeks before a July 19th thread on X described it as a "peanut-sized OCR" capable of reading an entire 100-page PDF at once. Baidu's research supports the broader claim that Unlimited-OCR can process long, multi-page documents without resetting between pages. It does not establish reliable, one-shot parsing of arbitrary 100-page PDFs.
Baidu's core contributors were Youyang Yin, project leader Huanhuan Liu, and a technical director identified in the paper only as YY. Their work addresses a specific bottleneck in OCR models built around large language model decoders: the key-value cache, or KV cache, normally expands as the model generates more text. Memory use rises and generation slows as a transcription gets longer.
Unlimited-OCR replaces the decoder's conventional attention layers with what the researchers call Reference Sliding Window Attention, or R-SWA. Each output token can still attend to all visual tokens from the input document, while its view of previously generated text is limited to a sliding window. The default window in the paper is 128 tokens.
That design keeps the decode-side KV cache at a fixed size. The model can continue moving through a document without storing its full transcription history in the cache. Baidu describes the approach as a form of "soft forgetting," modeled on a person copying text while looking at the source and remembering only the nearby words needed to maintain position.
A 3B model with 500M active parameters
Unlimited-OCR builds directly on DeepSeek-OCR, retaining its compressed visual encoder and mixture-of-experts decoder. The model contains about 3 billion total parameters, with 500 million activated during inference. Its weights occupy 6.67 GB in the Hugging Face repository, which distributes the model under the MIT license.
"Runs locally" still comes with a hardware qualifier. Baidu's published Transformers setup was tested on an Nvidia GPU with CUDA 12.9 and loads the model in bfloat16. The official instructions call .cuda() directly. Baidu has also added deployment paths for vLLM, SGLang and Docker, but the reference setup is a GPU application rather than a lightweight CPU utility.
PDFs are first converted into page images with PyMuPDF. Those images are then submitted together through the model's multi-page inference method. The model therefore reads a collection of rendered pages in one generation sequence; it does not ingest the PDF file format directly.
The technical report, posted on June 23rd, says Baidu trained Unlimited-OCR from a DeepSeek-OCR checkpoint using roughly 2 million document samples. About 200,000 were synthetic multi-page examples containing between two and 50 pages. Baidu froze the visual encoder and trained the language-model parameters for 4,000 steps on 128 A800 GPUs, using a maximum sequence length of 32,000 tokens.
Baidu reported an overall score of 93.23 on OmniDocBench v1.5, compared with 87.01 for the original DeepSeek-OCR and 89.17 for DeepSeek-OCR 2. On the newer v1.6 benchmark, Unlimited-OCR scored 93.92, narrowly above the other end-to-end models included in Baidu's table. These are results reported by the Unlimited-OCR researchers rather than an independent evaluation.
The long-document test deserves a narrower reading than the name "Unlimited" suggests. Baidu evaluated groups of books, documents and papers at two, five, 10, 20 and more than 40 pages. The researchers reported an edit distance below 0.11 in the 40-plus-page group, alongside a metric intended to detect repetitive output. They also found that small text became difficult to recognize because multi-page mode renders each page at 1024 by 1024 pixels.
The paper says the model can prefill tens to hundreds of pages, depending on their contents, but its measured long-horizon results stop at the open-ended 40-plus-page bucket. Page count alone is a poor capacity measure: a sparse slide deck and a densely typeset legal filing can produce radically different visual and output token loads.
"Unlimited" remains an engineering target
The fixed decode cache removes one constraint without removing the model's 32,000-token context limit. Visual tokens for all input pages still have to fit into the initial prompt, and the transcription must fit within the generation allowance. Baidu states in the report's limitations section that Unlimited-OCR cannot provide truly unlimited parsing under a finite context window.
The researchers plan a 128,000-token version and eventually want the model to retrieve visual-cache segments as needed, similar to flipping backward and forward through a book. Neither capability is part of the current release.
The immediate contribution is narrower and technically useful. Baidu has shown that an OCR decoder can keep attending to the complete visual input while discarding most of its old generated-text cache. In Baidu's theoretical throughput test, DeepSeek-OCR's speed declined as output length increased, while Unlimited-OCR stayed roughly flat and produced 35% more tokens per second at about 6,000 output tokens.
That makes Unlimited-OCR relevant to document pipelines where continuity across pages matters, including tables that cross page boundaries, books, research reports and scanned archives. The open question is how consistently that advantage survives outside Baidu's benchmarks, especially on documents whose page count, typography or language pushes the 32,000-token window to its actual limit.