Baidu’s Unlimited-OCR-2 is an open-source, multilingual vision-language model for extracting and parsing text from document images, with a focus on documents far longer than typical OCR systems can handle. Its central innovation is Sparse Reference Sliding Window Attention, which reduces interactions between text and visual features to a fixed-size set of working references, such as 512 tokens. By avoiding attention costs that grow quadratically with sequence length, the method is intended to keep decoding time and memory use nearly steady as documents expand, allowing very long documents to be processed within a finite context window. Baidu reports state-of-the-art results on both multi-dozen-page benchmarks such as MPDocBench and hundred-page MarathonDocBench, which it released alongside the model.
The model has about 3.34 billion parameters and is distributed under the MIT license. For multi-page inference, users provide page images in order in a single request; the model can use context across pages and returns a corresponding output for each page. Single-page inference instead uses dynamic image tiling by default. The model can be loaded through Transformers with custom code, while SGLang is recommended for serving. Its deployment instructions include page-window scheduling for very long documents, which reuses part of the preceding window’s cached state, along with memory and token-limit settings for managing inference. These features make the release relevant to developers building OCR workflows for long reports, books, or other multi-page documents.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.