Skip to content
IFAI

AI models

Baidu's Unlimited OCR solves long-document parsing slowdowns

Published Reach 70

Baidu just introduced Unlimited OCR, a 3B MoE document parser that stops memory bloat across 40+ pages. By using an R-SWA mechanism to cap the text KV cache to the last 128 tokens, the model processes long documents at a completely constant speed.

Baidu's Unlimited OCR solves long-document parsing slowdowns
Image: arxiv.org

Most vision-language models hit a wall when parsing lengthy PDFs: as the generated text stretches on, memory balloons and processing crawls to a halt.

Baidu is tackling this head-on with Unlimited OCR, an end-to-end 3B MoE document parser with just 500M active parameters that can run locally.

Capping text memory like a human scribe

Fine-tuned on DeepSeek-OCR, the model's core innovation is an attention mechanism called R-SWA.

Standard autoregressive decoders expand their KV cache with every newly generated word, dragging down throughput. Unlimited OCR mimics a human copying text: it keeps full visual attention on the entire document image, but restricts its textual memory to just the last 128 generated tokens.

By turning the text KV cache into a fixed-capacity queue, per-token computation stops growing. Outputting 6,000 tokens runs about 35% faster than DeepSeek-OCR, and memory footprint stays completely flat whether generating 10,000 or 100,000 tokens.

It compresses each 1024×1024 page into 256 tokens, parsing 40+ pages in a single 32K context pass at constant speed while outputting structured Markdown or JSON with tables and formulas intact.

Why it matters

For anyone building local RAG pipelines or enterprise knowledge bases, chewing through dense technical papers and annual reports has long been an expensive bottleneck. Unlimited OCR offers a lightweight fix that fits comfortably on modest consumer hardware.

Beyond OCR, capping past token memory while preserving full input context is a clever engineering blueprint. We expect this exact trade-off to spill over into other long-generation domains like ASR and machine translation.

Sources (3)

  1. [1]
  2. [2]
  3. [3]

Similar events

Past happenings like this one, for context.

Best of AI, daily