HyperAIHyperAI

Command Palette

Search for a command to run...

Unlimited OCR Works 2: OCR 3.0 시대의 개척 — 장문(Long)에서 무한 지평(Unlimited-Horizon) 파싱으로

Unlimited OCR 2: 긴 지평에서 무제한 지평 파싱으로

노트북으로 이동

초록

Unlimited OCR은 장문 파싱 시대를 열었으며, 문서가 길어짐에 따라 작업 기억(working memory)이 증가하는 문제를 실질적으로 완화하였다. 그러나 문서 길이가 수백 페이지 규모로 확장되면 시각적 맥락이 크게 증가하여 각 디코딩 단계의 계산 비용이 급격히 상승하고, 초장문 문서 파싱의 확장성이 제한된다. 앞 페이지를 다시 훑어보지 않고 국소적으로 집중하여 책을 필사하는 인간의 방식에서 착안하여, 우리는 자신이 필사하는 부분만을 바라보는 문서 파싱 모델인 Unlimited OCR 2를 소개한다. Unlimited OCR을 기반으로 모든 디코더 어텐션 모듈을 Sparse Reference Sliding Window Attention(SR-SWA)으로 업그레이드하여 활성 참조 토큰을 고정 용량으로 제한함으로써, 임의로 긴 문서에서도 계산 비용을 일정하게 유지한다. SR-SWA를 Unlimited-Horizon Decoding Paradigm과 결합함으로써, Unlimited OCR 2는 과도한 메모리 부담 없이 사실상 무한한 길이의 문서 파싱을 가능하게 한다. 백 페이지 규모에서 Unlimited OCR 2는 Full Attention과 R-SWA 대비 각각 단계당 7.0배 및 5.6배의 속도 향상을 달성한다. 나아가 백 페이지 문서 파싱을 겨냥하여 새롭게 제안한 벤치마크인 MPDocBench와 MarathonDocBench 모두에서 최신 최고 수준의 엔드투엔드 성능을 보인다. 궁극적으로 중단 없는 원샷(one-shot) 문서 파싱이 가능해졌다는 것은 OCR 3.0 시대로의 근본적인 패러다임 전환을 의미한다.

One-sentence Summary

Baidu ERNIE Team proposes Unlimited OCR 2, which upgrades all decoder attention modules to Sparse Reference Sliding Window Attention (SR-SWA) to bound active reference tokens, sustain constant computational costs across arbitrarily long documents, and enable unlimited-horizon parsing with 7.0×7.0\times7.0× and 5.6×5.6\times5.6× per-step speedups over Full Attention and R-SWA, respectively, along with state-of-the-art end-to-end results on MPDocBench and MarathonDocBench.

Key Contributions

  • Unlimited OCR 2 introduces Sparse Reference Sliding Window Attention (SR-SWA) in all decoder attention modules, bounding active reference tokens to a fixed capacity so per-step decoding cost remains constant across arbitrarily long documents.
  • Combining SR-SWA with the Unlimited-Horizon Decoding Paradigm and an optimized page-split decoding scheme enables document parsing over virtually unlimited lengths while significantly reducing GPU memory consumption.
  • At the hundred-page scale, Unlimited OCR 2 achieves 7.0x and 5.6x per-step speedups over Full Attention and R-SWA, respectively, and achieves state-of-the-art end-to-end performance on MPDocBench and the newly proposed MarathonDocBench benchmark.

Introduction

Document parsing has shifted from OCR-1.0 style multi-stage detection and recognition pipelines to end-to-end vision-language OCR-2.0 systems, making long-document transcription a key efficiency challenge. Prior work such as Unlimited OCR improved multi-page parsing with Reference Sliding Window Attention and a constant KV cache, but it still computed dense attention over all visual tokens across pages, so visual redundancy and memory cost grew with document length. The authors introduce Unlimited OCR 2, which applies Sparse Reference Sliding Window Attention: Page Gate limits each query to relevant pages, while Token Sieve selects only the top-k remote token buckets for long-range dependencies. They also present MarathonDocBench for hundred-page evaluation and show that the approach maintains constant per-step decoding latency with length-invariant accuracy, supporting unlimited-horizon parsing.

Dataset

Dataset Description

The authors introduce two dataset-related components: MarathonDocBench, a hundred-page document parsing benchmark, and a large-scale training corpus built through a data engine for Unlimited OCR 2.

MarathonDocBench

  • Source and scale: 100 documents spanning 103 to 300 pages, with 205k annotated layout elements.
  • Purpose: First benchmark specifically designed for hundred-page document parsing. It extends document-length range by roughly an order of magnitude beyond MPDocBench.
  • Composition: Contains substantially richer cross-page structures than MPDocBench, with cross-page text and tables appearing more frequently and densely. This makes it a more challenging testbed for evaluating document-level structure preservation.
  • Annotation and processing: Structural annotations include bounding boxes, block type, hierarchy, reading order, and cross-page continuations of text and tables. They are initialized from a strong page-by-page parser and carefully refined by human annotators. Text transcriptions are initialized from the same parser outputs and verified through an iterative VLM-based refinement pipeline, with flagged disagreements adjudicated by human annotators.
  • Usage: Used as a benchmark for evaluating whether end-to-end parsers can preserve document-level structure while scaling from tens to hundreds of pages. The provided text does not describe MarathonDocBench as training data.

