Baidu has released Unlimited OCR 2, an open-source OCR model built for very long documents. The 3B model parses books, filings and reports of hundreds of pages in one request. Its core change is SR-SWA, a sparse attention scheme that keeps per-step decoding cost nearly flat. Weights ship under the MIT license, with code on GitHub.
TL;DR
- Size: 3.34B parameters. Active parameters not disclosed. Max position length 131,072 tokens.
- Runs on: 1 CUDA GPU in BF16. Baidu tested on an NVIDIA A800-80GB. BF16 weights total about 6.7 GB.
- Performance: first place on both multi-page benchmarks Baidu tested, against 9 other models (self-reported).
- Best: 77.1 overall on MarathonDocBench (hundreds of pages). The next model, Kimi-K3, scores 33.7.
- Worst: 48.2 on heading hierarchy (TEDS) on MarathonDocBench, its lowest sub-score.
What is Unlimited OCR 2?
Unlimited OCR 2 is a 3B vision-language model from Baidu that turns ordered page images into structured text. Output covers text, tables, formulas, figures, headings and reading order. It succeeds Unlimited-OCR, released in June 2026 to push DeepSeek-OCR further.
The config keeps a DeepSeek-OCR style layout. A SAM ViT-B plus CLIP-L encoder feeds a 12-layer mixture-of-experts decoder. Each token routes to 6 of 64 experts, plus 2 shared experts. The DeepSeek-OCR paper describes this decoder as DeepSeek3B-MoE-A570M. Baidu does not state an active count for version 2. In multi-page mode, each page costs 273 image tokens.
How does SR-SWA work?
Full attention cost grows quadratically with sequence length. During decoding, each new token scans a longer KV cache. At 273 image tokens per page, 100 pages add 27,300 input tokens before any output.
SR-SWA stands for Sparse Reference Sliding Window Attention. It compresses text-visual attention into a fixed set of working references. Baidu’s model card gives 512 tokens as the example size. The config pairs a 128-token local window with top-16 selection over 32-token blocks. That is 16 blocks of 32 tokens, matching the 512-token budget.
This keeps per-step latency and memory nearly constant as documents grow. It calls the result ‘unlimited-horizon’ parsing within a finite context window. Image encoding and total runtime still rise with page count.
‘+r[0]+’‘+r[ix].toFixed(1)+’
‘}).join(”);
requestAnimationFrame(function(){requestAnimationFrame(function(){bars.querySelectorAll(‘i’).forEach(function(i){i.style.width=i.dataset.w+’%’})})});
root.querySelectorAll(‘[data-b]’).forEach(function(b){b.className=”btn”+(b.dataset.b===k?”:’ g’)});
setTimeout(post,60);
}
root.querySelectorAll(‘[data-b]’).forEach(function(b){b.addEventListener(‘click’,function(){drawBars(b.dataset.b)})});
/* Tab 4 */
var S=[[“Text (1-Edit)”,94.8,89.6],[“Formula (CDM)”,89.4,87.9],[“Reading order (1-Edit)”,92.3,85.3],[“Table (TEDS)”,87.8,74.8],[“Figure (F1)”,72.9,71.8],[“Heading (TEDS)”,60.1,48.2]];
function drawSub(){var tb=document.getElementById(‘sub’);
tb.innerHTML=S.map(function(r){return ‘
‘}).join(”);
requestAnimationFrame(function(){requestAnimationFrame(function(){tb.querySelectorAll(‘.minibar i’).forEach(function(i){i.style.width=i.dataset.w+’%’})})});
}
window.addEventListener(‘load’,post);window.addEventListener(‘resize’,post);setTimeout(post,300);post();
})();


