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.
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.
- Dec 2, 2026Qwen3.8-27B at 4-Bit Quantization Weighs 16.6 GB Instead of 55 GB: How to Read the Filename
- Dec 2, 2026T-Decision-1 9B scores 71.6 points and beats a model six times its size
- Dec 2, 2026T-Decision-1 with 9B Parameters Beats Copernicus-57B on Russian: 71.6 vs. 71.2 Points
- Dec 2, 2026DeepMind Releases CellGemma: A Cell Model 6x Smaller Than Its Predecessor That Runs on a Single GPU
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.
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.
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.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