Training Data Engine

  • Scale and composition: A large-scale multimodal corpus with 2M multi-page documents and 10M single-page documents.
  • Sources and pseudo-labeling: Pseudo-labels for single-page and multi-page subsets are extracted from MinerU2.5-Pro and PaddleOCR-VL-v1.6, tailored to their respective domain strengths.
  • Diversity and filtering: Versatile synthetic document generation pipelines are used to enrich visual and layout diversity. VLM-based multi-dimensional feature analysis performs balance filtering to ensure uniform coverage over complex layout distributions.
  • Structural processing: MinerU-Popo refinement and dedicated heuristic post-processing rules are applied to fortify structural hierarchy and cross-page continuity, especially by reconciling layout inconsistencies across adjacent page boundaries in multi-page scenarios.
  • Usage: Used to train Unlimited OCR 2 for versatile document parsing. The provided text does not specify exact training split ratios or real/synthetic mixture ratios beyond the 2M multi-page and 10M single-page document sizes.
  • Cropping and metadata schema: No cropping-specific processing or metadata schema details are described in the provided excerpt.

Method

The authors leverage DeepSeek OCR as the foundation for Unlimited OCR 2, employing a DeepEncoder paired with a Mixture-of-Experts (MoE) decoder architecture. This setup features 3B total parameters with 500M activated parameters per token. To enable end-to-end processing of documents with arbitrary lengths while maintaining bounded computational and memory complexities, the authors replace the baseline R-SWA with their proposed Sparse Reference Sliding Window Attention (SR-SWA).

Refer to the framework diagram:

SR-SWA constructs a fixed-length set of working reference visual tokens by combining two hierarchical mechanisms: Page Gate and Token Sieve. Page Gate restricts the visual attention scope for a query to the current page, retaining only blocks from the designated target pages. To prevent positional explosion as the page count scales, it factorizes each token position into a bounded page-level coordinate and a monotonic intra-page coordinate, formulated as pi,j=[pipage,pi,jintra]\mathbf{p}_{i, j} = [\mathbf{p}_{i}^{\mathrm{page}}, \mathbf{p}_{i, j}^{\mathrm{intra}}]pi,j​=[pipage​,pi,jintra​]. Following this, Token Sieve performs efficient fixed-budget routing. It summarizes each candidate block into a compact key representation and computes its relevance to the query. The router forms a sparse routing distribution and retains only the top-k blocks:

sb(q)=q~⊤kˉbd,π(q)=α-entmax({sb(q)}b∈Cpage(q)),S(q)=TopK(π(q),k).s_{b}(q) = \frac{\tilde{\mathbf{q}}^{\top} \bar{\mathbf{k}}_{b}}{\sqrt{d}}, \quad \boldsymbol{\pi}(q) = \alpha\text{-entmax}(\{s_{b}(q)\}_{b \in \mathcal{C}_{\mathrm{page}}(q)}), \quad \mathcal{S}(q) = \mathrm{TopK}(\boldsymbol{\pi}(q), k).sb​(q)=d​q~​⊤kˉb​​,π(q)=α-entmax({sb​(q)}b∈Cpage​(q)​),S(q)=TopK(π(q),k).

To enable end-to-end optimization without an auxiliary KL-divergence distillation loss, the routing probabilities are converted into a mean-centered log-prior:

βb(q)=log⁡πb(q)−1∣S(q)∣∑b′∈S(q)log⁡πb′(q),b∈S(q).\beta_{b}(q) = \log \pi_{b}(q) - \frac{1}{|\mathcal{S}(q)|} \sum_{b' \in \mathcal{S}(q)} \log \pi_{b'}(q), \quad b \in \mathcal{S}(q).βb​(q)=logπb​(q)−∣S(q)∣1​b′∈S(q)∑​logπb′​(q),b∈S(q).

This bias acts as a routing bias directly incorporated into the attention logits:

αj(q)=Softmax⁡(q⊤kjd+I[b(j)∈S(q)]βb(j)(q)).\alpha_{j}(q) = \operatorname{Softmax}\left(\frac{q^{\top} k_{j}}{\sqrt{d}} + \mathbb{I}[b(j) \in \mathcal{S}(q)] \beta_{b(j)}(q)\right).αj​(q)=Softmax(d​q⊤kj​​+I[b(j)∈S(q)]βb(j)​(q)).

This allows gradients from the parsing objective to propagate directly to the routing module.

While SR-SWA bounds the number of reference tokens accessed per query, processing extremely long multi-page documents still faces GPU memory constraints during the prefilling and retention of visual KV caches.

As shown in the figure below:

