Baidu has published Unlimited-OCR 2 on Hugging Face, an OCR model that tackles document length with a different move from the usual context window expansion. The mechanism is called Sparse Reference Sliding Window Attention, or SR-SWA: it reduces text-visual interactions to a fixed set of working references, for example 512 tokens. As a result, per-step decoding latency and memory footprint remain nearly constant, whether the document has ten or a hundred pages.

The difference from traditional approaches is substantial. In transformers, attention tends to grow quadratically with sequence length, turning very long documents into a VRAM and throughput problem. SR-SWA introduces a fixed computational budget: instead of multiplying the relationships to manage, it compresses visual and textual references into a fixed group. The result described by Baidu is effectively unbounded parsing within a finite context window, without memory bottlenecks that explode as pages grow.

For anyone looking at on-prem deployment, this is not a marginal technical note. OCR pipelines for long documents today often force a choice between splitting files, losing context, or sizing hardware for the worst case. If memory footprint and latency stay constant, provisioning no longer has to chase document length. The issue is not only the benchmarks Baidu cites, MPDocBench for dozens of pages and MarathonDocBench for extreme hundred-page cases: it is the predictability of operational cost.

This also changes the balance between self-hosted and cloud for sectors that handle sensitive, voluminous documents. Law firms, health administrations and insurers often work with files of hundreds of pages and data residency constraints. If computational complexity does not scale with length, it becomes more realistic to keep the entire extraction pipeline local, without moving confidential content to external APIs. This is not only a matter of sovereignty; it is a matter of TCO, because variable cloud costs shrink when infrastructure load becomes predictable.

The direction this move signals also deserves attention. The industry has long pursued ever-larger context windows as a response to document growth. SR-SWA reverses the perspective: you do not need a bigger window, you need more selective attention. For developers building visual-language models for document processing, the fixed 512-token reference is a signal: reference compression can reduce dependency on GPUs with large VRAM and shift the constraint to extraction quality. AI-RADAR evaluates these trade-offs through the analytical frameworks in the /llm-onpremise section.

The friction point remains, as always, operational detail: the source does not specify what hardware is needed to obtain these results, nor how SR-SWA behaves on documents with highly irregular layouts. But the principle is clear: if memory stays constant, the document stops being the variable that drives sizing. That is exactly the kind of signal that matters to those designing local AI infrastructure.