ChengRang

Wenxin Unlimited OCR 2

AI Productivity Open Source

Baidu's open-source long-document parser released 2026/10/27, whose SR-SWA sparse reference attention compresses cross-page visual links into a fixed reference set and drops peak single-sequence KV memory from 47GB to 1.77GB, parsing an arbitrary number of pages in one pass

BaiduWenxinlong documentsOCRopen source
Visit Wenxin Unlimited OCR 2

Disclaimer: Review content represents our editorial team's views and experience, not commercial recommendation or investment advice. Product info and pricing may change; refer to official sources.

Overview

Baidu open-sourced Wenxin Unlimited OCR 2 on October 27, 2026, publishing code and weights on GitHub and Hugging Face alongside listings on Baidu Cloud and the Baidu AI Open Platform. The target is page count: the first generation used reference sliding-window attention to reach dozens of pages, and this one parses an arbitrary number of pages inside a fixed context window.

The mechanism is SR-SWA, sparse reference sliding-window attention. It exploits the fact that information inside a page is dense while visual links across pages are extremely sparse. A page gate narrows thousands of pages down to a few candidates, then a token sieve scores visual blocks within those pages and passes only the most relevant ones into attention. Everything compresses into a fixed set of reference representations, 512 tokens for example, so per-step decoding latency and memory stay flat as a document grows.

Unlimited-horizon decoding handles memory. Pages are processed in sliding windows, adjacent windows share a single boundary page and reuse its KV cache, so sentences and tables continue across the break; once a window finishes, its KV cache is released. Baidu reports peak single-sequence KV memory falling 96.2 percent, from 47.00GB to 1.77GB, which puts inference on a single consumer GPU.

Key Features

Use Cases

Pros

Pricing

Code and weights are open, downloadable from GitHub and Hugging Face, so self-hosting carries only hardware cost. Baidu's test environment is a single A800-80GB, and SGLang deployments can trade page-window size against memory to control cost. The same release is also live on Baidu Cloud and the Baidu AI Open Platform, where OCR document parsing bills under those platforms' own pricing, with a public beta open for applications.

Summary

Long-document parsing has never been limited by recognition accuracy so much as by attention scaling quadratically with pages. Unlimited OCR 2 caps cross-page attention with sparse references and releases memory through sliding windows, and only together do those support the arbitrary-length claim. For teams that need a whole case file parsed in one pass, that removes a great deal of splitting and stitching work. The first generation was already a popular open-source project, so this one starts from a larger base.

Version History

Category
AI Productivity
Pricing
Open Source
Tags
Baidu · Wenxin · long documents
Website

Related Tools