To overcome this, the authors introduce the Unlimited-Horizon Decoding Paradigm. Instead of keeping all page-level visual KV caches in memory, which causes linear memory growth, this paradigm partitions the document into overlapping page-level chunks and processes them sequentially. Adjacent chunks share their boundary page, and its KV cache is directly reused to preserve cross-chunk continuity. Meanwhile, visual KV caches outside the active chunk are released. Consequently, only a fixed-size chunk remains resident in GPU memory, bounding the memory footprint independently of the total document length.

Experiment

Unlimited OCR 2 is initialized from the Unlimited OCR checkpoint and post-trained for one epoch on a curated dataset, with only the LLM optimized while the DeepEncoder and aligner remain frozen, then evaluated on MPDocBench and MarathonDocBench for multi-page and hundred-page document parsing. The main experiments validate that the model enables practical hundred-page end-to-end parsing, achieves state-of-the-art long-document and cross-page parsing, and still preserves strong single-page recognition. Further scaling studies confirm that the Unlimited-Horizon Decoding Paradigm with SR-SWA substantially reduces KV cache memory and improves throughput, while maintaining length-invariant accuracy and near-constant per-step decoding latency as document length grows to hundreds of pages.

Among the end-to-end VLM baselines on MPDocBench, Qwen3.8-Max leads in overall performance and most document metrics, while Kimi-K3 stands out only on cross-page table structure. The reported analysis also positions Unlimited OCR 2 as state of the art on overall and cross-page text and table metrics, surpassing the listed baselines. Qwen3.8-Max records the highest overall score and the best plain text, formula, table, figure, heading, and reading order metrics among the compared general VLMs. Kimi-K3 achieves the strongest cross-page table score but the weakest formula score, while InternVL-3.5-38B ranks lowest overall and is especially weak on figure and heading metrics.

Unlimited OCR 2 is reported to reach an overall score of 77.06 on MarathonDocBench, far exceeding the general VLM baselines shown, whose overall scores range from about 18 to 34. Among those general VLMs, Kimi-K3 leads on overall, text, formula, table, read-order, and heading metrics, while Qwen3.8-Max performs best on figure recognition. The results support the claim that Unlimited OCR 2 advances long-document parsing without sacrificing accuracy on text and table structures. Unlimited OCR 2 attains a 77.06 overall score on MarathonDocBench, more than double the best general VLM score listed. Kimi-K3 is the strongest general VLM in the comparison, leading overall and most document-structure metrics. Qwen3.8-Max has the highest figure recognition score among the general VLMs but lags behind on other metrics. The listed general VLMs score between roughly 18 and 34 overall, indicating a large gap to Unlimited OCR 2.

On OmniDocBench v1.6, Qianfan-OCR leads the listed end-to-end VLM-based parsers in overall performance and table structure quality, while FireRed-OCR and ABot-OCR tie for the lowest text-edit error and Logics-Parsing-v2 shows the strongest formula recognition. The accompanying text reports that Unlimited OCR 2 reaches an overall score of 94.02 on the same benchmark, exceeding the best listed model and indicating preserved single-page recognition. Qianfan-OCR achieves the highest overall and table structure scores among the compared systems, with the lowest read-order error. FireRed-OCR and ABot-OCR share the lowest text-edit error, and Logics-Parsing-v2 leads on formula recognition. The paper states Unlimited OCR 2 attains an overall OmniDocBench score of 94.02, above the strongest listed model.

Sequential chunk processing with boundary-page KV cache reuse greatly lowers peak KV cache memory during single-sequence inference and raises end-to-end throughput under concurrent inference. These gains enable efficient parsing of hundred-page documents under constrained GPU memory. Peak KV cache memory drops from tens of gigabytes to under two gigabytes for single-sequence decoding. End-to-end throughput increases several-fold under concurrent inference. The approach makes hundred-page document parsing practical under limited GPU memory.

The experiments evaluate Unlimited OCR 2 against end-to-end VLM baselines on MPDocBench, MarathonDocBench, and OmniDocBench v1.6, while also testing inference efficiency under chunked processing. Unlimited OCR 2 substantially outperforms the listed general VLMs on long-document parsing, achieving 77.06 overall on MarathonDocBench and 94.02 on OmniDocBench, with baselines showing more limited strengths such as Qwen3.8-Max on figures and Qianfan-OCR on tables. Sequential chunk processing with boundary-page KV cache reuse reduces peak KV cache memory from tens of gigabytes to under two gigabytes and increases concurrent throughput several-fold, validating both accuracy and memory efficiency for long-document OCR.


AI로 AI 구축

아이디어에서 출시까지 — 무료 AI 코코딩, 즉시 사용 가능한 환경, 최적의 GPU 가격으로 AI 개발을 가속화하세요.

AI 협업 코딩
바로 사용 가능한 GPU
최적의 가격

HyperAI Newsletters

최신 정보 구독하기
한국 시간 매주 월요일 오전 9시 에 이번 주의 최신 업데이트를 메일로 발송합니다
이메일 서비스 제공: MailChimp