PaDoc: Layout-Grounded Parallel Decoding for Document Parsing
Analyze & explore related research in Conceptio
Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.
PaDoc: Layout-Grounded Parallel Decoding for Document Parsing Hao Yu1,2∗ , Jiabo Zhan1∗ , Kang Liu2 , Linnan Zhao2 , Dongxu Yue1 , Rui Chen1 , Jinglin Wang1 , Chong Sun2 , Chen Li2 , Jing LYU2 , Chun Yuan1† 1
Tsinghua University
arXiv:2608.06146v1 [cs.AI] 6 Aug 2026
Abstract End-to-end document parsers provide a unified interface, but serialize page layouts and regional contents into one autoregressive sequence. This formulation forces independent regions onto a decoding path whose length grows with the total content, whereas crop-based two-stage parsers expose region-level parallelism at the cost of repeated visual prefills and fragmented page context. To retain full-page context while removing dependencies, we propose PaDoc, a layoutgrounded parser that treats the predicted layout as a branching structure over a shared page representation. Under a regionsufficiency assumption, we derive a prefix-conditioned factorization in which the layout stream and regional content branches advance concurrently, reducing the decoding depth to the longest layout-content path. We realize this factorization within a single MLLM: packed variable-length ancestor attention preserves the visibility under standard next-token training, while masked parallel decoding creates branches that the evaluated vLLM backend serves as concurrent requests with cache-resident shared-prefix reuse. On OmniDocBench Full, PaDoc attains an Overall layout F1 of 91.1 and, among endto-end parsers, a top-tier Overall score of 94.24 together with the best Text Edit (0.038) and Formula CDM (95.59). On a 384-page subset and one A800 GPU, it is the fastest end-toend parser at five concurrency levels, improving valid-page throughput by 67.4–118% and reducing P95 latency by 39.2– 54.9% relative to a same-backbone Sequential SFT baseline. Code is available at https://github.com/Longin-Yu/Padoc.
Introduction Document parsing transforms page images into structured representations of layout regions, reading order, text, formulas, tables, and figures. Multimodal systems increasingly cast this task as sequence generation, using a unified autoregressive model to emit Markdown, HTML, JSON, or layoutcontent records. Early image-to-sequence models established this paradigm (Kim et al. 2022; Lee et al. 2023; Blecher et al. 2024), and subsequent document VLMs extended it to fullpage structured parsing (Nassar et al. 2025; Poznanski et al. 2025; Niu et al. 2026; Dong et al. 2026). Although this unified interface reduces task-specific modeling, it retains the sequential execution semantics of autoregressive decoding. ∗ †
These authors contributed equally. Corresponding author.
2
Wechat Vision, Tencent
As illustrated in Figure 1(a), a flat output sequence does not reflect the conditional structure of a document. Consider a serialization (b1 , y1 , b2 , y2 , . . . , bN , yN ), where bk specifies the layout of region k and yk denotes its category, text, formula, or table representation. A causal decoder must complete yk before generating bk+1 , irrespective of whether the two regions are spatially separated and semantically independent. The resulting critical path therefore scales with the sum of all regional content lengths and becomes particularly costly for pages containing many independently recognizable regions. Layout-first systems expose region-level parallelism, as shown in Figure 1(b), but their per-region crops require repeated visual encoding and restrict access to pagelevel context (Cui et al. 2026; Niu et al. 2026; Feng et al. 2025, 2026). General accelerators instead create speculative or textual branches that are not necessarily grounded in visual document instances and may be excluded from the final output (Leviathan, Kalman, and Matias 2023; Cai et al. 2024; Li et al. 2024; Liao et al. 2026; Yao et al. 2025). These limitations, which respectively fragment visual context and introduce branches ungrounded in document layout, motivate a formulation that derives parallelism from the predicted layout while preserving a shared page representation. To this end, we propose PaDoc, a layout-grounded document parser implemented within a single MLLM, as illustrated in Figure 1(c). PaDoc adopts a region-specific conditional-independence assumption under which the content Yk of region k is independent of other regions’ contents conditioned on the page image X and its layout Bk . This assumption yields a prefix-conditioned factorization in which the layout stream predicts Bk+1 and the corresponding content branch predicts Yk from the common prefix (X, B≤k ). The two factors can consequently be decoded concurrently. Unlike crop-based recognition, every content branch retains the complete page image as a shared visual prefix and differs only in the visible layout prefix. PaDoc realizes this factorization without separate detector or recognizer heads. During training, logical ancestor attention exposes the image and appropriate layout ancestors to each branch while excluding sibling contents. Its packed variable-length implementation avoids a dense mask while retaining the standard next-token objective. At inference, masked parallel decoding uses region-closing tokens to instantiate branch-isolated content streams under the same
Quarterly Earning Report
ViT
Auto Regressive Model
Image Feature
<BOS>
<B > ... </B >
<B > ... </B >
<B > ... </B >
CONTENT
<FORK> Image Feature
<BOS>
<LAYOUT > x
y
x
<LAYOUT > x
y
x
y </LAYOUT >
<LAYOUT > x
y
x
y </LAYOUT >
y </LAYOUT > CONTENT
<EOS>
(a) Sequential End-to-End Parsing ViT x y x y
Layout Analysis Model x y x y
Crop
x y x y
Image Feature <BOS> Image Feature <BOS> Image Feature <BOS>
CONTENT CONTENT CONTENT
PaDoc
<EOS> <EOS> <EOS>
<EOS>
<FORK>
Quarterly Earning Report
CONTENT CONTENT
ViT
<EOS>
X
B1 B2 B3
Y1
<EOS>
CONTENT
Y2
Y3
<FORK> CONTENT
<EOS>
X B1 B2 B3
Image Prefix Layout Prefix Masked
Y1
Causal Self
Y2 Y3
ViT
Content Recognition Model
(b) Crop-Based Two-Stage Parsing
Logical Ancestor Attention Mask (c) Parallel Document Parsing (Ours)
Figure 1: Comparison of three document-parsing paradigms. (a) Sequential end-to-end parsing serializes all layout and content tokens after a single visual encoding; (b) crop-based two-stage parsing exposes region-level parallelism but requires crop extraction and repeated visual prefills. (c) PaDoc forks content branches from shared full-page image and layout prefixes. The displayed ancestor mask is logical: training realizes it with packed variable-length attention rather than materializing a dense mask, while serving instantiates concurrent streams with shared-prefix cache reuse.
ancestor visibility. Our evaluated vLLM backend (Kwon et al. 2023) realizes these streams as concurrent requests with cache-resident image and layout prefix reuse. The resulting logical decoding depth is the longest root-to-leaf layoutcontent path rather than the sum of all regional content lengths. We initialize the model directly from the original Qwen3-VL-2B checkpoint (Bai et al. 2025) and adapt all modules through continual pre-training (CPT) followed by high-quality supervised fine-tuning (SFT). We evaluate layout analysis, end-to-end parsing, and inference efficiency on OmniDocBench (Ouyang et al. 2024). PaDoc attains an Overall layout F1 of 91.1. Among end-toend parsers, it achieves a top-tier Overall score of 94.24, together with the best Text Edit and Formula CDM. On an A800 GPU, it’s the fastest end-to-end parser at all five tested concurrency levels. Relative to the same-backbone Sequential SFT baseline, PaDoc improves throughput by 67.4 ∼ 118% and reduces P95 latency by 39.2 ∼ 54.9%. Despite its 2.1B size, it also surpasses the 1.0B HunyuanOCR-1.5 at every concurrency and substantially outpaces the 0.7B MonkeyOCRv2, establishing a favorable quality-efficiency trade-off. Our contributions are threefold: • We derive a prefix-conditioned factorization of document parsing that exposes region-level parallelism while preserving a shared page-image prefix, thereby reducing the logical decoding depth to the longest layout-content path. • We develop a single-model training formulation based on ancestor attention and an efficient packed tree-varlen realization, retaining standard next-token training without auxiliary prediction heads or losses. • We implement layout-grounded parallel serving with shared-prefix KV reuse and demonstrate a favorable quality–efficiency trade-off against representative end-toend and two-stage document parsers.
Related Work Document parsing as multimodal generation. Recent document parsing systems increasingly formulate document understanding as multimodal generation, directly converting document images or PDF pages into Markdown, structured text, or task-specific markup. Compared with OCRcentric pipelines, this paradigm offers a unified output space for heterogeneous elements such as text, tables, formulas, figures, and layout structures. Representative imageto-sequence methods, including Donut (Kim et al. 2022), Pix2Struct (Lee et al. 2023), and Nougat (Blecher et al. 2024), have demonstrated the effectiveness of generative document modeling, while recent document VLMs such as SmolDocling (Nassar et al. 2025) and olmOCR (Poznanski et al. 2025) extend this paradigm to page-level structured parsing. Qianfan-OCR (Dong et al. 2026) further unifies layout analysis, parsing, and understanding, with Layout-as-Thought highlighting the need for explicit layout grounding in endto-end generation. However, most generation-based parsers still serialize the entire page into a single autoregressive sequence, which imposes artificial sequential dependencies among spatially separated regions and becomes inefficient for dense, table-heavy, or text-rich documents. Layout detection and instance-level recognition. Another line of work adopts a layout-first pipeline, where page elements are first localized and then recognized at the region level. Recent detectors such as DocLayout-YOLO (Zhao et al. 2024) and PP-DocLayout (Sun et al. 2025) provide efficient structural front-ends, while systems such as DocBed (Zhu et al. 2022), Dolphin (Feng et al. 2025, 2026), and HSD (Liao et al. 2026) further exploit layout-guided decomposition for local or parallel document parsing. Related instance-level recognition methods such as SPTS v2 (Liu et al. 2023) also suggest the efficiency benefits of separating localization from
recognition. However, when region recognition is performed largely independently, such pipelines may weaken page-level context, including reading order, section hierarchy, tablecaption relations, and cross-region references. This creates a tension between local parallelism and global document coherence. Structured parallel generation. Structured generation represents outputs as sets, trees, graphs, or schemas rather than flat token sequences, enabling decoding to operate on meaningful units instead of individual tokens. Recent methods exploit such structure for parallel decoding: SoT (Ning et al. 2024) expands different skeleton points in parallel, APAR (Liu et al. 2024) learns control tokens that fork hierarchical autoregressive branches, and methods such as PASTA (Jin et al. 2025), ASPD (Chen et al. 2025), and SPRINT (Biju et al. 2026) introduce learned chunk annotations, adaptive serial-parallel switching, or planning-based parallel execution. System-level works such as Hogwild! Inference (Rodionov et al. 2026) and DeFT (Yao et al. 2025) further provide runtime support for shared attention caches and tree-structured inference. While these methods show that explicit output structure can unlock parallel decoding, their structures are usually defined over text, reasoning steps, or abstract trees. Dense document parsing requires such parallel structures to be grounded in visual layout instances while still sharing page-level context.
Method Problem Formulation Task formulation of document parsing. Let X denote a document image, and let x be an observed realization of X. Document parsing aims to predict a collection of layoutcontent pairs {(Bk , Yk )}N k=1 , where Bk denotes the k-th layout region, e.g., a bounding box, and Yk denotes the textual or structured content associated with that region. We use lowercase letters bk and yk to denote concrete realizations of Bk and Yk , respectively. The regions are arranged in a canonical order, such as reading order. The target distribution of document parsing is p⋆ (b1:N , y1:N | x),
(1)
By the chain rule, it can be decomposed into a layout component and a content component: p⋆ (b1:N , y1:N | x) = p⋆ (b1:N | x) p⋆ (y1:N | x, b1:N ). (2) The first term corresponds to layout analysis, while the second term corresponds to content recognition conditioned on the layout. Both terms can be further factorized by the chain rule as N Y p⋆ (b1:N | x) = p⋆ (bk | x, b<k ), N k=1 Y p⋆ (y | x, b ) = p⋆ (yk | x, b1:N , y<k ). 1:N 1:N
(3)
k=1
Given the canonical region order, the layout factor is a standard autoregressive layout predictor. The main design choice
is the content factor: which parts of the full layout and content history are actually needed to predict each Yk . Thus, the central modeling problem is how to factorize and parameterize p⋆ (yk | x, b1:N , y<k ). (4) Native structural properties of document parsing. Each content variable Yk is grounded in a specific visual region Bk . We capture this region-anchored structure with two conditional-independence assumptions, stated using conditional mutual information (Dobrushin 1963; Wyner 1978). Here I(A; B | C) denotes the conditional mutual information between A and B given C. Assumption 1 (Region-specific content sufficiency). Given the document image X and the current region Bk , other layout regions and previously decoded contents provide no additional information about Yk : I(Yk ; B<k , B>k , Y<k | X, Bk ) = 0.
(5)
Assumption 2 (Crop sufficiency). For a region Bk , let Xk = Crop(X, Bk ) denote its cropped image. The crop preserves all visual evidence needed to recognize the content associated with that region: I(Yk ; X, Bk | Xk ) = 0.
(6)
Crop-based two-stage formulation. A crop-based twostage parser (Cui et al. 2026; Niu et al. 2026) first predicts the layout and then recognizes each region independently from xk = Crop(x, bk ). Applying Assumptions 1 and 2 yields the following parameterization, which exposes the same regionlevel parallelism: pcrop (b1:N , y1:N | x) = pB θ (b1:N | x) θ
N Y
pY θ (yk | xk ). (7)
k=1
However, this formulation requires per-region crop extraction and repeated visual prefills. Crop materialization introduces preprocessing and data-movement overhead, while encoding each crop separately prevents the reuse of a shared page-level visual prefix. Shared-prefix parameterization of PaDoc. Our goal is to retain the same conditional-independence structure, and thus the region-level parallelism it enables, while removing these condition-switching costs. The key is to replace the region-specific condition xk with a shared condition that is a prefix of one common autoregressive context. PaDoc keeps the document image as a shared visual prefix and conditions the k-th content branch on the generated layout prefix B≤k , so the branch starts from (X, B≤k ) rather than from a separately materialized crop Xk . Consequently, all content branches share the visual prefill and differ only in how much layout prefix they expose. It remains to justify that this shared-prefix condition is sufficient for the same parallel decoding structure. By the chain rule of conditional mutual information, Assumption 1 implies the prefix-conditioned form (see Appendix A.1 for a derivation): I(Yk ; B>k , Y<k | X, B≤k ) = 0.
(8)
This removes the dependence on future layout regions and previously decoded contents once (X, B≤k ) is known: p⋆ (yk | x, b1:N , y<k ) = p⋆ (yk | x, b≤k ).
(9)
Substituting this identity into the exact decomposition yields the prefix-conditioned factorization p⋆ (b1:N , y1:N | x) =
N Y
p⋆ (bk | x, b<k )
k=1
N Y
p⋆ (yk | x, b≤k ). (10)
k=1
Accordingly, PaDoc parameterizes the document parsing distribution with a layout stream and prefix-conditioned content branches: pPaDoc (b1:N , y1:N | x) θ N N Y Y = pB (b | x, b ) pY k <k θ θ (yk | x, b≤k ) k=1
= pB θ (b1 | x)
N Y k=1
(11)
k=1
pB (bk+1 | x, b≤k ) pY (yk | x, b≤k ), {z θ } |θ share prefix (x, b≤k )
where we reindex the layout product and pair each nextregion predictor with the current-region content predictor, so that both factors at step k are conditioned on the same prefix (x, b≤k ). The boundary term bN +1 = EOS denotes the end-of-sequence layout token that terminates the layout stream. This factorization enables parallel decoding: after the layout prefix B≤k has been generated, the next layout region and the current region content are both conditionally available, Bk+1 ∼ pB θ (· | X, B≤k ),
Yk ∼ pY θ (· | X, B≤k ). (12)
Since neither variable conditions on the other in the model factorization, they can be decoded concurrently. Let ℓ(·) denote the number of autoregressive decoding steps required to generate its argument. A fully sequential layoutthen-content decoder has sequential depth Dseq = ℓ(B1:N ) +
N X
ℓ(Yk ).
reproduces the parallel graph structure at training time. Inspired by APAR-style ancestor attention (Liu et al. 2024), PaDoc represents layout and content variables as nodes in a directed acyclic graph. The graph contains the image node X, layout nodes B1 , . . . , BN , and content nodes Y1 , . . . , YN , with ancestor sets Anc(Bk ) = {X, B<k },
The PaDoc graph in Figure 1(c) follows these ancestor sets. During training, each node attends only to its ancestors and to earlier positions within the same node under a causal mask. For a node V , tokens can attend to all tokens in Anc(V ) and to non-future tokens within V . Because Anc(Bk ) = {X, B<k } and Anc(Yk ) = {X, B≤k }, this pattern exactly realizes the prefix-conditioned factors Y pB θ (bk | x, b<k ) and pθ (yk | x, b≤k ), while preventing leakage from content nodes to future layout nodes or to other content nodes. Efficient ancestor attention. A direct realization materializes the ancestor mask as a dense S × S tensor and therefore cannot use standard causal FlashAttention. We instead express the same visibility pattern as a collection of variable-length causal attention problems. The layout stream forms one causal sequence, while the query tokens of content branch Yk attend to the virtual key/value sequence [X, B≤k , Yk ]. Only the already-projected key/value rows of the shared prefix are gathered; queries and token projections are computed once, and gradients to reused prefix rows are accumulated by the gather operation. This tree-varlen realization avoids quadratic mask storage and retains standard causal FlashAttention kernels. We use it for all experiments. Appendix C compares dense SDPA and Flex Attention baselines with tree-varlen. ⋆ Given ground-truth annotations (b⋆1:N , y1:N ), PaDoc is trained with teacher forcing by minimizing the negative loglikelihood L(θ) = −
(13)
Anc(Yk ) = {X, B≤k }. (15)
N X
⋆ ⋆ log pB θ (bk | x, b<k ) −
k=1
N X
⋆ ⋆ log pY θ yk | x, b≤k . (16)
k=1
k=1
In contrast, under ideal parallel scheduling, PaDoc has critical-path decoding depth DPaDoc = max ℓ(B1:N ), max ℓ(B≤k ) + ℓ(Yk ) 1≤k≤N (14) = max {ℓ(B≤k ) + ℓ(Yk )} 1≤k≤N
Therefore, PaDoc reduces the sequential dependency path from the total length of all layout and content sequences to the longest path in the layout-content dependency graph.
A standard autoregressive head supervises one next-token target at each position, whereas a fork in the document tree has multiple continuations. Each layout node Bk forks into the next layout node Bk+1 and its content branch Yk ; we retain the former as the main stream and prepend a branch-start token to the latter. This token opens an independent continuation under the same ancestor context, and one such token can be added for every extra branch at a higher-arity fork. Training therefore remains a standard next-token prediction problem while exposing the parallel graph structure.
Inference Speedup Training Paradigm The prefix-conditioned factorization derived above can be learned in a single forward pass over one shared sequence, without ever materializing per-region crops, provided the attention pattern exposes the right dependencies. PaDoc realizes this with a purpose-built ancestor-attention mask, so that a standard next-token objective on the packed sequence
Masked parallel decoding. At inference, PaDoc follows the conditional dependencies in Eq. (12). Once a region’s layout description is complete, its content stream and the next layout step become available from the same preceding context. The decoder therefore forks a content stream from the shared multimodal and layout prefix while the main layout stream continues. Each content stream retains the context
Paradigm Method
Overall
Size IoU
Two-stage
Dolphin-v2 MinerU2.5-Pro PaddleOCR-VL 1.5
F1
P
Text R
IoU
F1
P
Image R
IoU
F1
P
Table R
IoU
F1
P
Formula R
IoU
F1
P
Full page R
IoU
F1
P
R
3.8B 79.5 89.1 87.6 90.8 86.6 93.0 93.9 92.2 68.5 83.2 78.2 88.7 91.6 95.5 95.9 95.2 71.3 84.8 82.5 87.3 88.3 93.8 94.8 92.9 1.2B 81.3 90.2 88.8 91.7 83.4 91.1 91.1 91.2 75.0 87.0 85.8 88.2 92.9 96.4 94.6 98.3 73.9 86.4 83.7 89.1 85.3 92.1 91.8 92.5 1.0B 83.4 91.2 91.5 91.0 87.0 93.2 94.2 92.2 74.2 86.5 86.2 86.7 94.1 97.0 96.3 97.7 78.2 88.3 89.2 87.4 87.9 93.6 95.0 92.3
Qianfan-OCR 4.7B 79.4 88.9 90.4 87.4 83.9 91.1 92.2 90.1 65.9 81.8 83.4 80.3 90.8 95.0 95.2 94.9 76.9 87.4 91.0 84.2 84.9 91.8 93.3 90.4 DeepSeek-OCR-2 3.4B 81.8 90.3 91.3 89.4 85.4 92.1 93.6 90.8 74.8 86.5 89.1 84.1 92.0 95.8 96.0 95.6 75.0 86.8 86.5 87.1 86.7 92.9 94.8 91.0 dots.ocr 3.0B 80.7 89.7 89.9 89.6 85.9 92.5 96.2 89.0 75.1 87.0 86.0 88.1 92.1 96.0 96.8 95.1 69.8 83.3 80.5 86.3 88.1 93.7 96.8 90.8 End-to-end HunyuanOCR 1.5 1.0B – – – – 51.9 71.8 74.0 69.8 – – – – – – – – – – – – – – – – MonkeyOCRv2-B-Parsing 0.7B 77.4 87.7 86.3 89.6 82.4 90.2 92.0 88.5 62.5 79.3 71.4 89.2 91.8 95.8 96.0 95.6 73.0 85.6 86.0 85.3 85.0 91.8 93.5 90.1 PaDoc (Ours) 2.1B 81.4 91.1 93.3 89.2 84.3 92.5 94.4 90.6 74.1 87.0 92.7 81.9 92.7 97.0 97.1 96.8 74.3 88.1 88.9 87.3 85.9 93.1 95.4 90.9
Table 1: Layout analysis on OmniDocBench using countable coverage and acceptable category matching. All metrics are percentages; Overall macro-averages text, image, table, and formula, with full-page coverage reported separately. Bold and underline mark the best and second-best values per paradigm.
available at its fork and attends only to this context and its own causal history. It can observe neither later layout predictions nor sibling contents, and cannot affect the continuing layout trajectory. In the logical fused form, an ancestor mask enforces these constraints so that live streams can be processed jointly and retired independently. Algorithm 1 in Appendix E.1 formalizes these semantics. Evaluated serving realization. The reported efficiency results use a request-level vLLM (Kwon et al. 2023) realization rather than physically materializing the fused ancestor mask. The layout stream and every content stream execute as independent generation requests in a shared serving runtime. Their request-specific causal contexts preserve the same branch isolation, while token-identical multimodal and layout prefixes allow automatic prefix caching to reuse complete key–value blocks that remain resident. Only the unreused suffix and branch initialization require additional prefill, and continuous batching overlaps live content requests with the continuing layout request. This realization requires neither a draft model nor auxiliary decoding heads. However, its wall-clock cost includes request admission, residual prefill, scheduling overhead, and imbalance among branches of unequal length. We therefore base all efficiency claims on measured throughput and end-to-end latency in the Serving Efficiency section. Appendix E.2 details the visibilityequivalent mapping.
Experiments We evaluate PaDoc along two complementary dimensions. First, we measure layout localization and end-to-end document parsing quality on OmniDocBench. Second, we evaluate serving efficiency under controlled concurrency on a single GPU. The main text reports the metrics that directly support these quality and efficiency claims; additional structural and system analyses are deferred to Appendix D.
Experimental Setup Benchmark. Quality evaluation uses all 1,651 pages of OmniDocBench v1.6 (Ouyang et al. 2024), which spans diverse document types, languages, layouts, and visual conditions. Serving efficiency uses a fixed 384-page subset ob-
tained by systematic uniform sampling and shared by all systems and concurrency settings. Each page provides layout regions, reading order, and region-level content annotations for text, formulas, tables, and figures. Training data. We curate approximately 11 million document-parsing samples from multiple open-source datasets, public academic and electronic documents, and inhouse collections, covering full pages and region-level table, formula, and text crops across diverse document types. The corpus is annotated by MinerU2.5-Pro (Wang et al. 2026), PaddleOCR-VL-1.5 (Cui et al. 2026), and MOCR (Zheng et al. 2026); cross-model agreement provides both highconfidence consensus annotations and a signal for difficultyaware sampling. To construct the SFT subset, we cluster ViT embeddings (Dosovitskiy et al. 2020), balance the data distribution, remove near-duplicates, and apply CLIP-similarityguided sampling across clusters to preserve visual diversity and long-tail cases, yielding a high-quality subset of approximately 0.5 million examples. Training recipe. We initialize PaDoc from Qwen3-VL2B (Bai et al. 2025), extending its vocabulary with specific control tokens and expanding the corresponding inputembedding and language-model-head dimensions. Training then proceeds in two stages. First, we perform continual pretraining (CPT) for one epoch on 11 million examples to adapt the original Qwen3-VL-2B model to document parsing. Second, we perform supervised fine-tuning (SFT) on this 0.5-million-example subset. Both stages use the next-token objective and ancestor-attention mask, a global batch size of 256, and a learning-rate schedule comprising 500 warmup steps followed by cosine decay from a peak of 5 × 10−6 . Training uses bf16 and FSDP across 128 A800 GPUs with a maximum sequence length of 16,384. The same-backbone sequential baseline used for the controlled efficiency comparison follows an identical training configuration and serializes all layout-content records into a single causal sequence. Comparison systems. Our specialized comparison pool is organized by inference paradigm. Two-stage systems include PaddleOCR-VL 1.5 (Cui et al. 2026), MinerU2.5Pro (Wang et al. 2026), Dolphin-v2 (Feng et al. 2026), and
Paradigm
Method
Size
Overall ↑
TextEdit ↓
FormulaCDM ↑
TableTEDS ↑
TableTEDS-S ↑
Read OrderEdit ↓
General VLMs
InternVL3.5-241B Qwen3-VL-235B Ovis2.6-30B-A3B Gemini 3 Pro Gemini 3 Flash GPT-5.2
241B 235B 30B – – –
83.61 89.78 93.62 92.85 92.58 86.52
0.130 0.063 0.035 0.064 0.066 0.114
89.52 92.53 94.93 95.83 95.03 88.00
74.35 83.07 89.44 89.15 89.29 82.95
79.78 86.75 92.40 92.96 93.51 87.93
0.215 0.166 0.135 0.165 0.173 0.193
Two-stage
Dolphin-v2 GLM-OCR MinerU2.5-Pro PaddleOCR-VL 1.5
3.8B 1.3B 1.2B 1.0B
89.34 95.15 95.69 94.87
0.069 0.044 0.036 0.038
90.53 96.99 97.29 96.69
84.40 92.83 93.42 91.67
87.44 95.39 95.92 94.37
0.150 0.133 0.120 0.130
End-to-end
Qianfan-OCR DeepSeek-OCR-2 dots.ocr HunyuanOCR 1.5 MonkeyOCRv2-B-Parsing PaDoc (Ours)
4.7B 3.4B 3.0B 1.0B 0.7B 2.1B
93.90 90.17 90.50 94.74 91.57 94.24
0.040 0.050 0.048 0.039 0.053 0.038
95.08 91.59 89.12 94.50 91.83 95.59
90.53 83.89 87.18 93.67 88.24 90.94
93.31 87.75 90.58 94.71 91.38 93.39
0.130 0.144 0.138 0.129 0.131 0.133
Table 2: End-to-end document parsing quality on OmniDocBench v1.6 Full. Where available, published external results are taken from MinerU2.5-Pro (Wang et al. 2026), HunyuanOCR-1.5 (Li et al. 2026), and MonkeyOCRv2 (Liu et al. 2026). Bold and underline mark the best and second-best values per paradigm.
GLM-OCR (Duan et al. 2026). End-to-end systems include dots.ocr (Li et al. 2025), Qianfan-OCR (Dong et al. 2026), MonkeyOCRv2-B-Parsing (Liu et al. 2026), DeepSeekOCR-2 (Wei, Sun, and Li 2026), and HunyuanOCR 1.5 (Li et al. 2026). For end-to-end parsing quality, we additionally report Ovis2.6-30B-A3B (Lu et al. 2026), Gemini 3 Pro, Gemini 3 Flash, Qwen3-VL-235B (Bai et al. 2025), GPT5.2, and InternVL3.5-241B (Wang et al. 2025), using the published OmniDocBench v1.6 Full results from MinerU2.5Pro (Wang et al. 2026). The same-backbone Sequential SFT baseline is used only for the controlled serving-efficiency comparison; external systems provide quality and efficiency context across model scales and parsing paradigms.
end-to-end group. Despite using a unified model, PaDoc remains competitive with specialized two-stage systems in Overall F1 while attaining the highest Overall precision in the table, indicating that layout-grounded branching preserves localization quality. For end-to-end parsing, Table 2 likewise places PaDoc in the top tier with an Overall score of 94.24, exceeding Qianfan-OCR by 0.34 points and the strongest evaluated general VLM by 0.62 points. It attains the best end-to-end Text Edit (0.038) and Formula CDM (95.59), while delivering strong Table TEDS/TEDS-S (90.94/93.39). These results demonstrate that parallel decoding preserves competitive quality across layout localization and regional content recognition.
Document Parsing Quality
Inference Efficiency
Evaluation Protocol. Following coverage-based layout evaluation (Niu et al. 2026), we report classwise IoU, F1, precision, and recall under our countable–acceptable PageIoU protocol; Appendix B specifies its category mapping and aggregation, and Appendix B.6 reports the remaining protocol variants. For end-to-end parsing, we use the OmniDocBench v1.6 protocol (Ouyang et al. 2024), reporting Text Edit, Formula CDM, Table TEDS/TEDS-S, Read Order Edit, and the standard Overall aggregate of text, table, and formula quality. All systems parse the same pages without ground-truth layouts, and cross-scale or cross-paradigm comparisons are contextual.
Evaluation Protocol. We serve the autoregressive component of every measured system with vLLM on one NVIDIA A800 80GB GPU, retaining the official layout detection, cropping, and post-processing stages of two-stage systems. A closed-loop load generator maintains 16, 32, 64, 128, or 256 concurrent document requests. Each model–concurrency setting runs on one isolated GPU replica; settings may run on different cluster nodes, but no request uses tensor parallelism or cross-node communication. Table 3 reports mean valid pages per second per GPU and P95 end-to-end latency over valid requests. Output-token throughput, additional latency percentiles, validity statistics, and full aggregation details are deferred to Appendix E.
Results. Table 1 shows that PaDoc achieves top-tier layout accuracy among end-to-end systems, with an Overall IoU/F1 of 81.4/91.1 and the highest Overall precision (93.3). Its advantage is particularly pronounced for structured regions, where it leads all four table metrics, including 92.7 IoU and 97.0 F1. It also ties the best image F1 (87.0) and obtains the best full-page F1 and recall (88.1 and 87.3) within the
Implementation Details. The PaDoc service uses vLLM 0.19.1 with the FlashInfer attention backend, bfloat16 precision for both model weights and the key–value cache, and one model replica per GPU without tensor parallelism. The layout stream and each content branch are submitted as independent requests to the same serving runtime; this evalu-
P95 latency (s)
Avg. Parsing Time (s/page)
Two-stage
C = 16 MonkeyOCR v2 Dolphin-v2 dots.ocr Sequential SFT Qianfan-OCR DeepSeek-OCR-2 HunyuanOCR 1.5 PaDoc (Ours) MinerU2.5-Pro PaddleOCR-1.5 GLM-OCR
4 3 2 1 0
C = 64 MonkeyOCR v2 Dolphin-v2 dots.ocr Sequential SFT Qianfan-OCR DeepSeek-OCR-2 HunyuanOCR 1.5 PaDoc (Ours) MinerU2.5-Pro PaddleOCR-1.5 GLM-OCR
3 2 1
MonkeyOCR v2 250 Dolphin-v2 DeepSeek-OCR-2 200 dots.ocr Qianfan-OCR 150 Sequential SFT HunyuanOCR 1.5 100 PaDoc (Ours) MinerU2.5-Pro 50 PaddleOCR-1.5 GLM-OCR
125 100 75 50 25 0
C = 32
4
0
1
2
3
4
5
C = 128 MonkeyOCR v2 Dolphin-v2 dots.ocr Sequential SFT Qianfan-OCR DeepSeek-OCR-2 HunyuanOCR 1.5 PaDoc (Ours) MinerU2.5-Pro PaddleOCR-1.5 GLM-OCR
3
2
1
MonkeyOCR v2 400 Dolphin-v2 DeepSeek-OCR-2 dots.ocr 300 Sequential SFT Qianfan-OCR 200 HunyuanOCR 1.5 PaDoc (Ours) MinerU2.5-Pro 100 PaddleOCR-1.5 GLM-OCR
0
1
Model size (B)
2
3
4
5
0
3
2
1
MonkeyOCR v2 Dolphin-v2 DeepSeek-OCR-2600 dots.ocr Sequential SFT 400 Qianfan-OCR HunyuanOCR 1.5 PaDoc (Ours) 200 MinerU2.5-Pro PaddleOCR-1.5 GLM-OCR
0
Model size (B)
1
2
3
4
0
5
End-to-end
C = 256 MonkeyOCR v2 Dolphin-v2 dots.ocr Sequential SFT Qianfan-OCR DeepSeek-OCR-2 HunyuanOCR 1.5 PaDoc (Ours) MinerU2.5-Pro PaddleOCR-1.5 GLM-OCR
MonkeyOCR v2 Dolphin-v2 dots.ocr Sequential SFT Qianfan-OCR DeepSeek-OCR-2 HunyuanOCR 1.5 PaDoc (Ours) MinerU2.5-Pro PaddleOCR-1.5 GLM-OCR
3
2
1
MonkeyOCR v2 800 Dolphin-v2 Sequential SFT dots.ocr 600 Qianfan-OCR DeepSeek-OCR-2 400 HunyuanOCR 1.5 PaDoc (Ours) MinerU2.5-Pro 200 PaddleOCR-1.5 GLM-OCR
0
Model size (B)
1
2
3
4
5
MonkeyOCR v2 Dolphin-v2 dots.ocr Sequential SFT Qianfan-OCR DeepSeek-OCR-2 HunyuanOCR 1.5 PaDoc (Ours) MinerU2.5-Pro PaddleOCR-1.5 GLM-OCR
0
1
Model size (B)
2
3
4
5
Model size (B)
Figure 2: Serving efficiency across five concurrency levels on one A800 GPU. Each point denotes a system positioned by model size, with colors distinguishing two-stage and end-to-end parsers; the top and bottom rows report mean parsing time and P95 end-to-end latency, respectively. PaDoc attains the lowest mean parsing time and P95 latency among end-to-end parsers at every concurrency level, and approaches compact two-stage systems despite using a larger model. Paradigm
Two-stage
End-to-end
Method
Size
Mean valid pages per second per GPU ↑
P95 E2E latency (s) ↓
C16
C32
C64
C128
C256
C16
C32
C64
C128
C256
Dolphin-v2 GLM-OCR MinerU2.5-Pro PaddleOCR-VL 1.5
3.8B 1.3B 1.2B 1.0B
0.496 3.009 2.406 2.560
0.501 3.248 2.392 2.727
0.511 3.323 2.275 2.701
0.493 3.289 2.274 2.692
0.494 3.280 2.335 2.691
82.756 10.977 13.872 11.219
189.176 22.750 27.644 25.537
240.183 32.341 43.020 40.151
426.346 49.473 66.427 62.861
751.033 83.669 106.966 99.979
Qianfan-OCR DeepSeek-OCR-2 dots.ocr HunyuanOCR 1.5 MonkeyOCRv2-B-Parsing
4.7B 3.4B 3.0B 1.0B 0.7B
0.844 0.885 0.705 1.560 0.246
1.017 1.078 0.808 1.662 0.269
1.184 1.287 0.872 1.703 0.318
1.238 1.479 0.857 1.661 0.303
1.193 1.499 0.881 1.645 0.315
48.856 71.969 50.387 31.304 133.965
80.313 107.803 92.664 66.284 249.574
104.076 154.397 151.081 86.408 404.335
169.998 163.577 257.744 135.388 689.949
231.610 216.016 412.459 199.034 787.126
Sequential SFT (Baseline)
2.1B
PaDoc (Ours)
2.1B
0.751 1.640
0.814 1.711
0.879 1.722
0.904 1.684
1.015 1.699
42.610 22.847
83.176 49.125
141.042 70.659
263.247 118.808
319.337 194.018
(+118%)
(+110%)
(+95.9%)
(+86.3%)
(+67.4%)
(-46.4%)
(-40.9%)
(-49.9%)
(-54.9%)
(-39.2%)
Table 3: Single-A800 serving efficiency; C16, for example, denotes 16 concurrent document requests. Green parentheses show changes from Sequential SFT; Appendix E reports additional metrics. Bold/underline: best/second-best per paradigm.
ated backend does not materialize the logical ancestor mask. The runtime supports sequences of up to 32,768 tokens and processes at most 384 sequences in each scheduling iteration, subject to a per-iteration budget of 24,576 tokens. It reserves 90% of the GPU memory for model execution. Both the layout stream and each content branch have an 8,192-token generation limit, and a document may instantiate at most 255 content branches. Automatic prefix caching is enabled, whereas speculative decoding and optional cascade-attention modifications are disabled. We retain per-request latency, scheduler state, and GPU telemetry traces for all runs. Results. Across every tested concurrency, PaDoc has the highest valid-page throughput and lowest P95 latency among end-to-end parsers. Relative to the same-backbone Sequential SFT baseline, it improves throughput by 67.4–118% and reduces P95 latency by 39.2–54.9%. Its throughput reaches 1.722 pages per second per GPU at 64 concurrent requests and remains near this level at higher concurrency. Despite using 2.1B parameters, PaDoc consistently surpasses the 1.0B HunyuanOCR 1.5 in both efficiency metrics and substantially outpaces the 0.7B MonkeyOCRv2-B-Parsing. Figure 2 fur-
ther shows that it approaches compact 1.0–1.3B two-stage systems, indicating that the proposed parallelism remains effective at a larger model scale. Cross-architecture comparisons remain contextual, while the same-backbone comparison isolates the effect of parallel decoding. Appendix D provides additional efficiency analyses.
Conclusion We presented PaDoc, a layout-grounded document parser that factorizes regional content generation under a shared page-image and layout prefix, exposing region-level parallelism without repeated visual prefills. Packed variablelength ancestor attention trains this factorization with a standard next-token objective, while concurrent serving reuses shared prefixes. On one A800 GPU, PaDoc is the fastest end-to-end parser at every tested concurrency level, improving throughput by 67.4–118% and reducing P95 latency by 39.2–54.9% relative to the same-backbone Sequential SFT baseline. Despite its 2.1B size, it also surpasses the 1.0B HunyuanOCR-1.5, demonstrating that layout-grounded parallelism can substantially reduce serving cost without modifying the MLLM architecture.
References Bai, S.; Cai, Y.; Chen, R.; Chen, K.; Chen, X.; Cheng, Z.; Deng, L.; Ding, W.; Gao, C.; Ge, C.; Ge, W.; Guo, Z.; Huang, Q.; Huang, J.; Huang, F.; Hui, B.; Jiang, S.; Li, Z.; Li, M.; Li, M.; Li, K.; Lin, Z.; Lin, J.; Liu, X.; Liu, J.; Liu, C.; Liu, Y.; Liu, D.; Liu, S.; Lu, D.; Luo, R.; Lv, C.; Men, R.; Meng, L.; Ren, X.; Ren, X.; Song, S.; Sun, Y.; Tang, J.; Tu, J.; Wan, J.; Wang, P.; Wang, P.; Wang, Q.; Wang, Y.; Xie, T.; Xu, Y.; Xu, H.; Xu, J.; Yang, Z.; Yang, M.; Yang, J.; Yang, A.; Yu, B.; Zhang, F.; Zhang, H.; Zhang, X.; Zheng, B.; Zhong, H.; Zhou, J.; Zhou, F.; Zhou, J.; Zhu, Y.; and Zhu, K. 2025. Qwen3-VL Technical Report. arXiv preprint arXiv: 2511.21631. Biju, E.; Talaei, S.; Huang, Z.; Pourreza, M.; Mirhoseini, A.; and Saberi, A. 2026. Sprint: Enabling interleaved planning and parallelized execution in reasoning models. Advances in Neural Information Processing Systems, 38: 96393–96433. Blecher, L.; Cucurull Preixens, G.; Scialom, T.; and Stojnic, R. 2024. Nougat: Neural optical understanding for academic documents. In International Conference on Learning Representations, volume 2024, 37646–37663. Cai, T.; Li, Y.; Geng, Z.; Peng, H.; Lee, J. D.; Chen, D.; and Dao, T. 2024. Medusa: Simple llm inference acceleration framework with multiple decoding heads. arXiv preprint arXiv:2401.10774. Chen, K.; Shen, Z.; Yu, D.; Wu, H.; Wen, W.; He, J.; Qiao, R.; and Sun, X. 2025. Aspd: Unlocking adaptive serial-parallel decoding by exploring intrinsic parallelism in llms. arXiv preprint arXiv:2508.08895. Cui, C.; Sun, T.; Liang, S.; Gao, T.; Zhang, Z.; Liu, J.; Wang, X.; Zhou, C.; Liu, H.; Lin, M.; et al. 2026. PaddleOCR-VL1.5: Towards a Multi-Task 0.9 B VLM for Robust In-the-Wild Document Parsing. arXiv preprint arXiv:2601.21957. Dobrushin, R. L. 1963. General formulation of Shannon’s main theorem in information theory. American mathematical society translations, 33: 323–438. Dong, D.; Zheng, M.; Xu, D.; Luo, C.; Zhuang, B.; Li, Y.; He, R.; Wang, H.; Zhang, W.; Wang, W.; et al. 2026. QianfanOCR: A Unified End-to-End Model for Document Intelligence. arXiv preprint arXiv:2603.13398. Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. 2020. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929. Duan, S.; Xue, Y.; Wang, W.; Su, Z.; Liu, H.; Yang, S.; Gan, G.; Wang, G.; Wang, Z.; Yan, S.; Jin, D.; Zhang, Y.; Wen, G.; Wang, Y.; Zhang, Y.; Zhang, X.; Hong, W.; Cen, Y.; Yin, D.; Chen, B.; Yu, W.; Gu, X.; and Tang, J. 2026. GLM-OCR Technical Report. arXiv preprint arXiv: 2603.10910. Feng, H.; Shi, W.; Zhang, K.; Fei, X.; Liao, L.; Yang, D.; Du, Y.; Wu, X.; Tang, J.; Liu, Y.; et al. 2026. Dolphin-v2: Universal Document Parsing via Scalable Anchor Prompting. arXiv preprint arXiv:2602.05384. Feng, H.; Wei, S.; Fei, X.; Shi, W.; Han, Y.; Liao, L.; Lu, J.; Wu, B.; Liu, Q.; Lin, C.; et al. 2025. Dolphin: Document
image parsing via heterogeneous anchor prompting. In Findings of the Association for Computational Linguistics: ACL 2025, 21919–21936. Jin, T.; Cheng, E. Y.; Ankner, Z.; Saunshi, N.; Elias, B. M.; Yazdanbakhsh, A.; Ragan-Kelley, J.; Subramanian, S.; and Carbin, M. 2025. Learning to keep a promise: Scaling language model decoding parallelism with learned asynchronous decoding. arXiv preprint arXiv:2502.11517. Kim, G.; Hong, T.; Yim, M.; Nam, J.; Park, J.; Yim, J.; Hwang, W.; Yun, S.; Han, D.; and Park, S. 2022. OCRFree Document Understanding Transformer. In European Conference on Computer Vision (ECCV). Kwon, W.; Li, Z.; Zhuang, S.; Sheng, Y.; Zheng, L.; Yu, C. H.; Gonzalez, J.; Zhang, H.; and Stoica, I. 2023. Efficient memory management for large language model serving with pagedattention. In Proceedings of the 29th symposium on operating systems principles, 611–626. Lee, K.; Joshi, M.; Turc, I. R.; Hu, H.; Liu, F.; Eisenschlos, J. M.; Khandelwal, U.; Shaw, P.; Chang, M.-W.; and Toutanova, K. 2023. Pix2struct: Screenshot parsing as pretraining for visual language understanding. In International Conference on Machine Learning, 18893–18912. PMLR. Leviathan, Y.; Kalman, M.; and Matias, Y. 2023. Fast inference from transformers via speculative decoding. In International Conference on Machine Learning, 19274–19286. PMLR. Li, G.; Wan, X.; Peng, S.; Wang, W.; Feng, H.; Du, Y.; Wu, B.; Ruan, Z.; Lu, Z.; Wu, L.; et al. 2026. HunyuanOCR-1.5: Making Lightweight OCR VLMs Faster and Better. arXiv preprint arXiv:2607.04884. Li, Y.; Wei, F.; Zhang, C.; and Zhang, H. 2024. Eagle: Speculative sampling requires rethinking feature uncertainty. arXiv preprint arXiv:2401.15077. Li, Y.; Yang, G.; Liu, H.; Wang, B.; and Zhang, C. 2025. dots.ocr: Multilingual Document Layout Parsing in a Single Vision-Language Model. arXiv preprint arXiv: 2512.02498. Liao, W.; Li, H.; Xie, P.; Cai, X.; Shen, Y.; Xin, Y.; Qin, Q.; Ye, S.; Li, T.; Hu, M.; et al. 2026. HSD: Training-Free Acceleration for Document Parsing Vision-Language Model with Hierarchical Speculative Decoding. arXiv preprint arXiv:2602.12957. Liu, M.; Zeng, A.; Wang, B.; Zhang, P.; Tang, J.; and Dong, Y. 2024. APAR: LLMs Can Do Auto-Parallel Auto-Regressive Decoding. arXiv preprint arXiv: 2401.06761. Liu, Y.; Zhang, J.; Peng, D.; Huang, M.; Wang, X.; Tang, J.; Huang, C.; Lin, D.; Shen, C.; Bai, X.; et al. 2023. Spts v2: single-point scene text spotting. IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(12): 15665– 15679. Liu, Y.; Zhang, L.; Zhang, Z.; Zhang, S.; Liu, Q.; Song, J.; Guo, Z.; Wang, X.; Zheng, H.; Liu, Y.; et al. 2026. MonkeyOCRv2: A Visual-Text Foundation Model for Document AI. arXiv preprint arXiv:2607.11562. Lu, S.; Li, Y.; Xia, Y.; Chen, Y.; Ji, A.-Y.; Jiang, J.-P.; Chen, Q.-G.; Zhao, J.; Lin, E.; Li, H.; Qin, C.; Xu, Z.; and Luo, W. 2026. OvisOCR2 Technical Report. arXiv preprint arXiv: 2607.13639.
Nassar, A.; Omenetti, M.; Lysak, M.; Livathinos, N.; Auer, C.; Morin, L.; de Lima, R. T.; Kim, Y.; Gurbuz, A. S.; Dolfi, M.; et al. 2025. SmolDocling: An ultra-compact visionlanguage model for end-to-end multi-modal document conversion. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 21972–21983. Ning, X.; Lin, Z.; Zhou, Z.; Wang, Z.; Yang, H.; and Wang, Y. 2024. Skeleton-of-thought: Prompting llms for efficient parallel generation. In International Conference on Learning Representations, volume 2024, 917–967. Niu, J.; Liu, Z.; Gu, Z.; Wang, B.; Ouyang, L.; Zhao, Z.; Chu, T.; He, T.; Wu, F.; Zhang, Q.; et al. 2026. Mineru2. 5: A decoupled vision-language model for efficient high-resolution document parsing. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (ACL 2026), 13–42. Ouyang, L.; Qu, Y.; Zhou, H.; Zhu, J.; Zhang, R.; Lin, Q.; Wang, B.; Zhao, Z.; Jiang, M.; Zhao, X.; Shi, J.; Wu, F.; Chu, P.; Liu, M.; Li, Z.; Xu, C.; Zhang, B.; Shi, B.; Tu, Z.; and He, C. 2024. OmniDocBench: Benchmarking Diverse PDF Document Parsing with Comprehensive Annotations. arXiv preprint arXiv: 2412.07626. Poznanski, J.; Rangapur, A.; Borchardt, J.; Dunkelberger, J.; Huff, R.; Lin, D.; Wilhelm, C.; Lo, K.; and Soldaini, L. 2025. olmocr: Unlocking trillions of tokens in pdfs with vision language models. arXiv preprint arXiv:2502.18443. Rodionov, G.; Garipov, R.; Shutova, A.; Yakushev, G.; Schultheis, E.; Egiazarian, V.; Sinitsin, A.; Kuznedelev, D.; and Alistarh, D. 2026. Hogwild! inference: Parallel llm generation via concurrent attention. Advances in Neural Information Processing Systems, 38: 46592–46633. Sun, T.; Cui, C.; Du, Y.; and Liu, Y. 2025. PP-DocLayout: A unified document layout detection model to accelerate largescale data construction. arXiv preprint arXiv:2503.17213. Wang, B.; He, T.; Ouyang, L.; Wu, F.; Zhao, Z.; Chu, T.; Qu, Y.; Jin, Z.; Zeng, W.; Miao, Z.; et al. 2026. MinerU2. 5-Pro: Pushing the limits of data-centric document parsing at scale. arXiv preprint arXiv:2604.04771. Wang, W.; Gao, Z.; Gu, L.; Pu, H.; Cui, L.; Wei, X.; Liu, Z.; Jing, L.; Ye, S.; Shao, J.; Wang, Z.; Chen, Z.; Zhang, H.; Yang, G.; Wang, H.; Wei, Q.; Yin, J.; Li, W.; Cui, E.; Chen, G.; Ding, Z.; Tian, C.; Wu, Z.; Xie, J.; Li, Z.; Yang, B.; Duan, Y.; Wang, X.; Hou, Z.; Hao, H.; Zhang, T.; Li, S.; Zhao, X.; Duan, H.; Deng, N.; Fu, B.; He, Y.; Wang, Y.; He, C.; Shi, B.; He, J.; Xiong, Y.; Lv, H.; Wu, L.; Shao, W.; Zhang, K.; Deng, H.; Qi, B.; Ge, J.; Guo, Q.; Zhang, W.; Zhang, S.; Cao, M.; Lin, J.; Tang, K.; Gao, J.; Huang, H.; Gu, Y.; Lyu, C.; Tang, H.; Wang, R.; Lv, H.; Ouyang, W.; Wang, L.; Dou, M.; Zhu, X.; Lu, T.; Lin, D.; Dai, J.; Su, W.; Zhou, B.; Chen, K.; Qiao, Y.; Wang, W.; and Luo, G. 2025. InternVL3.5: Advancing Open-Source Multimodal Models in Versatility, Reasoning, and Efficiency. arXiv preprint arXiv: 2508.18265. Wei, H.; Sun, Y.; and Li, Y. 2026. DeepSeek-OCR 2: Visual Causal Flow. arXiv preprint arXiv: 2601.20552. Wyner, A. D. 1978. A definition of conditional mutual information for arbitrary ensembles. Information and Control, 38(1): 51–59.
Yao, J.; Chen, K.; Zhang, K.; You, J.; Yuan, B.; Wang, Z.; and Lin, T. 2025. Deft: Decoding with flash tree-attention for efficient tree-structured llm inference. In International Conference on Learning Representations, volume 2025, 66657– 66688. Zhao, Z.; Kang, H.; Wang, B.; and He, C. 2024. Doclayoutyolo: Enhancing document layout analysis through diverse synthetic data and global-to-local adaptive perception. arXiv preprint arXiv:2410.12628. Zheng, H.; Li, Y.; Zhang, K.; Xin, L.; Zhao, G.; Liu, H.; Chen, J.; Lou, J.; Fu, Q.; Yang, R.; et al. 2026. Multimodal OCR: Parse anything from documents. arXiv preprint arXiv:2603.13032. Zhu, W.; Sokhandan, N.; Yang, G.; Martin, S.; and Sathyanarayana, S. 2022. DocBed: A multi-stage OCR solution for documents with complex layouts. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, 12643–12649.
A A.1
Derivations
From Region-Specific Sufficiency to Prefix-Conditioned Sufficiency
We provide a derivation of the implication used in the main text: Assumption 1 (region-specific content sufficiency), I(Yk ; B<k , B>k , Y<k | X, Bk ) = 0,
(17)
implies the prefix-conditioned form I(Yk ; B>k , Y<k | X, B≤k ) = 0.
(18)
The argument relies on the chain rule of conditional mutual information. For any random variables A, B, C and conditioning Z, I(A; B, C | Z) = I(A; C | Z) + I(A; B | Z, C).
(19)
Applying this with A = Yk , B = (B>k , Y<k ), C = B<k , Z = (X, Bk ) gives I(Yk ; B<k , B>k , Y<k | X, Bk ) = I(Yk ; B<k | X, Bk ) + I(Yk ; B>k , Y<k | X, Bk , B<k ).
common set of broad classes and split the ground-truth taxonomy into core include categories and ambiguous acceptable categories. The metric compares coverage over the complete page without one-to-one box matching or an IoU threshold. It also separates binary coverage from countable coverage, the latter retaining overlapping-box multiplicity. We deliberately do not use a strict hard-matching mode: such a score would penalize semantically valid outputs merely because two parsers name or group regions differently.
(20)
B.1
Coverage Representation
For every page, ground-truth and prediction coordinates are independently normalized by their respective canvas width and height, giving the common domain Ω = [0, 1]2 . OmniDocBench quadrilaterals are converted to axis-aligned rectangles using their minimum and maximum coordinates. q For broad class q, let Ginc be the ground-truth rectangles q whose categories are core members of q, Gacc those with acq ceptable categories, and P the predicted rectangles mapped to q. Their pointwise coverage counts are X aq (z) = 1[z ∈ r], q r∈Ginc
Since the conditioning (X, Bk , B<k ) is identical, as a tuple, to (X, B≤k ), this becomes
bq (z) =
I(Yk ; B<k , B>k , Y<k | X, Bk ) = I(Yk ; B<k | X, Bk ) + I(Yk ; B>k , Y<k | X, B≤k ).
cq (z) =
I(Yk ; B>k , Y<k | X, B≤k ) = 0,
(22)
which is the prefix-conditioned form used by PaDoc. The same statement, expressed in conditionalindependence notation, is exactly the weak-union property: Yk ⊥ ⊥ (B<k , B>k , Y<k ) | X, Bk =⇒ Yk ⊥ ⊥ (B>k , Y<k ) | X, B≤k .
Note that the converse direction does not hold in general: the prefix-conditioned form does not, by itself, recover the full region-specific form, because it does not constrain the dependence of Yk on B<k given (X, Bk ). This is why PaDoc only requires the strictly weaker prefix-conditioned consequence.
B
Details of PageIoU
Inspired by the coverage-based layout evaluation in MinerU2.5 (Niu et al. 2026), we define a PageIoU protocol tailored to fair cross-model comparison rather than directly adopting their metric. Document parsers use heterogeneous category inventories and may assign the same region to categories at different levels of granularity. A hard category correspondence can therefore conflate taxonomy mismatch with localization error. We instead map predictions into a
X
(24)
1[z ∈ r].
r∈P q
Include and acceptable sets are disjoint at the category level, although their rectangles may overlap spatially. In binary mode, the three counts are clipped pointwise, (aq , bq , cq ) ← (min{aq , 1}, min{bq , 1}, min{cq , 1}), (25) so only the union of the boxes in each group matters. In countable mode, the original counts are retained, which penalizes duplicate or overlapping predictions. We omit q below and R write ⟨f ⟩ = Ω f (z) dz for area-weighted summation over the page.
B.2 (23)
1[z ∈ r],
q r∈Gacc
(21)
Conditional mutual information is non-negative, so each term on the right-hand side is at least zero. Since the left-hand side is zero by assumption, both terms on the right-hand side must vanish. In particular,
X
Soft Category Modes
Each category mode defines an intersection I, union U , and separate ground-truth and prediction denominators Dgt and Dpr . Acceptable. Acceptable coverage is elastic: it is credited when predicted but does not create a false negative when omitted. Pointwise, the effective ground-truth coverage can take any value from a to a + b and is selected to be as consistent with c as that interval permits: Iacc = ⟨min{a + b, c}⟩, Uacc = ⟨max{a, c}⟩, (26) acc Dgt = ⟨max{a, min{a + b, c}}⟩ , acc Dpr = ⟨c⟩. Consequently, predicting up to the available acceptable coverage is rewarded in the intersection, while unpredicted acceptable coverage is absent from the union and recall denominator.
Ignore acceptable. As a robustness protocol, this mode removes locations covered exclusively by acceptable groundtruth regions from the IoU computation. Define 0, a = 0 and b > 0, (27) uign (a, b, c) = max{a, c}, otherwise. The resulting area sums are Iign = ⟨min{a, c}⟩, Uign = ⟨uign (a, b, c)⟩, (28)
ign Dgt = ⟨a⟩, ign Dpr = ⟨c − min{max{c − a, 0}, b}⟩ .
The prediction denominator pardons at most b units of prediction coverage beyond the core coverage a. If include and acceptable rectangles overlap spatially, that location is not exclusively acceptable and remains in the IoU union. This distinction is visible only in countable mode and preserves its penalty for overlapping coverage.
B.3
Per-Page Metrics and Aggregation
Assuming 0 ≤ x ≤ y, as guaranteed by the metric constructions above, we define a ratio that treats agreement on an empty support as perfect, 1, y = 0, ρ(x, y) = (29) x/y, y > 0. For every page, class, category mode, and count mode, the metrics are IoU = ρ(I, U ), Precision = ρ(I, Dpr ), (30) Recall = ρ(I, Dgt ). A page is a support page for class q if it contains at least one include box, acceptable box, or mapped prediction for that class. Pages with none of the three are omitted. If Sq is the support-page set and mpq is a per-page metric, its reported value is the page-level macro average 1 X mpq . (31) mq = |Sq | p∈Sq
This prevents pages with large canvases or regions from dominating the score. The reported F1 is derived from macroaveraged precision and recall, F1q =
2P q Rq , P q + Rq
Exact Computation
The default backend computes all area sums exactly for axisaligned rectangles using coordinate compression. It collects 0, 1, and every horizontal and vertical boundary from the include, acceptable, and prediction boxes. These coordinates partition Ω into rectangular cells on which a, b, and c are constant. A two-dimensional difference array followed by prefix sums computes the coverage counts, and each cell contributes its exact area ∆x∆y to the equations above. Boxes are clipped to Ω before the partition is constructed. We additionally implement a raster backend as a numerical cross-check. It rounds normalized box boundaries onto a configurable grid, set to 1000 × 1000 for OmniDocBench, and applies the same equations pixel by pixel. The raster resolution affects only this checking backend; all reported results use coordinate-compressed exact areas. Pages are aligned by image basename, and a missing prediction page is evaluated as an empty layout.
B.6
Additional PageIoU Results
Tables 5–7 report the three protocols not used for the headline layout results. They use the same per-class IoU, F1, precision, and recall reporting and the same Overall macro-aggregation as Table 1.
C
Ablations of the Training Paradigm
The ancestor-attention objective in the Training Paradigm section admits several systems realizations. They expose the same token visibility and optimize the same next-token objective, but differ in how they represent and execute the sparse attention pattern. This appendix defines the three backends we compared and reports their memory, single-node efficiency, and multi-node scaling. The comparison is an implementation ablation rather than a change to the probabilistic factorization or training targets.
C.1
Attention Backends
Let a packed sample be [M | Y1 | · · · | YN ], where M contains the shared image and layout stream, and let M≤fk be the prefix visible at the fork of branch Yk . The desired attention consists of one causal problem for M and one causal problem per branch, QM → KM ,
QYk → [KM≤fk ; KYk ].
(33)
The three backends implement this same relation as follows. (32)
and is set to zero when both aggregated values are zero. The primary result in Table 1 uses countable coverage with acceptable category handling. This choice preserves tolerance to category ambiguity while penalizing overlapping predictions. The remaining three binary/countable and acceptable/ignore-acceptable combinations are reported in Section B.6.
B.4
B.5
Category Mapping
Table 4 specifies the soft mapping from OmniDocBench ground-truth categories to the five evaluation classes.
Dense SDPA. Our original implementation materializes a Boolean mask of shape B × S × S during collation and dispatches it through PyTorch scaled dot-product attention (SDPA). This representation is simple and serves as the reference implementation, but its arbitrary two-dimensional mask prevents the text layers from using the standard causal FlashAttention-2 path. Its mask storage and construction also grow quadratically with the padded sequence length. Flex Attention. The block-sparse baseline expresses the same ancestor relation as a compiled block mask for PyTorch Flex Attention. It can skip fully masked query–key blocks without constructing the dense mask, but introduces
Category
Text
Table
Formula
Image
Full page
Text block Title Reference List group Code text Code-text caption Header Footer Page number Page footnote Table caption Table footnote Figure caption Figure footnote Equation caption Algorithm mask Text mask Table Table mask Isolated equation Semantic equation Equation explanation Organic chemical formula mask Figure Chart mask Abandon Need mask Unknown mask
✓ ✓ ✓ ✓ ✓ ✓ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ − − − − − − − − − − −
− − − − − − − − − − ◦ ◦ − − − − − ✓ ◦ − − − − − − − − −
− − − − − − − − − − − − − − ◦ − − − − ✓ ◦ ◦ ◦ − − − − −
− − − − − − − − − − − − ◦ ◦ − − − − − − − − ◦ ✓ ◦ − − −
✓ ✓ ✓ ✓ ✓ ✓ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ◦ ✓ ◦ ✓ ◦ ◦ ◦ ✓ ◦ ◦ ◦ ◦
Table 4: OmniDocBench ground-truth category mapping used by PageIoU. Category names are presented with spaces and conventional capitalization for readability. ✓ denotes an include category, ◦ denotes an acceptable category, and a dash denotes no membership. Full page aggregates content-region coverage rather than denoting a single page-sized rectangle. Paradigm Method
Overall
Size IoU
Two-stage
Dolphin-v2 MinerU2.5-Pro PaddleOCR-VL 1.5
F1
P
Text R
IoU
F1
P
Image R
IoU
F1
Table
P
R
IoU
F1
P
Formula R
IoU
F1
P
Full page R
IoU
F1
P
R
3.8B 79.7 89.2 87.7 91.0 87.3 93.4 93.9 92.8 68.6 83.2 78.3 88.7 91.6 95.5 95.9 95.2 71.3 84.9 82.5 87.3 88.9 94.2 94.9 93.5 1.2B 82.3 90.8 89.9 91.8 87.2 93.3 95.3 91.4 75.1 87.0 85.9 88.2 92.9 96.4 94.6 98.3 73.9 86.4 83.8 89.2 88.9 94.2 95.6 92.8 1.0B 83.6 91.4 91.5 91.2 87.7 93.6 94.3 92.9 74.3 86.5 86.3 86.7 94.1 97.0 96.3 97.7 78.2 88.3 89.3 87.4 88.6 94.0 95.2 92.9
Qianfan-OCR 4.7B 79.6 89.0 90.5 87.6 84.6 91.6 92.4 90.8 65.9 81.9 83.5 80.3 90.8 95.0 95.2 94.9 76.9 87.5 91.0 84.2 85.9 92.4 93.8 91.0 DeepSeek-OCR-2 3.4B 82.0 90.4 91.3 89.5 86.0 92.5 93.7 91.4 74.9 86.6 89.2 84.1 92.0 95.8 96.0 95.6 75.0 86.8 86.5 87.1 87.4 93.3 95.0 91.6 dots.ocr 3.0B 80.9 89.8 89.9 89.8 86.5 92.9 96.4 89.6 75.2 87.0 86.0 88.1 92.1 96.0 96.8 95.1 69.8 83.3 80.5 86.3 88.7 94.1 97.0 91.3 End-to-end HunyuanOCR 1.5 1.0B – – – – 53.0 72.7 75.3 70.2 – – – – – – – – – – – – – – – – MonkeyOCRv2-B-Parsing 0.7B 77.6 87.8 86.3 89.8 83.0 90.6 92.1 89.1 62.6 79.3 71.4 89.2 91.8 95.8 96.0 95.6 73.0 85.7 86.0 85.4 85.7 92.1 93.6 90.7 PaDoc (Ours) 2.1B 82.1 91.5 94.1 89.2 86.7 93.9 97.1 90.9 74.5 87.1 93.0 81.9 92.8 97.0 97.2 96.8 74.5 88.2 89.0 87.3 88.2 94.4 97.8 91.3
Table 5: Layout analysis on OmniDocBench using binary coverage and acceptable category matching. All metrics are percentages; Overall macro-averages text, image, table, and formula, with full-page coverage reported separately. Bold and underline mark the best and second-best values per paradigm.
graph-compilation and block-scheduling overhead. The first optimizer step is particularly costly because it includes compilation; we exclude that cold step from all steady-state timing comparisons. Tree-varlen (ours). We decompose the packed tree into the variable-length causal problems above and execute them with the FlashAttention-2 varlen kernel. Queries and Q/K/V projections are computed once in the original packed order. For each branch, we gather only the already-projected K/V rows corresponding to its visible shared prefix and private causal history. The backward pass of the gather sums
gradients from all branches into the original shared-prefix rows. Branch outputs are scattered back to the packed order. FlashAttention’s bottom-right causal alignment makes a branch query of length |Yk | see the full prefix and only nonfuture tokens in Yk . The gather indices and temporary K/V tensors scale with the concatenated varlen K/V rows rather than a materialized S × S mask.
C.2
Experimental Protocol
We benchmark the Qwen3-VL-2B backbone used in the main experiments. To isolate the decoder attention backend, all configurations use a frozen vision encoder, bf16, FSDP
Paradigm Method
Overall
Size IoU
Two-stage
Dolphin-v2 MinerU2.5-Pro PaddleOCR-VL 1.5
F1
P
Text R
IoU
F1
P
Image R
IoU
F1
Table
P
R
IoU
F1
P
Formula R
IoU
F1
P
Full page R
IoU
F1
P
R
3.8B 77.6 88.0 85.7 90.6 80.9 89.8 88.0 91.6 68.0 82.8 77.7 88.7 91.0 95.2 95.3 95.2 70.5 84.4 81.9 87.0 87.7 93.5 94.4 92.7 1.2B 79.5 89.2 87.1 91.4 77.8 87.9 85.6 90.5 74.2 86.5 85.1 87.9 92.6 96.2 94.3 98.3 73.2 86.0 83.2 88.9 84.9 91.9 91.5 92.2 1.0B 81.5 90.2 89.7 90.8 81.2 90.1 88.6 91.7 73.6 86.2 85.6 86.7 93.2 96.6 95.5 97.7 77.8 88.1 89.1 87.1 87.5 93.4 94.8 92.0
Qianfan-OCR 4.7B 77.3 87.8 88.5 87.2 78.0 87.9 86.3 89.6 65.2 81.6 82.8 80.3 89.6 94.4 94.0 94.9 76.4 87.2 90.8 83.9 84.4 91.5 92.9 90.1 DeepSeek-OCR-2 3.4B 80.0 89.4 89.6 89.2 80.8 89.8 89.2 90.4 74.2 86.2 88.5 84.1 90.9 95.3 95.0 95.6 74.3 86.4 86.0 86.8 86.4 92.7 94.6 90.9 dots.ocr 3.0B 78.8 88.7 88.1 89.3 80.1 89.5 90.7 88.3 74.8 86.8 85.6 88.1 91.4 95.7 96.2 95.1 69.0 82.8 79.9 85.9 87.7 93.4 96.6 90.5 End-to-end HunyuanOCR 1.5 1.0B – – – – 49.4 70.0 71.8 68.3 – – – – – – – – – – – – – – – – MonkeyOCRv2-B-Parsing 0.7B 75.5 86.7 84.5 89.4 76.8 87.1 86.5 87.8 62.2 79.1 71.0 89.2 90.9 95.3 95.1 95.6 72.2 85.1 85.4 84.9 84.5 91.4 93.1 89.7 PaDoc (Ours) 2.1B 79.3 89.9 91.1 88.9 78.5 89.2 88.6 89.9 73.6 86.7 92.1 81.9 91.5 96.0 95.3 96.8 73.7 87.7 88.4 86.9 85.5 92.8 95.0 90.6
Table 6: Layout analysis on OmniDocBench using countable coverage and ignore-acceptable category matching. All metrics are percentages; Overall macro-averages text, image, table, and formula, with full-page coverage reported separately. Bold and underline mark the best and second-best values per paradigm. Paradigm Method
Overall
Size IoU
Two-stage
Dolphin-v2 MinerU2.5-Pro PaddleOCR-VL 1.5
F1
P
Text R
IoU
F1
P
Image R
IoU
F1
Table
P
R
IoU
F1
P
Formula R
IoU
F1
P
Full page R
IoU
F1
P
R
3.8B 77.8 88.1 85.7 90.8 81.6 90.1 88.0 92.3 68.0 82.8 77.7 88.7 91.0 95.2 95.3 95.2 70.6 84.4 81.9 87.1 88.3 93.9 94.5 93.3 1.2B 80.5 89.8 88.1 91.5 81.7 90.3 89.8 90.7 74.3 86.5 85.2 87.9 92.6 96.2 94.3 98.3 73.3 86.0 83.2 89.0 88.5 93.9 95.4 92.5 1.0B 81.7 90.3 89.8 91.0 81.9 90.5 88.7 92.4 73.7 86.2 85.7 86.7 93.2 96.6 95.5 97.7 77.8 88.1 89.1 87.1 88.2 93.8 95.0 92.7
Qianfan-OCR 4.7B 77.5 87.9 88.5 87.3 78.8 88.3 86.5 90.2 65.3 81.6 82.8 80.3 89.6 94.4 94.0 94.9 76.5 87.2 90.8 83.9 85.3 92.1 93.4 90.8 DeepSeek-OCR-2 3.4B 80.3 89.5 89.7 89.4 81.5 90.2 89.3 91.0 74.3 86.3 88.6 84.1 90.9 95.3 95.0 95.6 74.4 86.4 86.0 86.8 87.1 93.1 94.8 91.5 dots.ocr 3.0B 79.0 88.8 88.1 89.5 80.7 89.8 90.8 88.9 74.8 86.8 85.6 88.1 91.4 95.7 96.2 95.1 69.1 82.8 79.9 85.9 88.3 93.8 96.8 91.0 End-to-end HunyuanOCR 1.5 1.0B – – – – 50.4 70.8 73.1 68.7 – – – – – – – – – – – – – – – – MonkeyOCRv2-B-Parsing 0.7B 75.7 86.8 84.5 89.5 77.3 87.4 86.5 88.4 62.3 79.1 71.1 89.2 90.9 95.3 95.1 95.6 72.2 85.2 85.4 84.9 85.1 91.8 93.2 90.3 PaDoc (Ours) 2.1B 80.1 90.3 91.9 89.0 80.9 90.7 91.2 90.2 73.9 86.9 92.5 81.9 91.6 96.1 95.4 96.8 73.9 87.8 88.6 87.0 87.8 94.1 97.4 91.0
Table 7: Layout analysis on OmniDocBench using binary coverage and ignore-acceptable category matching. All metrics are percentages; Overall macro-averages text, image, table, and formula, with full-page coverage reported separately. Bold and underline mark the best and second-best values per paradigm.
full sharding, and gradient checkpointing. Each node contains eight A800 GPUs. We use each configuration’s actual end-to-end training path: the dense and Flex configurations dispatch their named backends through the corresponding model configuration; in our configuration, tree-varlen is applied to the text decoder while the frozen vision encoder retains standard FlashAttention-2. We hold the global batch size at 256 and vary the cluster size over {1, 2, 4, 8, 16} nodes. We use two token-budget-matched settings: maximum sequence length 16,384 with per-GPU batch size 1, and maximum sequence length 8,192 with per-GPU batch size 2. Accordingly, gradient accumulation is {32, 16, 8, 4, 2} for 16K and {16, 8, 4, 2, 1} for 8K. Each run executes four optimizer steps on the same training corpus. We discard step 1 from timing because it contains cold data/kernel startup and, for Flex, graph compilation. Table 8 reports the mean and sample standard deviation over steps 2–4. A step includes exposed data loading/collation time, all accumulation microsteps, forward and backward passes, FSDP communication, gradient clipping, and the optimizer update. We synchronize CUDA and take the maximum wall time and peak memory over all ranks. Peak allocated memory covers all four steps, including the cold step.
C.3
Results and Backend Selection
Flex Attention does not provide a favorable trade-off in this setting. It is slower than SDPA at every 16K point and at 2–16 nodes for 8K. On 16 nodes it achieves only 0.754× and 0.519× the SDPA training speed for 16K and 8K, respectively. Its excluded cold step also takes 258.951 seconds at 16K and 423.558 seconds at 8K because of compilation. Tree-varlen gives the most consistent efficiency improvement. At 16K it is 1.163–1.185× faster than dense SDPA across all cluster sizes. At 8K, the gain grows from 1.053× on one node to 1.254× on 16 nodes. At 16 nodes this reduces the optimizer-step time from 19.391 to 16.366 seconds for 16K, and from 8.720 to 6.953 seconds for 8K. Its peakmemory reduction is more modest: approximately 0.75 GiB for 16K and 0.37 GiB for 8K, indicating that model state, multimodal activations, and non-attention tensors dominate the observed peak. At 8K, the one- and two-node timings have very high variance because the data pipeline rolls past samples whose prompt alone exceeds 8K. This creates apparently superlinear transitions and should not be interpreted as pure communication efficiency. The cleaner 8-to-16-node transition reaches 90.5% efficiency for SDPA and 80.7% for Flex, while tree-varlen reaches 91.2%. For 16K, tree-varlen sustains 75.5–81.8% efficiency at each node doubling, similar to
Steady optimizer-step time (s)
Dense SDPA
Flex Attention
Tree-varlen (ours)
16K, per-GPU batch 1
8K, per-GPU batch 2
128
256
64
64
32
16
16
4 1
2
4
8
16
1
Number of A800 nodes (8 GPUs/node)
2
4
8
16
Number of A800 nodes (8 GPUs/node)
Figure 3: Multi-node training efficiency on A800 GPUs (lower is better). Each point is the mean optimizer-step time over steps 2–4, and error bars show the sample standard deviation. Global batch size is fixed at 256. Dense SDPA and Flex Attention are the two baselines; Flex remains slower despite avoiding the dense mask, while tree-varlen is consistently fastest. The large error bars for 8K at one and two nodes arise from input samples whose prompts already exceed the length cap and trigger data rolling.
Setting 16K / b1 16K / b1 16K / b1 16K / b1 16K / b1 8K / b2 8K / b2 8K / b2 8K / b2 8K / b2
Nodes 1 2 4 8 16 1 2 4 8 16
Dense SDPA Step (s) ↓ Peak GiB ↓ 115.242±19.302 52.341 71.033±9.471 51.419 46.660±6.032 50.764 31.063±6.018 50.436 19.391±5.182 50.272 212.364±114.703 51.051 129.408±112.275 49.554 32.877±5.377 48.996 15.786±2.010 48.717 8.720±1.200 45.202
Flex Attention Step (s) ↓ Peak GiB ↓ 129.851±22.938 51.592 84.611±15.234 50.669 72.899±21.113 50.014 59.353±23.067 49.687 25.711±8.061 49.523 209.159±114.207 50.682 153.161±101.817 49.185 47.655±12.306 48.627 27.130±3.985 48.348 16.809±14.539 44.834
vs. SDPA ↑ 0.887× 0.840× 0.640× 0.523× 0.754× 1.015× 0.845× 0.690× 0.582× 0.519×
Tree-varlen (ours) Step (s) ↓ Peak GiB ↓ 99.052±18.953 51.592 60.518±8.828 50.669 39.918±5.537 50.014 26.449±4.699 49.686 16.366±3.943 49.523 201.591±120.474 50.683 121.665±110.101 49.187 30.695±11.598 48.628 12.677±1.841 48.349 6.953±1.269 44.835
vs. SDPA ↑ 1.163× 1.174× 1.169× 1.174× 1.185× 1.053× 1.064× 1.071× 1.245× 1.254×
Table 8: Training-backend ablation. “vs. SDPA” is the dense-SDPA step time divided by the backend step time at the same sequence length and node count. Peak memory is maximum allocated CUDA memory over all ranks and all four steps. The best steady step time in each row is bold.
or slightly better than the baselines. Based on its consistent steady-state speedup, low compilation overhead, and exact realization of the ancestor mask, we use tree-varlen for all main experiments.
D
Controlled Quality and Structural Efficiency Analyses
This appendix complements the cross-model results in the main text with three controlled analyses. We first isolate the effect of the parallel training objective under an identical backbone and data configuration. We then quantify the reduction in autoregressive forward steps, report paired wallclock speedups, and examine how the measured speedup changes with page complexity. Unless otherwise noted, efficiency analyses use the same systematically sampled 384page OmniDocBench subset, A800 hardware, vLLM version, and concurrency levels as the main experiment.
D.1
Same-Backbone Quality Comparison
Table 9 isolates layout grounding while holding the Qwen3VL-2B backbone, training corpus, and PageIoU protocol fixed. PaDoc improves F1 for every reported class: Overall F1 increases by 1.460 points, with the largest gain on formulas (2.231 points). Precision also increases for every class, including gains of 5.574 points on images and 3.729 points Overall. These improvements are accompanied by lower recall for Overall, Image, Table, and Full page, indicating a more selective localization profile rather than uniformly denser predictions. Table 10 evaluates the resulting regional contents under the same controlled setting. Aggregate end-to-end quality is preserved, with an Overall change of only −0.345 points; Text Edit and both table metrics improve, while Reading Order Edit and Formula CDM remain close to the Sequential SFT baseline. Together, the two tables show that the efficiency gain does not require sacrificing either layout grounding or regional content recognition.
Overall
Method IoU
F1
P
Text R
IoU
F1
Image P
R
IoU
F1
Table P
R
IoU
F1
Formula P
R
IoU
F1
Full page
P
R
IoU
F1
P
R
Sequential SFT 80.905 89.666 89.556 89.860 83.346 90.744 91.455 90.057 74.177 86.327 87.088 85.745 92.243 95.746 94.695 96.835 73.854 85.848 84.984 86.804 85.692 92.322 93.078 91.604 PaDoc (Ours) 81.355 91.126 93.284 89.157 84.258 92.497 94.445 90.628 74.109 86.951 92.661 81.904 92.729 96.978 97.127 96.830 74.324 88.079 88.905 87.267 85.941 93.125 95.446 90.913
Table 9: Controlled layout comparison using the same Qwen3-VL-2B backbone, training corpus, and countable–acceptable PageIoU protocol. All metrics are percentages; Overall macro-averages text, image, table, and formula, with full-page coverage reported separately. Bold marks the better value in each pair. Method
Overall ↑
TextEdit ↓
Read OrderEdit ↓
TableTEDS ↑
TableTEDS-S ↑
FormulaCDM ↑
Sequential SFT PaDoc (Ours)
94.585 94.240
0.03827 0.03810
0.13014 0.13320
90.664 90.940
92.827 93.390
96.919 95.590
Table 10: Controlled end-to-end parsing comparison on OmniDocBench v1.6 Full using the same Qwen3-VL-2B backbone, training corpus, and evaluation protocol. Bold marks the better value in each pair.
D.2
cached position ℓ:
Forward-Step Reduction and Measured Speedup
For a page with layout regions B1:N and regional contents Y1:N , the numbers of autoregressive forward steps along a sequential generation path and the PaDoc critical path are Fseq = ℓ(B1:N ) +
N X
ℓ(Yk ),
k=1
(34)
FPaDoc = max [ℓ(B≤k ) + ℓ(Yk )] .
ℓ ∈ Anc(c) or the private history of c. (35) This formulation defines the permitted dependencies; it does not require every serving backend to materialize M physically. Mc,ℓ = 1
⇐⇒
When one input token from every live stream is appended, the logical state is updated as
1≤k≤N
We summarize the per-page reduction as Rstep = 1 − FPaDoc /Fseq , using the layout and branch traces generated by PaDoc. This quantity describes the number of decoding iterations removed from the autoregressive path; it is not a wall-clock speedup estimate. Separately, we evaluate PaDoc and our Sequential SFT model on the same pages, hardware, vLLM version, and document concurrencies. We pair valid requests by page and compute the measured end-to-end speedup as Se2e,i = PaDoc Lseq . Both systems retain the serving limits specified i /Li in the main experiment. Table 11(a) shows that, at C64, the median number of forward steps decreases from 725.0 for a sequentialized response to 297.5 along the PaDoc critical path. The median per-page reduction is 58.4%, with an interquartile range of 47.7–68.2%. Table 11(b) independently reports wall-clock behavior: median paired speedup ranges from 1.453× to 1.937× across the five concurrency levels, corresponding to median latency reductions of 31.2–48.4%.
E E.1
Masked Parallel Decoding and Additional Serving Details Masked Parallel Decoding
Masked parallel decoding specifies the runtime-independent visibility and fork semantics of PaDoc. For concreteness, consider a logical fused realization whose key–value cache contains L positions. For C live streams, an ancestor mask M ∈ {0, 1}C×L records whether stream c may attend to
M ← [ M IC ],
L ← L + C.
(36)
The identity block exposes each new token only to its own stream. With additive bias AM , where masked entries are −∞, a decoder layer computes QK ⊤ Attn(Q) = softmax √ + AM V. d
(37)
Thus the current tokens of all live streams can be processed in one logical batched step without exposing their private suffixes to one another. When the layout stream completes region Bk , its boundary output has not yet been appended to the cache. The scheduler therefore copies the layout stream’s pre-boundary visibility, Mchild,1:L ← Mlayout,1:L ,
(38)
and creates the corresponding content stream with a learned branch-initialization input. On the next step, the identity extension gives the layout stream visibility to its boundary output and the content stream visibility to its initialization input, but neither stream can observe the other’s new input. The content stream therefore sees (X, B≤k ) and its own continuation, but neither future layout nodes nor sibling contents. Algorithm 1 summarizes this logical fused realization.
(a) Autoregressive forward steps on the C64 paired set Metric Mean
P25
Median
P75
Fseq (sequentialized response) FPaDoc (critical path) Forward-step reduction (%)
376.5 182.5 47.7
725.0 297.5 58.4
1270.5 441.0 68.2
Sequential SFT P50 (s)
PaDoc P50 (s)
Speedup P50 (P25–P75)
13.546 27.483 49.160 96.596 198.999
8.547 15.759 32.410 65.991 99.555
1.616 (1.143–2.259) 1.633 (1.211–2.305) 1.453 (1.029–2.193) 1.483 (1.032–2.176) 1.937 (1.444–2.858)
923.2 325.3 56.3
(b) Measured paired end-to-end speedup Concurrency Paired pages 16 32 64 128 256
374 375 376 376 375
Table 11: Forward-step reduction and measured end-to-end speedup on the uniform 384-page subset. Panel (a) summarizes generated traces from 376 valid C64 pages. Panel (b) reports paired PaDoc/Sequential SFT latency measurements. Speedup quantiles are computed from per-page latency ratios and therefore need not equal ratios of the corresponding marginal latency quantiles. Algorithm 1: Masked parallel decoding in PaDoc 1: Prefill X; initialize the layout stream, cache length L,
and mask M . 2: while any stream is live do 3: Let C be the live-stream count and i their next inputs. 4: Append i to the cache: M ← [ M IC ], L ← L + C. 5: Decode o for all streams using the additive bias AM . 6: Set each existing stream’s next input to its output to-
ken. if the layout output completes region Bk then Copy the layout row and create Yk with a branchinitialization input. 9: end if 10: Retire streams whose output is EOS. 11: end while 7: 8:
A completed stream’s mask row is removed. Its private cache positions remain invisible to all surviving streams and need not be revisited. Algorithm 1 is a semantic and logical fused formulation; the reported experiments use the visibility-equivalent request-level mapping described next.
E.2
Request-Level vLLM Realization
The serving backend used in our experiments realizes the same visibility with one request per stream rather than a fused forward pass over M . Let P denote the original mul− timodal prompt and let B≤k denote the main-stream tokens through Bk but before its closing trigger. When the trigger is observed, the child request concatenates the original multimodal prompt, this pre-boundary layout prefix, and a learned branch-initialization input. Because the child request contains only this shared context and its private continuation, standard causal attention enforces the same branch isolation as the corresponding row of M . The layout request and all child requests are submitted to the same shared vLLM serving runtime. Parent and child requests preserve identical tokenized prefixes, multimodal inputs, and preprocessing settings, and share a document-
specific cache namespace. With automatic prefix caching, matching complete paged key–value cache blocks that remain resident can be reused by a child request. Only the suffix after the last reusable block boundary, together with the branchinitialization input, requires residual child prefill. The child becomes schedulable only after the step that produced the region boundary; continuous batching then overlaps it with the continuing layout stream and other live branches. When a branch finishes, the serving runtime returns its private cache blocks to the memory pool. This implementation is visibility-equivalent to Algorithm 1, but its physical execution differs: it does not materialize the logical ancestor mask or process every stream in one fused forward pass. Its latency includes request admission, residual prefix processing, kernel and host overhead, and idle work from unequal branch lengths. The critical-path ratio derived in the main text is therefore an ideal structural quantity rather than a wall-clock guarantee; all efficiency claims use the measured throughput and end-to-end latency reported in the Serving Efficiency section.
E.3
Additional Serving Metrics
Protocol and aggregation. All results in this subsection use the same fixed 384-page subset as Table 3, shared by every system and concurrency setting. Each model– concurrency pair is measured in one complete closed-loop run on a single A800 GPU after two warm-up requests, with no request retry. The timed path includes the official layout detection, cropping, and post-processing stages for two-stage systems. A page contributes to valid-page throughput only when inference completes normally, structured-output validation succeeds, and neither a generation limit nor an earlystop safeguard is reached. Let Nvalid be the number of such pages, Oi the generated-token count of request i, T the wall time of the complete run, and G = 1 the GPU count. The sustained rates are P Oi Nvalid , Rtok = i . (39) Rpage = TG TG
The wall-time denominator includes all work in the run, including work spent on outputs that are subsequently marked invalid or truncated, whereas output-token throughput includes every generated token. Following the main paper, E2E latency statistics are calculated over valid document requests. We sample vLLM’s monotonic generation-token counter every 0.2 seconds. Peak output-token throughput is the maximum counter increase per second over any fixed 10-second sliding window. Validity. Across all five concurrency settings, all 384 PaDoc requests completed normally, with no service errors, timeouts, generation-limit truncations, or early-stop events. The Sequential SFT runs likewise contained no service errors or timeouts; 359–364 pages per setting satisfied the validpage criterion, while the remaining 20–25 outputs reached the generation limit. As defined above, tokens generated before truncation remain included in output-token throughput. Latency distribution. Table 12 supplements the P95 values in Table 3 with the mean, median, P90, and P99 of validrequest E2E latency for PaDoc. The P95 row reproduces the corresponding PaDoc entries in Table 3. E2E latency (s)
C16
C32
C64
C128
C256
Mean P50 P90 P95 P99
10.126 8.527 17.938 22.847 39.583
18.341 15.674 32.541 49.125 60.223
35.648 31.938 66.546 70.659 82.079
67.556 65.235 102.118 118.808 142.508
105.367 99.555 161.978 194.018 210.073
Table 12: Valid-request E2E latency (s) for PaDoc on the fixed 384-page serving workload.
Statistic
Method
C16
C32
C64
C128
C256
Mean
Sequential SFT (Baseline) PaDoc (Ours)
997.1 1,410.0
1,066.3 1,539.2
1,222.2 1,551.2
1,171.9 1,517.9
1,141.3 1,528.7
Peak
Sequential SFT (Baseline) PaDoc (Ours)
1,539.5 2,655.7
1,986.6 2,883.5
2,253.1 2,895.8
2,899.3 3,410.8
3,542.4 3,576.5
Table 13: Mean and peak output-token throughput (TPS/GPU) on the uniform 384-page workload. C16, for example, denotes 16 concurrent document requests; peak rates use a fixed 10-second window. Serving envelope. All autoregressive calls use a 32,768token context limit and an 8,192-token generation limit. The standard scheduler envelope allows 256 sequences and 32,768 batched tokens per iteration. The evaluated PaDoc configuration instead allows 384 sequences with a 24,576token budget, as reported in the main text. The vLLM memory reservation is 90%, except for the PaddleOCR-VL services, which use 80% to accommodate their official layout stage. Output-token throughput. Table 13 reports mean sustained and peak output-token throughput for the controlled same-backbone comparison between Sequential SFT and
PaDoc. Relative to Sequential SFT, PaDoc improves sustained output throughput by 26.9–44.4% across all tested concurrency settings and also achieves higher peak output throughput throughout. For PaDoc, sustained output throughput rises from 1,410.0 tokens/s/GPU at C16 to 1,551.2 at C64 and remains within 2.2% of this value at C128–C256. This trend agrees with the valid-page throughput in Table 3, which peaks at C64 and varies by at most 2.2% thereafter. Peak 10-second output throughput increases from 2,655.7 tokens/s/GPU at C16 to 3,576.5 at C256. Thus C64 is the highest sustained throughput operating point in the tested range, while higher concurrency increases short-window token throughput on this workload.
Related documents
- Decoder-Agnostic Token Merging for Vision Transformers: A Systematic Study of G2TM#1012475
- Doc2FRC: Length-Consistent Document-Level Machine Translation via Fixed-Range Chunking#1070157
- MultiSynt/MT: Trillion-Token Multi-Parallel Pre-Training Data Translated Across 36 Languages#986880
- Fine-Tuning LLMs for Translation: General Forgetting Mitigation Does Not Preserve MT-Specific Instruction Following#1064998
- German Ground Segment for MOS (IRS-P3-) data at DFD#642041
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive