DOC: Hierarchical Document Structure Analysis
- Detect-Order-Construct (DOC) is a unified framework for reconstructing hierarchical document structure by integrating page object detection, reading order prediction, and tree construction in a single pipeline.
- The framework improves accuracy by jointly modeling visual and textual features, resulting in significant performance gains in segmentation mAP and reading order metrics across benchmarks.
- DOC is designed for documents with hierarchical schemas such as LaTeX, Word, and HTML, enabling enhanced information retrieval, summarization, and accessibility.
Searching arXiv for the cited DOC-related document parsing papers and closely related work. arXiv search query: "Detect-Order-Construct hierarchical document structure analysis RT-DocLayout parser-oriented structural refinement" Detect-Order-Construct (DOC) is a unified, tree-construction–based framework for Hierarchical Document Structure Analysis (HDSA). In its original formulation, DOC treats document understanding as a single pipeline that begins with page object detection, proceeds through reading-order prediction, and ends with reconstruction of a hierarchical document tree that captures both physical layout and logical structure, such as section hierarchy and caption attachment (Wang et al., 2024).
1. Conceptual framework and problem setting
DOC decomposes document analysis into three coupled stages: Detect, which identifies page objects and assigns logical roles; Order, which predicts reading order and inter-object relations; and Construct, which builds the abstract hierarchical tree. The final document is modeled as a rooted tree whose nodes are page objects and whose edges encode text-region reading order relationships, graphical-region relationships, and Table of Contents (TOC) relationships. Reading order is interpreted as a pre-order traversal of that tree (Wang et al., 2024).
The framework is motivated by the limitations of treating page object detection, reading order prediction, and hierarchy extraction as isolated subtasks. In the formulation associated with DOC, errors compound when these stages are separated, whereas a tree-construction view allows the system to represent page objects as tree nodes and structural relations as edges in a common representation. This suggests that DOC is not merely a pipeline decomposition but a structural hypothesis about how rendered documents should be modeled.
DOC is explicitly targeted at documents authored with hierarchical schemas, such as LaTeX, Microsoft Word, and HTML. The intended output is therefore more than a flat ordered list of regions: it is a hierarchical reconstruction that can support information retrieval, document summarization, knowledge extraction, and accessibility-oriented reflow (Wang et al., 2024).
2. Detect: page-object formation and logical role assignment
In DOC, the Detect stage must recover both graphical page objects and text regions. Graphical objects such as tables, figures, and formulas are obtained with a top-down detector built on a shared visual backbone. Text regions are produced bottom-up by starting from text lines extracted from PDF or OCR, filtering out lines inside graphical objects, and then grouping the remaining lines into higher-level regions such as paragraphs, titles, section headings, footnotes, captions, and list items (Wang et al., 2024).
For each text line , the system forms a multi-modal representation from visual, textual, and 2D positional features. The visual embedding is obtained from fused backbone features and RoIAlign; the textual embedding is derived from BERT; and the positional embedding encodes normalized box coordinates and size. These are concatenated and projected to form the line representation , which is then refined by a Transformer encoder:
The key operational step in bottom-up detection is intra-region reading-order relation prediction. Instead of binary link prediction, DOC casts successor selection as a dependency-parsing problem over candidate lines. For line pair , the score is
followed by
The predicted line-to-line chains are merged by Union-Find into text regions, and logical roles are assigned by line-level classification followed by region-level voting (Wang et al., 2024).
A central empirical claim of the framework is that this hybrid strategy materially improves page object detection. On DocLayNet, DOC improves over the best baseline by 4.2 mAP points (76.8 to 81.0), and on Comp-HRDoc, the hybrid vision-plus-text Detect module reaches 88.06 segmentation mAP versus 73.54 for Mask2Former-R50 (Wang et al., 2024).
3. Order: reading order as structured relation prediction
The Order stage operates on the page objects produced by Detect: text regions and graphical page objects. Its purpose is twofold: to recover a reading-order chain and to classify inter-region relation types, distinguishing ordinary text-region order from graphical relations such as caption–figure or footnote–table links (Wang et al., 2024).
Text-region representations are obtained by attention-based pooling over their constituent line features, while graphical objects are encoded from visual features and geometry. A region-type embedding representing the logical role is concatenated with the pooled feature, and all page-object embeddings are then processed by a Transformer encoder:
Successor prediction between page objects reuses the dependency-style scoring pattern already used at line level, again with softmax over candidate successors rather than independent binary decisions (Wang et al., 2024).
Within the broader DOC literature represented here, later work makes the order component even more explicit as a relational module over detected elements. RT-DocLayout models reading order by first assigning each element an absolute order index , constructing a pairwise precedence target
and predicting an antisymmetric pairwise score matrix
0
Inference converts pairwise scores into a global sequence by computing
1
then sorting elements in ascending order of 2. The paper characterizes this design as “almost a textbook example of a Detect–Order–Construct (DOC) system,” but implemented in a single unified Transformer (Cui et al., 22 Jun 2026).
A related parser-interface stabilization method formalizes the same stage differently. It inserts a structural refinement block between a DETR-style detector and a parser, treating the raw outputs as a hypothesis pool and jointly predicting refined boxes, retention probabilities, and an ordering score 3. Pairwise precedence is modeled by
4
with a difficulty-aware weight
5
so that structurally ambiguous pairs receive more emphasis during training (Liu et al., 3 Apr 2026).
4. Construct: hierarchical tree assembly and parser-facing structure
The Construct stage uses the ordered objects to build a hierarchical tree, with particular emphasis on section headings and TOC extraction. In DOC, the section headings 6 are first arranged in reading order and then encoded with a Transformer using RoPE:
7
Two dependency-style heads are then applied: one predicts parent–child relations, and the other predicts left-sibling relations. For the parent head,
8
and an analogous score 9 is used for siblings (Wang et al., 2024).
Inference does not simply accept pairwise predictions independently. Instead, DOC uses a serial tree insertion algorithm. For a new heading 0, candidate parents are drawn from the rightmost subtree frontier, parent scores and sibling scores are multiplied elementwise,
1
and 2 is inserted as the right-most child of the maximizer. This enforces a valid rooted ordered tree and operationalizes the claim that parent and sibling information must be decoded jointly (Wang et al., 2024).
The Construct stage extends beyond TOC extraction in later DOC-style systems. RT-DocLayout defines the “Construct” phase as taking per-element class labels, bounding boxes, masks, and predicted order, then using masks or boxes to crop regions, route them to text OCR, formula recognition, or table structure recognition, and finally sequence the recognized outputs into HTML, Markdown, LaTeX, or PDF-like structure (Cui et al., 22 Jun 2026). The parser-oriented refinement paper makes the same stage explicit as a detector-to-parser handoff: retained instances are sorted by predicted order and passed as a stabilized parser interface to downstream systems such as PaddleOCR-VL‑1.5 or GLM‑OCR (Liu et al., 3 Apr 2026).
This suggests that, across document parsing variants, the Construct stage increasingly denotes not only hierarchy induction but also the preparation of a parser-consumable structured interface.
5. Benchmarks, metrics, and empirical behavior
The original DOC work introduces Comp-HRDoc, built on HRDoc-Hard, with 1,000 documents for training and 500 for testing. It evaluates four tasks jointly: page object detection, reading order prediction, TOC extraction, and hierarchical structure reconstruction. Page object detection is evaluated with segmentation-based mAP. Reading order is evaluated with Reading Edit Distance Score (REDS), defined after Hungarian matching of predicted and ground-truth reading-order groups as
3
where 4 is total Levenshtein edit distance and 5 is the total number of units, including the special </p> token inserted to reflect paragraph boundaries (Wang et al., 2024).
On Comp-HRDoc, DOC reports 88.06 segmentation mAP for page object detection, 0.9319 Text Region REDS, 0.8637 Graphical Region REDS, 0.8605 Micro-STEDS and 0.8788 Macro-STEDS for TOC extraction, and 0.8371 Micro-STEDS and 0.8365 Macro-STEDS for full hierarchical reconstruction. On HRDoc-Hard, DOC reaches 0.8566 Micro-STEDS and 0.8548 Macro-STEDS for hierarchical reconstruction, substantially above DSPS Encoder, which uses true reading order as input (Wang et al., 2024).
Ablation results in the original framework show that the hybrid detect strategy and multimodal features are central. On Comp-HRDoc, Hybrid-R18 with vision only reaches 83.40 segmentation mAP, and Hybrid-R18 with vision plus text reaches 88.06. In the TOC module, removing the sibling-finding head reduces Micro-STEDS from 0.8605 to 0.8545, removing the Tree Insert Algorithm reduces it to 0.7111, and replacing softmax multi-class prediction with binary cross-entropy reduces it to 0.7002 (Wang et al., 2024).
Later DOC-style systems emphasize speed and robustness under real-world distortions. RT-DocLayout uses a 33M-parameter architecture, runs at 132.1 FPS on A100 with batch 32, and unifies classification, detection, segmentation, and reading-order prediction in a single model. With PaddleOCR-VL‑1.5-0.9B on OmniDocBench v1.5 it reports Overall = 94.50, and on Real5-OmniDocBench it reports Overall = 92.05, with Warp = 91.25 and Skew = 91.66. Its ablation shows a decoupled reading-order module reaches RO = 0.189 on OmniDocBench, whereas coupling order prediction inside the decoder yields RO = 0.041 (Cui et al., 22 Jun 2026).
Parser-oriented structural refinement focuses on stability of the retained instance set and parser input order. It reports Reading Order Edit of 0.024 on OmniDocBench and 0.036 on Real5-OmniDocBench. Ablation indicates that removing retention-oriented supervision drops Overall from 94.63 to 90.84, while removing difficulty-aware ordering leaves F1 and Overall unchanged but worsens Reading Order Edit from 0.024 to 0.061 (Liu et al., 3 Apr 2026).
6. Subsequent interpretations, variants, and acronym disambiguation
Within document parsing, DOC has been used both as the title of a specific tree-construction framework and as a conceptual lens for later systems. RT-DocLayout explicitly describes itself as nearly a textbook DOC system, but collapses Detect, Order, and Construct into a single forward pass with shared query embeddings (Cui et al., 22 Jun 2026). Parser-oriented structural refinement does not use DOC as its formal name, but its own stage mapping is detector 6 layout instances 7 parser, and it explicitly identifies a middle structural module that decides retention, localization, and order jointly before construction by the downstream parser (Liu et al., 3 Apr 2026). A plausible implication is that DOC has evolved from a tree-reconstruction framework into a more general description of structured document parsing pipelines.
The acronym “DOC,” however, is not unique to document structure analysis. In the arXiv literature covered here, it also designates unrelated methods in vision, security, and language generation.
| Expansion of DOC | Domain | Paper |
|---|---|---|
| Deep OCclusion | Single-image occlusion estimation | (Wang et al., 2015) |
| Deep One-Class | Network anomaly detection | (Sarhan et al., 2022) |
| Detailed Outline Control | Long-story generation | (Yang et al., 2022) |
“DOC: Deep OCclusion” defines DOC as a two-stream fully convolutional architecture for boundary detection and border ownership estimation, where each boundary pixel has label pair 8 and 9 encodes foreground/background assignment by a left rule (Wang et al., 2015). “DOC-NAD” defines DOC as a hybrid DeepSVDD-plus-HBOS one-class classifier for network intrusion detection trained only on benign flows (Sarhan et al., 2022). “DOC: Improving Long Story Coherence With Detailed Outline Control” defines DOC as a planning-and-control framework for long-form story generation built from a detailed outliner and a detailed controller (Yang et al., 2022).
For the document-analysis meaning of Detect-Order-Construct, the principal open directions stated in the source literature are broader document types, stronger handling of documents without section numbers or stable typographic cues, page-spanning or multi-page ordering, and extension from strictly tree-structured outputs to more general graph structures (Wang et al., 2024). Subsequent work also points to multi-page order, hierarchical relations beyond block level, and ambiguity in non-linear reading orders as unresolved design problems for DOC-style systems (Cui et al., 22 Jun 2026).