Hot AI News

Baidu’s Unlimited-OCR-2 reads whole books with a fixed memory budget

Baidu published Unlimited-OCR-2, an open 3B-parameter model that uses a fixed set of working references so memory and per-step latency stay nearly flat as documents grow.

Baidu’s Unlimited-OCR-2 reads whole books with a fixed memory budget
Image: Baidu (ERNIE)

Baidu has published Unlimited-OCR-2 on Hugging Face, a 3-billion-parameter, MIT-licensed model for parsing documents of any length. Its key idea, according to Baidu, is that memory and per-step decoding latency stay nearly constant as page counts grow.

A fixed set of references replaces ever-growing memory

The model card describes a mechanism called Sparse Reference Sliding Window Attention, or SR-SWA. It compresses the attention between text and visual tokens into a fixed-size set of working references, for example 512 tokens. Because that set does not grow, the cost of each decoding step should not depend on how long the document is, according to the page. The card gives no further architectural detail.

Leaderboard comparing Unlimited OCR 2 with other models on long-document benchmarks
Image: Baidu (ERNIE)

The release is tagged image-text-to-text and multilingual, though no specific languages are listed. The weights are in Safetensors format (BF16), and loading the model through Transformers requires trust_remote_code. Baidu frames the work as the “OCR-3.0 Era”, a move from long-horizon to unlimited-horizon parsing. Its release notes say the first Unlimited-OCR appeared on June 22, and that Unlimited OCR 2 with SR-SWA was added to the list under the date October 27. That entry sits out of order at the top of the list, so the date may be a typo.

Advertisements

Who can run it today, and on what

The weights are free to download under the MIT license. Baidu says it tested the Transformers path with Python 3.10, torch 2.13.0 and transformers 4.52.1 on a single NVIDIA A800-80GB. Single pages use dynamic tiling in a mode the card calls “gundam”, while a separate infer_multi call parses several pages in one request.

Demo animation of a full-length book parsed in one request
Image: Baidu (ERNIE)

For serving, Baidu recommends SGLang, but that needs a customized SGLang wheel; the card includes a launch configuration and an OpenAI-compatible client example. vLLM is supported according to the release notes, and the card also points to Docker Model Runner, ms-swift for training, and Baidu Cloud. A demo runs on Hugging Face Spaces, and the code is on GitHub.

The card lists practical limits. Output is capped per page by max_page_tokens, which defaults to 20000. Setting --mem-fraction-static to 0.7 was stable at 32 or more concurrent requests, while 0.75 left too little headroom. Smaller page windows lower peak memory but weaken merging across pages. No Inference Provider currently hosts the model on the Hub, so anyone using it must run it themselves or go through Baidu Cloud.

Baidu's Unlimited-OCR-2 reads whole books with a fixed memory budget
Image: Baidu

What the benchmark claims do and do not show

Baidu says the model reaches state-of-the-art results on MPDocBench, which covers dozens of pages, and on MarathonDocBench, which covers hundred-page documents. The page prints no scores in text; they appear only in a leaderboard image, and the benchmarks are not independently verified. The paper, “Unlimited OCR Works”, is on arXiv (2606.23050).

One caution comes from an outside write-up of the first model. It noted that figures circulating online, such as 100 pages in one pass or 93% accuracy, do not appear in the model card, README or paper abstract, which speaks only of “dozens of pages” in a single forward pass. The same write-up said the only benchmark on the first model’s card was ParseBench, with a mean of 46.17. Readers should treat headline accuracy numbers for this family as unconfirmed until independent tests appear.

Advertisements

Built on DeepSeek-OCR’s vision stack, with a different decoder

The angle here is technical significance. vLLM’s documentation says the original Unlimited-OCR shares the exact DeepSeek-OCR vision stack, meaning a SAM-ViT-B and CLIP-L encoder with the same tiling. The main difference is the language backbone: a DeepSeek-V2 mixture-of-experts decoder with 64 routed and 2 shared experts and plain multi-head attention, instead of the dense MLA decoder DeepSeek-OCR uses. The same docs say the model supports up to 32 local crops, against 6 for DeepSeek-OCR, and describe a sliding window of 128 recent tokens for generated text in the first version.

Those figures are for the first model, since vLLM’s page covers it and not version 2. They still show what the approach targets. Standard decoders keep a cache that grows with every generated token, which is what makes book-length parsing expensive. Limiting what generated tokens can look at, while leaving the image and prompt globally visible, caps that cost. SR-SWA appears to extend the idea by compressing references to a fixed set, though Baidu has not published details beyond the card and paper.

The release notes say the project aims to push DeepSeek-OCR further, and the demo shows a full-length book parsed in one request. For developers who handle long contracts, reports or scanned books, the practical question is whether accuracy holds across hundreds of pages, and the source does not settle it.

Sign Up for the Daily AI Pulse

One email a day. All the stories that matter.

Alex CarterAI News & Big Tech Correspondent

Alex Carter writes for Aiholics, keeping readers updated on the fast-paced world of AI and Big Tech.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may also like