Is Baidu's Unlimited OCR Really That Good? It Reads a 40-Page Contract in One Pass — but the World Isn't Short of OCR
Baidu's Unlimited-OCR, open-sourced in June under an MIT license, is going viral: a ~3-billion-parameter model that reads a 40-page contract in one pass, preserving layout, tables and cross-page order, free for commercial use. After checking, the core capability is real — it fixes traditional OCR's old flaw: reading page by page and breaking across pages. But 'perfectly preserved' is an overstatement: 40 pages is the version 1.0 ceiling, it needs an Nvidia GPU, and there is no ready-made app. The world is not short of OCR; it is short of long-document parsing that reads a whole document at once and is open source and free.
Baidu's Unlimited-OCR, open-sourced in June, is going viral: a ~3-billion-parameter vision-language model that reads a 40-page contract in one pass, preserving tables, formulas, layout and cross-page order, under an MIT license — open source and free, including for commercial use. Five months after release it has collected more than 27,800 stars on GitHub. It works differently from traditional OCR: the old tools read one page at a time and stitch the result back together; Unlimited-OCR feeds the whole document to the model at once and produces the result in a single forward pass, with a 32,768-token context as its working memory. Tables come out as HTML, formulas as LaTeX, layout with coordinates, and a paragraph that runs onto the next page is tagged as a continuation, not split in two.
On October 27, Baidu released version 2.0: with Sparse Reference Sliding Window Attention (SR-SWA), the page cap is gone — 300 pages in a single forward pass — and Unlimited-Horizon Decoding cuts peak memory from 47GB to 1.77GB while lifting throughput 3.6 times. The technology builds on the DeepSeek-OCR line: vision tokens are compressed first — one 1024-pixel page takes just 273 tokens — then sliding-window attention keeps memory fixed, so longer documents do not blow up memory. But three caveats matter: first, it needs an Nvidia GPU, at least 8GB of VRAM (a consumer card like the RTX 3070 is enough), and it does not run fast on CPU; second, there is no ready-made app or interface — you write the script that feeds it pages; third, loading it runs Baidu's own model code, and the hosted version sends your files to Baidu.
OCR has reached its third generation. Version 1.0 was a pipeline: a layout model cut the page into blocks, separate models handled text, tables and formulas, and a set of rules stitched it into Markdown — many modules, a long serial chain, and an error early on poisoned everything after it. Version 2.0 was end-to-end: one vision-language model took in a whole page image and output Markdown directly, a big jump in single-page accuracy — but its memory was one page. Multi-page documents had to be wrapped in a for loop: turn a page, clear, repeat. Page 1 and page 300 never met, so cross-page structure always broke. Unlimited-OCR attacks exactly that break: cross-references in contracts, tables that span pages in financial reports, paragraphs cut by a page turn in research papers. Baidu even built a new benchmark for it, MarathonDocBench: 100 documents, 103 to 300 pages each, with an average of 36.3 places where text is cut by a page turn and 13.2 tables spanning two pages per document; 82 percent of documents contain cross-page tables — the old benchmark's figure was 11 percent.
The core is a technique called Reference Sliding Window Attention (R-SWA)
The core is a technique called Reference Sliding Window Attention (R-SWA). Standard attention grows memory with document length, which is why traditional tools must cut page by page; R-SWA compresses text memory into a fixed 128-token sliding window — writing the 100,000th word, it only looks back at the most recent 128 — while compressed vision tokens control the visual side, so a 32K context can hold a whole document. Version 2.0's SR-SWA goes further: it cuts the whole book's vision tokens into blocks of 32 tokens, and when generating text it only looks at blocks that intersect the current page, picking 16 of them — so each step actually sees a fixed 640 tokens, whether the document is 10 pages or 300. Add Unlimited-Horizon Decoding: the document is cut into 10-page segments, neighboring segments share a boundary page, and after each segment the memory is freed except that boundary page's cache, so memory use is decoupled from total document length. There is a cost: the smaller the segment, the less memory — but the worse cross-page merging gets. Baidu's own paper admits the tradeoff.
First, the document AI and RAG (retrieval-augmented generation) workflow changes. The old way was OCR first, then chunking — and cross-page tables and references often died at the chunking step, leaving retrieval with fragments; now the whole document is read at once with structure intact, so downstream chunking and retrieval are far cleaner, with legal, financial and research documents benefiting first. Second, open source and free carries weight by itself: MIT license, free for commercial use, weights and code fully public, and 27,800-plus stars show developers have already voted with their feet — what used to require Google Document AI, AWS Textract or Azure, billed per page with files uploaded to someone else's cloud, now runs locally on a consumer GPU, with files never leaving the machine. Third, for China this is a rare case of a Chinese model leading in a niche: Baidu open-sourced a 3-billion-parameter specialist and won not by stacking parameters but by a clever attention mechanism — for Chinese AI, that is more convincing than yet another hundred-billion-parameter model. The biggest hidden losers are the cloud OCR vendors who charge per page: a business that billed by the page can now be done by one GPU at home; but Baidu Cloud itself hosts this model too, with a free tier of just 200 pages for individuals and 1,000 for companies, plus real-name verification — the free lunch only lasts two bites.
iHolyshit review From a Chinese perspective, let me answer the question first: the world is not short of OCR — it is short of OCR that reads a whole document at once and is open source and free. Google, Amazon and Microsoft have had OCR for years, Tesseract has been free for decades; what has been missing is the kind that does not break across pages, does not scatter tables, and does not require uploading files to someone else's server — and that is exactly the gap Baidu filled. Credit where it is due: the model is open source, the license is MIT, weights and code are fully public, and even the version 2.0 tradeoff (smaller segments, worse cross-page merging) is written in the paper, nothing hidden. But do not let the word 'perfect' carry you away: 40 pages is the version 1.0 ceiling, 300 pages is the version 2.0 number, and a major upgrade sits between them; it needs a GPU, a script, and Baidu's own code — a long way from 'open and use.' The real test is accuracy on dirty real-world documents: skewed scans, handwritten notes, stamped contracts — those are OCR's touchstone, and no benchmark score replaces them. For anyone building an OCR app, the lesson is direct: models keep getting cheaper, and the value is in the layer that turns a model into a product — whoever first turns 'read the whole document in one pass' into an app you can just open takes the next wave of users.
November 23, 2026
Share this article
What do you think of this story?
Anonymous feedback, up to 5 reactions per article.
Reader comments
Comment without signing in, or sign in to display your member name.
Discuss the technology and the story. Hate, politics and war, threats, abuse, personal accusations, sexual content, ads, links and personal information are not allowed.
No comments yet. Be the first to share.