Baidu releases Unlimited-OCR 2: OCR up to 7x faster on 100-page documents
Baidu has released Unlimited-OCR 2, a model with roughly 3 billion parameters that recognizes documents of virtually any length. It extracts text from scans and PDFs and handles tables, formulas, and multipage materials. The code and weights are published under the MIT license. The main novelty is a mechanism called Sparse Reference Sliding Window Attention (SR-SWA). The model looks at the current page and keeps a small working memory, for example 512 reference tokens, so the cost of each step barely grows with document length. On 100 pages, Baidu claims decoding is up to 7x faster than with full attention. • Up to 5.6x faster than the mechanism in the first Unlimited-OCR • Pages are processed in overlapping blocks, and memory is freed as the model works • The MIT license permits commercial use
AI-processed from TG: @cgevent (Метаверсище и ИИще); edited by Hamidun News
Baidu has published Unlimited-OCR 2, a document recognition model with roughly 3 billion parameters that is meant to handle texts of virtually any length. By the company's own measurements, on documents of about 100 pages the new attention mechanism speeds up individual decoding steps by up to 7x compared with full attention and by up to 5.6x compared with the first version's mechanism. The code and weights are released under the MIT license, including for commercial use.
The model extracts text from scans and PDFs and processes tables, formulas, and multipage materials. But recognition quality is not the main story here. The authors set out to solve a different problem: what happens to LLM-based OCR when a document grows to hundreds of pages.
Why long documents break LLM-based OCR
Language-model-based OCR systems have an unpleasant property. The more pages they have read and the longer the generated text becomes, the more compute and memory the next step requires. The model has to keep attending to a growing volume of earlier context, so the cost of each new token creeps upward.
The first Unlimited-OCR already closed part of this gap by limiting how much generation history it kept. A second source of growth remained. Visual data from all pages kept accumulating and putting increasing load on the system, so on very long files the gains hit a ceiling.
How SR-SWA keeps per-step cost nearly constant
In Unlimited-OCR 2, Baidu introduces a mechanism called Sparse Reference Sliding Window Attention, or SR-SWA. The idea is simple. When recognizing the next fragment, the model focuses on the current page and consults only a small set of the most useful fragments from the rest of the document. Instead of endlessly scanning accumulated information, it works with a limited working memory, for example 512 reference tokens.
As a result, the compute cost of each next step stays roughly constant, even when the document grows many times over. Anyone who has ever copied out a long book will recognize the analogy: you look mainly at the current page rather than rereading all the previous ones after every sentence.
The model also processes pages in overlapping blocks. Once a section of the document is finished, the memory it occupied can be freed. This is a second lever for saving resources, and it works together with sparse attention.
Key release details
- Developer: Baidu.
- Model size: about 3 billion parameters.
- Tasks: text from scans and PDFs, tables, formulas, multipage documents.
- New mechanism: Sparse Reference Sliding Window Attention (SR-SWA).
- Working memory: a limited set of reference tokens, for example 512.
- Speedup on documents of about 100 pages: up to 7x relative to full attention.
- Speedup relative to the previous mechanism: up to 5.6x.
- Page processing: overlapping blocks with memory release.
- License: MIT, commercial use allowed.
- Materials: repository github.com/baidu/Unlimited-OCR, baidu/Unlimited-OCR-2 weights on Hugging Face, paper on the first version on arXiv (2606.23050).
One caveat: the speedup figures apply to individual decoding steps and come from Baidu itself. There are no independent comparisons yet, and only real-world use will show the true picture on actual document corpora.
Who can use it right now
A 3-billion-parameter model under the MIT license can be run in-house and built into a product without legal headaches. It is a good candidate for digitizing archives, contracts, scientific collections, financial reports, and technical manuals, that is, wherever files running to hundreds of pages are routine and tables and formulas cannot be lost.
Teams building RAG pipelines and agents on top of corporate documents care about predictable costs. If the cost of a step does not grow with file length, it is easier to plan hardware and batch-processing timelines. A sensible plan is to take the weights from Hugging Face, run them on your heaviest documents, and compare speed and accuracy with your current OCR stack, especially on tables and formulas.
- Oct 29, 2026Black Forest Labs releases FLUX.3 Klein: 1024×1024 in 2 seconds on an H100
- Oct 28, 2026Liquid AI releases LFM2.5-24B-A2B: an agent model with 2B active parameters
- Oct 28, 2026PyTorch 2.15 speeds up MoE models on Mac by 5–6.5x and adds FP8
- Oct 28, 2026NVIDIA Kumo Relational Beats Supervised ML on 41 Tasks Without Any Training
Key Questions Answered
Why long documents break LLM-based OCR?
Language-model-based OCR systems have an unpleasant property. The more pages they have read and the longer the generated text becomes, the more compute and memory the next step requires. The model has to keep attending to a growing volume of earlier context, so the cost of each new token creeps upward. The first Unlimited-OCR already closed part of this gap by limiting how much generation history it kept. A second source of growth remained. Visual data from all pages kept accumulating and putting increasing load on the system, so on very long files the gains hit a ceiling.
How SR-SWA keeps per-step cost nearly constant?
In Unlimited-OCR 2, Baidu introduces a mechanism called Sparse Reference Sliding Window Attention, or SR-SWA. The idea is simple. When recognizing the next fragment, the model focuses on the current page and consults only a small set of the most useful fragments from the rest of the document. Instead of endlessly scanning accumulated information, it works with a limited working memory, for example 512 reference tokens. As a result, the compute cost of each next step stays roughly constant, even when the document grows many times over. Anyone who has ever copied out a long b
What are the key details on Key release details?
Developer: Baidu. Model size: about 3 billion parameters. Tasks: text from scans and PDFs, tables, formulas, multipage documents. New mechanism: Sparse Reference Sliding Window Attention (SR-SWA). Working memory: a limited set of reference tokens, for example 512. Speedup on documents of about 100 pages: up to 7x relative to full attention. Speedup relative to the previous mechanism: up to 5.6x. Page processing: overlapping blocks with memory release. License: MIT, commercial use allowed. Materials: repository github.com/baidu/Unlimited-OCR, baidu/Unlimited-OCR-2 weights on
Build & Ship Production AI Agents Without Boilerplate Code
Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.