On June 22, 2026, Baidu quietly open-sourced a model that solves one of OCR's most stubborn problems: reading long documents. Called Unlimited-OCR, it can parse a 40-page contract, a scanned textbook, or a dense financial report in a single forward pass — and it does so while keeping memory dead flat. The GitHub repo crossed 10,000 stars within five days. Here's why it matters, in plain terms.
The problem: OCR forgets how to breathe on long documents
Modern OCR is done by vision-language models that "read" a page image and emit text. The catch is the KV cache — the running memory a transformer keeps of everything it has seen so far. On a one-page receipt that's trivial. On a 40-page document, that cache balloons: memory climbs, per-page latency creeps up, and eventually the model runs out of room or slows to a crawl. In practice, most OCR systems quietly punt by slicing a document into pages and stitching the results back together — which loses cross-page context (think a table that spans three pages, or a footnote referenced ten pages later).
Unlimited-OCR's whole pitch is that it doesn't slice. It reads the whole thing at once, and its memory footprint stops growing.
How they pulled it off
Two ideas do the heavy lifting. The first is the DeepEncoder, inherited from the DeepSeek-OCR lineage Unlimited-OCR is built on. It compresses a page hard — a 1024×1024 image becomes just 256 visual tokens, a roughly 16× squeeze. Fewer tokens per page means more pages fit inside the model's 32K-token context window.
The second, and the real innovation, is Reference Sliding Window Attention (R-SWA). Instead of letting the decoder attend to (and cache) every token it has ever produced, R-SWA bounds the cache to a fixed size — roughly the current page's tokens plus a small window of recent output (128 tokens by default). The result: as the document gets longer, memory stays flat and per-step latency stays flat. That's the green line in the chart above — and it's the difference between "reads 2 pages" and "reads 40+."
Under the hood it's a Mixture-of-Experts (MoE) model: 3 billion parameters total, but only about 500 million active per token. You get the capacity of a bigger model at the cost of a much smaller one — which is exactly what you want for something meant to grind through long documents cheaply.
Does it actually work?
The numbers say yes. On OmniDocBench, the standard end-to-end document-parsing benchmark, Unlimited-OCR posts a comprehensive 93.23 on v1.5 — beating DeepSeek-OCR by 6.22 points — and 93.92 on v1.6, a new state-of-the-art in the paper. It's also faster: about 5,580 tokens/second versus DeepSeek-OCR's 4,951, a 12.7% bump. And on 40-plus-page documents, its edit distance stays below 0.11 — meaning the transcription barely degrades as the page count climbs, which is precisely where older systems fall apart.
Two resolution modes cover the range: a Base mode (1024×1024) for dense single pages, and a dynamic Gundam mode for multi-page batches. It's multilingual, ships in the usual Transformers/Safetensors format, and — the part that will get it adopted — it's released under a permissive MIT license with open weights on GitHub and Hugging Face (baidu/Unlimited-OCR).
Why it's a big deal
OCR has been "solved" for short text for years; the frontier has moved to documents as documents — contracts, research papers, medical records, filings — where structure and cross-page context are the whole point. Feeding those into a RAG pipeline or an LLM has meant brittle page-splitting and a lot of glue code. A model that ingests the entire document in one shot, keeps the layout coherent, and runs on a modest activated-parameter budget removes a real bottleneck for anyone building document AI.
The honest caveat: benchmark leadership is a snapshot, not a moat — DeepSeek and others will answer, and OmniDocBench scores don't capture every messy real-world scan. But the architectural idea here — bounding the KV cache so cost stops scaling with length — is the kind of thing that outlives any single leaderboard. For a free, MIT-licensed model you can run today, "reads the whole book at once" is a genuinely new capability, not a press release.
If you work with long PDFs, it's worth a look: github.com/baidu/Unlimited-OCR.
Comments
Post a Comment