Unlimited OCR 2: what it is and how to run it
2026-10-27 · 4 min read
Unlimited OCR 2 is a free, open-source model from Baidu that reads scanned document pages and turns them into structured text, with headings, tables, formulas and reading order intact. It's a 3-billion-parameter vision-language model under the MIT license, and its selling point is length: Baidu built it to parse a document of dozens or hundreds of pages in a single request without slowing down as the page count climbs.
@Baidu_Inc announced it on October 27 with "Unlimited OCR 2 is here, and it's open source." Less than an hour later, @BaiduAI_News posted the numbers. On 100-page documents, they say, per-step decoding runs 7.0x faster than full attention and 5.6x faster than the R-SWA method, and parsing accuracy holds on documents up to 300 pages.
Why long documents are the hard part
Most OCR models handle a page or two well. Give them a 120-page loan file and every new page adds context the model has to keep paying attention to, so memory and latency grow until the job falls over or gets chopped into pieces that lose track of each other. A table that runs across a page break is the classic casualty.
Baidu's fix is something it calls Sparse Reference Sliding Window Attention, or SR-SWA. The model doesn't hold every earlier page in full. It compresses what came before into a fixed-size pool of "working references" (the release uses 512 tokens as its example), so each new step costs about the same whether it's on page 5 or page 250. A longer document still takes longer overall, but the cost per token stays flat.
The catch, which AlphaSignal's write-up spells out, is that the compressed pool is a lossy summary. Small details from far back in a document can drop out, which matters if page 3 defines a term that page 190 depends on.
What it can do
| Unlimited OCR 2 | |
|---|---|
| Size | 3B parameters, about 6 GB of weights in bfloat16 |
| License | MIT, free for commercial use |
| Input | Page images in order (PDFs get converted to images first) |
| Output | Text with headings, tables, formulas, figures and reading order |
| Benchmarks | Baidu claims top results on MPDocBench and MarathonDocBench |
| Cost | Free to download; you pay for your own GPU |
Treat the benchmark claims cautiously for now. The model card shows the leaderboard only as an image, and MarathonDocBench, the hundred-page test, is a benchmark Baidu released today alongside the model. I couldn't find an independent comparison yet.
How to try it
The fastest way is the free Hugging Face demo Space, which Baidu set up from a build by @_akhaliq. It runs in the browser, with nothing to install.
To run it yourself, you need an NVIDIA GPU. Baidu tested on an 80GB A800. The weights alone fit in about 6 GB, but long documents and parallel requests need room for images and caches on top of that. The steps, from the GitHub repo:
- Install the pinned packages from the model card (torch 2.13.0, transformers 4.52.1 and a few small helpers).
- Turn your PDF into page images. The examples use PyMuPDF at 300 DPI.
- Load
baidu/Unlimited-OCR-2with Transformers and callinfer_multion the pages, in order. - For real volume, use Baidu's customized SGLang build, which serves an OpenAI-compatible endpoint on port 10000.
The multi-page call looks like this:
pages = [f"your_doc/page_{i}.jpg" for i in range(1, 8)]
text, num_tokens = model.infer_multi(tokenizer, image_files=pages,
output_path="output/multi", save_results=True)
You get back one <PAGE> marker per input page, so you can map extracted text back to its source page.
A security note: loading the model needs trust_remote_code=True, which runs Python from the model's repository on your machine. Read that code and pin a specific revision before you point it at client files. That habit matters more after this week's Cohere findings on Qwen3.8-Flash-Next, even though an OCR model doesn't act on its own.
My read
This release matters more than its 3B size suggests. Small open models keep getting better at narrow jobs; Nanbeige4.3-33B did the same for coding a couple of days ago. A 3B model that reads a whole contract or patient intake packet in one pass, on hardware you control, is a big deal for anyone who can't send those documents to a cloud API. I'd still run it on your own messiest scans and compare against the originals before trusting a benchmark image.
What this means for a small business
A lot of office time still goes to retyping what's already on paper. Pulling line items out of vendor statements or moving scanned forms into a CRM is work a model like this can draft for a person to check, and it fits in front of something like an automated invoicing flow.
If you're not sure which of your paperwork is worth automating first, New Face Design's free process audit is a good place to start. We'll map where the hours go and tell you honestly whether a tool like this fits.