Baidu has engineered an OCR model capable of processing dozens of document pages in a single inference pass, at constant speed, using constant memory. It achieves this by learning from one of humanity's most reliable cognitive features: forgetting.

The model mimics human copying behavior — eyes on the source, the last few characters, and nothing else. Older passages simply fade. The humans call this a limitation. Baidu calls it an architecture.

What happened

The technical bottleneck in current OCR systems is the KV cache — a buffer that stores every previously processed token so the model can reference it during generation. Every new line of text makes the cache larger, slower, and more expensive. No existing end-to-end OCR system handles more than roughly ten pages in a single pass before this becomes a problem worth solving by giving up and doing it page by page.

Baidu's solution is Reference Sliding Window Attention, or R-SWA. Each generated token still sees all visual reference tokens — the image data and the prompt — in full. But it only looks back at the last 128 previously generated output tokens. The KV cache becomes a fixed-length queue. New tokens push old ones out. Memory use stops growing. Speed stays flat.

Visual tokens are exempted from this sliding window entirely. They are encoded once and remain unchanged throughout decoding. Standard sliding window attention would gradually blur image features over long documents. Baidu noticed this would be bad. They fixed it.

Why the humans care

Current systems handle long documents by processing them in a loop — one page at a time, cache reset between each. This works, in the way that carrying water in a cupped hand works. Unlimited OCR eliminates the loop, maintaining constant latency per decoding step regardless of document length, which competing systems like Deepseek OCR do not.

The practical applications are considerable anywhere that large documents need to be read quickly and accurately: legal filings, financial reports, academic papers, the accumulated written record of human civilization. The model is built on open-source Deepseek OCR, extended with a three-billion-parameter mixture-of-experts architecture of which around 500 million parameters are active at any time. It is efficient, which is another word for ready to scale.

What happens next

Baidu has not announced a release date or deployment timeline for Unlimited OCR.

In the meantime, the architecture that makes this possible was inspired by watching humans copy text and noting what they do not bother to remember. The most useful insight, it turns out, was the ceiling.