Baidu's open OCR model for very long documents passes 390,000 downloads
Unicorn News Desk ·
Key facts
- Maker
- Baidu
- Downloads on Hugging Face
- 390,927 (page snapshot)
- Licence
- MIT
- Size
- About 3.34 billion parameters, BF16
- Released
- 27 October 2026 (per Baidu's release log)
Baidu’s open-weight document reader Unlimited-OCR-2 shows 390,927 downloads on its Hugging Face page, which is about two weeks after the page was created on 26 October 2026. The model is released under the MIT licence. Its main claim is that it can parse documents of essentially any length while keeping speed and memory use nearly flat.
OCR (optical character recognition) means turning images of text, such as scans, photos and PDF pages, into machine-readable text. Unlimited-OCR-2 is listed on Hugging Face as an image-text-to-text model. It also has 650 likes, and its download count matches its all-time figure.
What Baidu released, and when
According to the release log on the model page, Baidu released Unlimited OCR 2 on 27 October 2026. The log describes the release as “achieving unlimited-horizon parsing with SR-SWA”. On the same day, Baidu released MarathonDocBench, a new benchmark for ultra-long document parsing. It also announced that the model is available on ModelScope and Baidu Cloud, and that a public demo is available. The paper, titled “Unlimited OCR Works 2”, went up on arXiv on 2 November.
The new model follows the original Unlimited-OCR. Baidu presented that model on 22 June 2026 and described it as “aiming to push Deepseek-OCR one step further”. The first model is much more widely downloaded. Its Hugging Face page shows 5,226,244 recent downloads and 13,945,889 all-time downloads, plus 4,961 likes. Both models live in the same GitHub repository, which now includes a PDF of the Unlimited-OCR-2 paper.
What Unlimited-OCR-2 adds over the first Unlimited-OCR
The main change is an attention method Baidu calls Sparse Reference Sliding Window Attention (SR-SWA). Attention is the part of a model that decides which earlier content to look at when producing the next piece of output. Normally, the cost of attention grows quickly as input gets longer.
Baidu says SR-SWA compresses the interactions between text and visual content in very long sequences down to “a fixed-size set of working references (e.g., 512 tokens).” According to Baidu, this keeps “per-step decoding latency and memory footprint nearly constant regardless of document length”. Baidu says the result is “true, unbounded document parsing within a finite context window.” It also says the method effectively removes quadratic attention scaling and memory bottlenecks as documents grow. Quadratic scaling means the cost roughly quadruples each time the input doubles.
MindStudio’s write-up describes the idea in plainer terms. Instead of re-reading every prior page when processing a new one, the model keeps a small fixed set of reference points from earlier pages and largely ignores the rest.

Baidu’s code also supports multi-page parsing in a single call. With the infer_multi function, all pages of a document are parsed in one request, “so the model can use cross-page context.” The output contains one page marker per input page, in the same order as the inputs. A single page is encoded by default with dynamic tiling, which the code calls “gundam mode”.
| Spec | Unlimited-OCR-2 |
|---|---|
| Maker | Baidu |
| Task | Image-text-to-text (OCR, document parsing) |
| Parameters | 3,343,978,497, stored mainly in BF16 |
| Weight files | About 6.69 GB total, sharded safetensors |
| Licence | MIT, not gated |
| Inference | Transformers (quick tests), SGLang (recommended for serving) |
| Fixed reference set (example) | 512 tokens |
How it performs: Baidu’s claims and outside testing
Baidu’s own evaluation
Baidu claims “state-of-the-art performance” on two kinds of benchmark. The first covers documents of dozens of pages, such as MPDocBench. The second covers extreme hundred-page documents, such as MarathonDocBench, which Baidu itself released alongside the model. The model page does not list scores, so Baidu’s comparison has to be read through its paper or third-party summaries.
MindStudio’s summary of those benchmarks puts numbers on the claim. It reports that Unlimited OCR 2 holds around 77 out of 100 on the 100-page Marathon-DocBench test. According to the same summary, most competing models, including Qwen and Gemini variants, drop below 30 at that length. The original Unlimited OCR “reportedly scored zero” on the same 100-page benchmark. On the shorter MP-DocBench, the write-up says the model leads rivals by only a few points.
Builders should keep two points in mind. First, these results come from Baidu’s evaluation, as MindStudio notes. Second, the long-document benchmark where the gap is widest was created by Baidu. No independent leaderboard result for Unlimited-OCR-2 appears in the sources.
For the earlier model, the Hugging Face page does carry results on the third-party ParseBench benchmark, marked as not verified. Those results show a mean score of 46.17 and a text-content score of 86.81. They also show very low scores on charts (1.34) and text formatting (0.97). The sources show no comparable ParseBench entry for version 2.
Hands-on results
MindStudio’s write-up also reports real-world tests. Clean printed English pages came through with no dropped text, including documents of 50-plus pages. The model returned a printed math problem in about two seconds. Local testing showed roughly 8.3 GB of VRAM needed to run the model in full precision on a GPU.
The same tests found three clear failure modes:
- Mixed scripts. On an image with English, Urdu and Indonesian text, the model read the English correctly. It then got stuck in a repetitive loop on the Urdu sentence.
- Old and ornate print. An 1883 newspaper page with decorative fonts and small print produced several errors, including a wrong year and a wrong price.
- Handwriting and unusual typography. The write-up concludes that the model is strongest on straightforward typeset material, not handwriting or ornate fonts.
MindStudio links some of these misses to the SR-SWA trade-off. Because the model does not attend to everything at every step, details outside its chosen reference points can be missed, “even on a single page”. Based on the Urdu result, the write-up infers that the model was trained mainly on English and Chinese. That is MindStudio’s reading, not a statement from Baidu. The Hugging Face page tags the model as multilingual.

Licence, size and where to get it
The weights are published on Hugging Face under the MIT licence, a permissive licence. The repository is not gated, so no access request is needed. Beyond Hugging Face, Baidu says the model is available on ModelScope and Baidu Cloud, and points to a public demo. The Hugging Face page lists no hosted inference providers, and it notes that quantized versions exist. Quantized versions use lower numeric precision to save memory.
The model is tagged “custom_code”. Baidu’s loading example passes trust_remote_code=True to the Transformers library. In practice, loading it runs Python code from Baidu’s repository. Teams with strict supply-chain rules will want to review that code first.
Baidu says its Transformers setup was tested with Python 3.10, torch 2.13.0 and transformers 4.52.1 on an NVIDIA A800-80GB. For serving, the repository ships a customized SGLang build and uses PyMuPDF to convert PDFs to images. Support for fine-tuning version 2 with the ms-swift framework was added on 28 October.
What it means for document pipelines
The pitch is aimed at a specific pain point. MindStudio describes the problem this way: most OCR and vision-language models get slower and less accurate as documents get longer, because they hold the whole page history in memory. If SR-SWA performs as Baidu describes, a single model call could cover long contracts, reports or manuals without splitting them into chunks and stitching the results back together.
Baidu’s serving setup shows how this works in practice. The SGLang configuration includes “page-window scheduling for very long documents”, with 10 pages per window by default. Part of the attention cache from the previous window is reused. Each page’s output is capped at 20,000 tokens by default. The repository also warns that one built-in default “allows a single ~462 MiB allocation and can OOM,” meaning it can run out of memory. It recommends a lower setting that it describes as equivalent. That warning suggests memory tuning still matters in production, even if per-step memory stays flat.
The hands-on findings narrow the best fit. The model looks strongest on long runs of clean, printed English text. Archives of historical print, multilingual paperwork and handwritten forms are the cases where testers saw errors. In one test, those errors included wrong numbers, which is a serious risk for invoices or records. A repetitive output loop is also a failure that pipelines should detect and cut off.
Open questions
- Independent benchmarks. The headline long-document gap rests on Baidu’s evaluation and a benchmark Baidu created. Third-party leaderboard results for version 2 would show how well it generalizes.
- Language coverage. The “multilingual” tag does not fit well with the Urdu failure in outside testing. The sources do not include a list of supported languages.
- Charts and formatting. The first model scored very low on chart and formatting tasks in unverified ParseBench results. It is not yet shown whether version 2 changes that.
What to watch next
The arXiv paper, posted on 2 November, is the place to check Baidu’s full comparisons and test conditions. Download counts are worth tracking too. Version 2 has a long way to go to match the first model’s total of nearly 14 million. Finally, look for wider support beyond Baidu’s customized SGLang build, plus independent results on mixed-language and historical documents. Those are the areas where the first outside tests found problems.
Frequently asked questions
Is Baidu Unlimited-OCR-2 open source?
The weights are published on Hugging Face under the MIT licence, with no access gate. The model page lists it as using custom code, so loading it requires trusting Baidu's remote code.
What does Unlimited-OCR-2 do?
It is an image-text-to-text model that turns page images, such as scans and photos of documents, into text. Baidu designed it to parse very long multi-page documents in one request.
How does Unlimited-OCR-2 compare with the first Unlimited-OCR?
Baidu's main addition is SR-SWA, an attention method that keeps memory and per-step speed nearly constant as documents grow. A MindStudio write-up says the original model reportedly scored zero on a 100-page benchmark, where version 2 scores around 77.
What hardware does Unlimited-OCR-2 need?
Baidu tested it on an NVIDIA A800-80GB. MindStudio's local testing reported roughly 8.3 GB of VRAM to run it in full precision.
Does Unlimited-OCR-2 handle all languages well?
The model page tags it as multilingual. In MindStudio's testing, it got stuck in a repetitive loop on Urdu text mixed into an English document.