XNews

Baidu Wenxin Releases Unlimited OCR 2 with SR-SWA for Arbitrary-Page Parsing

Baidu Wenxin Releases Unlimited OCR 2 with SR-SWA for Arbitrary-Page Parsing

Baidu Wenxin released Unlimited OCR 2, an OCR model that parses documents of arbitrary page count using a Sparse Reference Sliding Window Attention mechanism called SR-SWA. The method combines Page Gate, which narrows decoding references to relevant pages, and Token Sieve, which scores and selects the most relevant remote token buckets, keeping per-step decoding cost from growing with document length. The first-generation Unlimited OCR, released on June 22, topped GitHub Daily Trending the next day, passed 10,000 GitHub stars in five days and exceeded 10 million Hugging Face downloads.

Event version 1.

Key insights

Arbitrary-page parsing

Unlimited OCR 2 parses documents of any page count, extending beyond the previous generation's continuous parsing of dozens of pages and traditional one-page-at-a-time OCR with stitching.

SR-SWA mechanism

The model uses Sparse Reference Sliding Window Attention (SR-SWA), inspired by how humans copy thick books by focusing on the current page and only looking back for cross-page references.

Page Gate and Token Sieve

Page Gate narrows the visual information referenced at each decoding step from the whole document to relevant pages and uses page position encoding to distinguish page positions. Token Sieve divides candidate visual information into fixed-size token buckets, scores them by relevance and selects only the top-k remote buckets.

Bounded decoding cost

The design keeps per-step decoding computation from increasing as documents grow longer, avoiding the memory bottleneck of standard global dense attention.

First-generation traction

The first Unlimited OCR, released on June 22, topped GitHub Daily Trending the next day, reached 10,000 GitHub stars in five days and surpassed 10 million cumulative Hugging Face downloads.

Source posts