Unlimited OCR 2: Parse Hundreds of Pages in a Single Pass with Constant Compute Cost

Unlimited OCR 2 achieves constant per-step cost via SR-SWA, advancing single-pass parsing to hundreds of pages.
Unlimited OCR 2 tackles the computational overhead explosion in ultra-long document parsing caused by visual context expansion. It proposes Sparse Reference Sliding Window Attention (SR-SWA), which limits active reference tokens to a fixed capacity so per-step cost stays constant regardless of document length. Combined with unlimited-horizon decoding, the model performs single-pass, uninterrupted parsing over virtually unlimited lengths. At the hundred-page scale, it achieves 7.0× and 5.6× single-step speedups over Full Attention and R-SWA, and reaches state-of-the-art end-to-end performance on MPDocBench and the new MarathonDocBench. This work pushes OCR from dozens to hundreds of pages and is seen as a landmark direction for the OCR 3.0 era.
From "Long Documents" to "Ultra-Long Documents": The Next Hurdle for OCR
Over the past year, the main narrative in OCR has been "long-horizon parsing"—enabling models to read through dozens of pages in one go rather than splitting them page by page and stitching the results back together. Unlimited OCR is a representative work on this path: it curbed the growth of working memory, so that longer documents no longer linearly drag down the model.
But the problem is not fully solved. As document length climbs from dozens of pages to hundreds, the total volume of visual context keeps expanding, and the computational overhead of each decoding step rises sharply. In other words, working memory is under control, but visual context has become the new bottleneck—scalability of ultra-long document parsing is once again constrained.

