[Models](/models)/baidu/Unlimited-OCR-2

MIT

# Unlimited-OCR-2

by baidu

Baidu's 3.3B-parameter document parser that keeps attention cost bounded, so it can read documents hundreds of pages long, under the MIT licence

425likes

3.3Bparams

[HuggingFace](https://huggingface.co/baidu/Unlimited-OCR-2)[Run it on your own data, free](https://studio.mixpeek.com/namespaces/create?mode=managed&utm_source=homepage&utm_medium=model_page&utm_campaign=mvs_onramp)

Identifiers

Model ID

`baidu/Unlimited-OCR-2`

## Deploy Unlimited-OCR-2

Single-tenant

Mixpeek has no managed extractor for this model. On a single-tenant deployment you upload the weights and a custom plugin serves them next to the rest of your pipeline.

[Read the customer-hosted guide](https://mixpeek.com/docs/customer-hosted/overview) [Talk to us about single-tenant](/demo)

## Overview

Unlimited-OCR-2 is a document parsing model from Baidu, released on October 27, 2026. It has about 3.3B parameters and turns page images into text. Its Sparse Reference Sliding Window Attention (SR-SWA) keeps the attention between the text and the page images to a fixed-size set of working references, 512 tokens in the model card's example, so cost no longer grows with the square of the document's length and a document of hundreds of pages parses within a finite context. It is MIT licensed.

## Architecture

A vision-language document parser in the line of DeepSeek-OCR: Baidu describes the first Unlimited-OCR as an attempt to push DeepSeek-OCR one step further. Version 2 adds SR-SWA, which compresses text-visual attention over ultra-long sequences into a fixed set of working references, removing the quadratic growth of attention cost and memory with document length.

## Mixpeek SDK Integration

IngestRetrieve

\# Parse a multi-page document with Unlimited-OCR-2 (usage from the model card).
# pip install -U transformers torch
import torch
from transformers import AutoModel, AutoTokenizer

model\_name = "baidu/Unlimited-OCR-2"
tokenizer = AutoTokenizer.from\_pretrained(model\_name, trust\_remote\_code=True)
model = AutoModel.from\_pretrained(model\_name, trust\_remote\_code=True, use\_safetensors=True,
                                  torch\_dtype=torch.bfloat16).eval().cuda()

pages = \[f"your\_doc/page\_{i}.jpg" for i in range(1, 8)\]
text, num\_tokens = model.infer\_multi(tokenizer, image\_files=pages,
                                     output\_path="output/multi", save\_results=True)

## Capabilities

*   Page images to text for long, multi-page documents
*   Bounded attention cost through Sparse Reference Sliding Window Attention
*   Multilingual documents (per the model card)
*   Loads with Hugging Face Transformers (trust\_remote\_code)
*   Fine-tuning supported through ms-swift

## Use Cases on Mixpeek

Parsing contracts, filings and manuals that run to hundreds of pages in one pass

Turning scanned archives into text for search and RAG

Extracting text from long documents before chunking and embedding them

## Performance

Input SizePage images; documents of hundreds of pages per the model card

GPU LatencyInput dependent

GPU ThroughputBatch dependent

GPU MemoryModel dependent

We have not measured it. Baidu reports state-of-the-art results on MPDocBench and on MarathonDocBench, a benchmark for ultra-long document parsing that it released alongside the model; both are vendor-reported.

## Common Pipeline Companions

[

PaddlePaddle/PaddleOCR-VL-1.5

Baidu's PaddleOCR vision-language parser for page-level layout and text

](/model/PaddlePaddle/PaddleOCR-VL-1.5)[

allenai/olmOCR-2-7B-1025

An open document-to-text model from Ai2

](/model/allenai/olmOCR-2-7B-1025)[

vidore/colqwen2.5-v0.2

Search the page images directly, with no text extraction step

](/model/vidore/colqwen2.5-v0.2)

## Frequently Asked Questions

### What is Unlimited-OCR-2?

A 3.3B-parameter document parsing model from Baidu, released on October 27, 2026 under the MIT licence. It turns page images into text and is built to read very long documents: its Sparse Reference Sliding Window Attention keeps attention to a fixed set of working references, so a document of hundreds of pages parses within a finite context.

### How does Unlimited-OCR-2 handle very long documents?

Ordinary attention costs grow with the square of the sequence, so long documents run out of memory or context. SR-SWA compresses the attention between text and page images to a fixed-size set of working references (512 tokens in the model card's example), which bounds compute and memory however long the document is.

### Can I use Unlimited-OCR-2 commercially?

Yes. The weights are published under the MIT licence, which allows commercial use with the licence notice kept.

### How accurate is Unlimited-OCR-2?

Baidu reports state-of-the-art results on MPDocBench and on MarathonDocBench, a hundred-page benchmark it released with the model. Those are vendor-reported, and we have not measured it, so test it on a sample of your own documents before switching.

### How do I use it with Mixpeek?

Run the parser on your side and upsert the text it returns into a collection, where Mixpeek's text extractor embeds it for search, or index the page images directly with a visual document retriever. Either way the documents stay in your own bucket.

## Explore on Mixpeek

[

Browse all models

Search the full model catalog

](/models)[

Feature Extractors

See how Mixpeek runs models as extractors

](/extractors)[

Mixpeek Vector Store

Store & search embeddings at scale

](/mvs)[

Pricing

Usage-based pricing for pipelines

](/pricing)[

All Curated Lists

Compare models, APIs & infrastructure

](/curated-lists)

### Specification

Organizationbaidu

Retriever\-

Parameters3.3B

LicenseMIT

Downloads/moN/A

Likes425

[

### Research Paper

Model paper or technical report

arxiv.org](https://huggingface.co/baidu/Unlimited-OCR-2/blob/main/Unlimited-OCR-2.pdf)

### Build a pipeline with Unlimited-OCR-2

Add this model to a processing pipeline alongside other extractors. Combine with retrieval stages for end-to-end search.

[Run it on your own data, free](https://studio.mixpeek.com/namespaces/create?mode=managed&utm_source=homepage&utm_medium=model_page&utm_campaign=mvs_onramp)