LLMs and models

Unlimited OCR 2

Quick explainer2 min readIntermediate

Unlimited OCR 2 is Baidu's model for parsing very long documents, reading every page in a single request so it can use context from across pages.

In plain words

Its new piece is SR-SWA, a kind of attention (the part of a model that decides what to look at) that shrinks the links between page and text down to a small, fixed set of reference points. As a result, the time and memory for each step stay nearly flat however long the document is. Baidu says it scores best on tests of dozens of pages and of a hundred pages or more, including MarathonDocBench, a new test it built for very long documents.

A quick example

Imagine a 300-page contract. Rather than reading it in short pieces that forget earlier pages, the model takes in the whole thing at once and can link a clause near the start to a table near the end.

Where you'll meet it

  • Turning long reports, books and contracts into text.
  • Serving document parsing with SGLang, or quick tests with Transformers.

Related

Sources

  1. Docsbaidu/Unlimited-OCR-2, Baidu (Hugging Face) · read 27 Oct 2026
  2. Docsbaidu/Unlimited-OCR, Baidu (GitHub) · read 27 Oct 2026

Checked by WhatIsAI against the sources above · 27 Oct 2026. Spotted an error? Report it.