Unlimited OCR 2 is designed to answer exactly this question: can we keep the computational cost of each step constant when parsing ultra-long documents?
Working Memory in document parsing models typically refers to the intermediate state representations the model maintains while processing current input. For autoregressive decoding OCR models, working memory includes the generated text tokens and their corresponding visual feature cache. If working memory grows linearly with document length, memory usage and computational overhead quickly become unmanageable. Unlimited OCR keeps the size of working memory compressed or fixed, so the model doesn't collapse from cache bloat when reading long documents—this is one of its key mechanisms for achieving "long-horizon parsing." Understanding this concept helps distinguish the different bottlenecks of working memory versus visual context.
Core Insight: Like Copying a Book—Only Look at the Passage Being Written
The research team borrowed an analogy from human reading behavior. When a person copies a book by hand, they don't rescan every previous page after writing each character; instead, they focus attention on the local region currently being transcribed.
This observation was translated into an architectural design principle: the model only "looks at" what it is currently transcribing. Based on this principle, Unlimited OCR 2 upgrades all decoder attention modules in Unlimited OCR to Sparse Reference Sliding Window Attention (SR-SWA).
The key to SR-SWA is "boundedness": it restricts the number of active reference tokens to a fixed capacity. No matter how long the document is, the number of reference tokens participating in attention computation does not grow with length, so computational cost remains constant across documents of any length—rather than ballooning with page count as in full attention.
Reference tokens in attention mechanisms refer to the visual or textual units selected from the input document that participate in attention computation at each decoding step. In Full Attention mode, all encoded reference tokens are included in computation, and computational cost grows quadratically or linearly with document length. SR-SWA limits each step's attention computation to a constant scale by capping the capacity of active reference tokens, thereby avoiding the computational explosion caused by long documents. Unlike traditional sliding window attention, which constrains the window of adjacent positions, SR-SWA constrains the cardinality of the reference set.
How Constant Cost Is Achieved: SR-SWA and Unlimited-Horizon Decoding
Attention redesign alone is not enough. Unlimited OCR 2 combines SR-SWA with the Unlimited-Horizon Decoding Paradigm. Together, they make document parsing feasible over virtually unlimited lengths without incurring prohibitive memory costs.
The division of labor can be understood this way: SR-SWA handles "how much to look at per step," locking down the single-step reference scope; unlimited-horizon decoding handles "how the whole process proceeds," allowing the parsing process to continue across arbitrarily long document boundaries. Only when combined do they form the technical foundation for "single-pass, uninterrupted parsing."
This also explains why the team emphasizes this as a "paradigm shift" rather than a mere efficiency optimization—it changes the cost structure of long-document parsing, rather than trimming costs within the existing structure.
Performance: Significant Speedup at the Hundred-Page Scale and End-to-End Leadership
At the hundred-page document scale, Unlimited OCR 2 achieves a 7.0× single-step speedup over Full Attention and a 5.6× single-step speedup over R-SWA. Both numbers point to the same thing: as documents get longer, the advantage of the constant-cost design is amplified rather than diluted.
In end-to-end performance, Unlimited OCR 2 achieves state-of-the-art results on both MPDocBench and MarathonDocBench. MarathonDocBench is a new benchmark the team specifically proposed for hundred-page-level document parsing—existing evaluation sets generally do not cover this length range, which is one reason ultra-long document parsing has long lacked a unified measuring standard.
Full Attention is the standard attention mode of Transformer decoders, where each decoding step computes attention weights over all historical tokens or reference tokens. Its advantage is lossless information, but computational and memory overhead rises significantly with sequence length, making per-step cost extremely high on hundred-page documents. R-SWA (Reference Sliding Window Attention) is a reference sliding window attention that typically selects reference tokens only within a fixed window, but may still introduce additional overhead as the window slides. Unlimited OCR 2's SR-SWA further limits active reference tokens to a fixed capacity, achieving 7.0× and 5.6× single-step speedups over the former two respectively at the hundred-page scale.
Why This Matters
The real demand for ultra-long document parsing has always existed: contract bundles, academic paper collections, bidding documents, historical archives—often hundreds of pages. The mainstream approach previously was page-by-page processing followed by merging, at the cost of lost cross-page context, broken layout logic, and page-by-page error accumulation.
The value of Unlimited OCR 2 lies in advancing "reading it all in one pass" from dozens of pages to hundreds or even longer, while keeping computational cost from spiraling out of control with length. The team describes this capability as a hallmark of the OCR 3.0 era—from "can recognize" to "can continuously parse documents of any length in a single pass," the dimension being measured has changed.
Of course, the information disclosed in the abstract still centers on architecture and benchmark results; layout complexity and multilingual performance in real-world scenarios still await more independent evaluation and verification. But as a combination of "constant computational cost + hundred-page-level single-pass parsing," it does indeed offer an engineering direction worth following for ultra-long document processing.
FAQ
What's the difference between SR-SWA and ordinary sliding window attention?
Ordinary sliding windows typically operate on a positional window of adjacent tokens; SR-SWA constrains the active capacity of "reference tokens," fixing the reference scope participating in computation within an upper limit, thereby keeping per-step cost constant regardless of document length.
Does constant cost mean accuracy will drop?
From public results, Unlimited OCR 2 achieves state-of-the-art on both MPDocBench and MarathonDocBench, indicating that bounded attention does not come at the expense of end-to-end effectiveness. However, robustness in more scenarios still requires further verification.
What is MarathonDocBench?
It is a new hundred-page-level document parsing benchmark proposed in this work, intended to fill the gap in existing evaluations for the ultra-long document range.
One-line Summary
Unlimited OCR 2 achieves constant per-step cost via SR-SWA, advancing single-pass parsing to hundreds of pages.
Paragraph Summary
Unlimited OCR 2 addresses the problem of sharply rising computational overhead caused by visual context expansion in ultra-long document parsing by proposing Sparse Reference Sliding Window Attention (SR-SWA), which limits active reference tokens to a fixed capacity so that per-step computational cost does not grow with document length. Combined with the unlimited-horizon decoding paradigm, the model can perform single-pass, uninterrupted parsing at virtually unlimited lengths. At the hundred-page document scale, it achieves 7.0× and 5.6× single-step speedups over Full Attention and R-SWA respectively, and reaches state-of-the-art end-to-end performance on MPDocBench and the newly proposed MarathonDocBench. This work advances OCR capability from dozens of pages to hundreds of pages and is regarded as a landmark direction for the OCR 3.0 era.
Related articles
AWS AgentCore Gateway: Connecting AI A…
AWS AgentCore Gateway: Connecting AI Agents to Enterprise Backends with MCP
How AWS AgentCore Gateway acts as a primary MCP server to aggregate REST APIs, Lambda, and existing MCP services? Analyzing its AST real-time mapping, zero cold start, semantic search for tool overload, session isolation, and key injection security design, plus the architectural approach to decoupling enterprise AI agents from backends.

One Link Gives Figma AI a New Skill: Hands-On with MCP Connectors
Paste one MCP server link and the AI Agent in Figma gains new tool capabilities. We break down the setup flow, 20+ one-click apps, read/write permissions and execution policies, and the public HTTPS requirement.

Cognition SWE-2 in Practice: One Prompt to Handle the Whole Product Launch Process
Analyzing a YouTube creator's prompt for using Cognition SWE-2 to launch a product: a landing page, seven-email sequence, and non-buyer follow-up tool, plus how the 'test and report' constraint changes AI delivery quality.