DocMaster: A Hierarchical Structure-Aware System for Document Analysis
Source: arXiv:2607.08539 · Published 2026-07-09 · By Ziqi Chen, Yingli Zhou, Fangyuan Zhang, Quanqing Xu, Chuanhui Yang, Yixiang Fang
TL;DR
DocMaster addresses the challenge of analyzing complex documents such as academic papers, technical manuals, and financial reports by preserving their rich hierarchical structures (sections, tables, figures, equations). Existing systems typically flatten documents into text chunks, discarding structural context and impairing downstream tasks like filtering and question answering. DocMaster innovates by parsing documents into hierarchical document trees that maintain original layout and semantic information, and by constructing structure-aware semantic indices that capture both explicit hierarchy and implicit cross-section semantic relationships.
The system integrates a tri-modal retrieval framework combining document-tree traversal, embedding-based semantic search, and hyper-edge matching for accurate document filtering. Filtered documents can then be used as grounded context for retrieval-augmented generation (RAG) question answering. An interactive web interface supports document collection upload, index construction, semantic filtering via natural language queries, and follow-up Q&A. Experiments and demos show improved user experience for complex document analysis workloads, demonstrating effective evidence aggregation across sections and enabling fine-grained semantic filtering beyond flat text chunking.
Key findings
- DocMaster preserves rich hierarchical document structures (sections, tables, figures, equations) using a bottom-up tree parsing strategy employing MinerU as a backend PDF parser.
- The system computes dense embeddings for each tree node with sentence-transformer all-MiniLM-L6-v2 and generates GPT-4o mini summaries at leaf and section levels.
- DocMaster’s Structural Entropy Correlation (SEC) score balances semantic similarity and structural divergence to identify top-k text node pairs for clustering anchor selection.
- LLM-guided pairwise constrained K-Means clustering (PC-KMeans) uses must-link and cannot-link constraints from LLM annotations on SEC-selected node pairs, improving semantic cluster quality.
- Hyper-edges identified via LLM-based grouping connect semantically related paragraphs within sections, creating cross-node semantic overlays spanning the document.
- Tri-modal retrieval combines document-tree traversal, FAISS embedding similarity search with type and depth weighting, and hyper-edge matching to robustly filter documents with boolean decisions from LLMs.
- The interactive web interface enables live query filtering and follow-up question answering over filtered documents with highlighted evidence passages.
- DocMaster supports hyperparameter tuning (α, k, K, w) for controlling the semantic clustering and filtering behavior, visually comparing impact on results.
Threat model
DocMaster assumes a benign user analyzing large document collections where the main challenge is preserving and exploiting document structure rather than defending against adversarial manipulation. The adversary in this context is the informational complexity and layout variability in documents, which can cause traditional flattening methods to lose critical context. It does not consider active attackers aiming to evade retrieval or poisoning the index.
Methodology — deep read
Threat Model & Assumptions: DocMaster targets users analyzing large collections of complex documents with rich hierarchical layouts. The system assumes document PDFs can be parsed reliably but does not assume the adversary tries to evade detection or manipulate indexing. The adversary is effectively the natural complexity of documents and loss of context in flat chunking.
Data: Input documents are PDFs parsed by MinerU to extract layout-preserving elements (text blocks, tables, figures, equations). Each document is represented as a hierarchical tree with nodes typed as ROOT, TITLE, TEXT, IMAGE, TABLE, or EQUATION. Leaf nodes contain raw content augmented with GPT-4o mini summaries and dense embeddings from all-MiniLM-L6-v2 sentence transformers.
Architecture / Algorithms:
- Document Parsing: MinerU extracts structured content with layout info.
- Document Tree Construction: bottom-up assembly of hierarchical trees where section titles form internal nodes and content nodes are children.
- Semantic Index Construction: uses Structural Entropy Correlation (SEC) score combining cosine embedding similarity and structural entropy measures to select the top-k anchor pairs of nodes that are semantically similar but structurally distant.
- PC-KMeans: pairwise constrained K-Means clustering enforces must-link and cannot-link constraints generated by LLM labeling of anchor pairs, integrating semantic judgment into clustering.
- Hyper-Edges: LLM-based grouping produces hyper-edges within sections linking related paragraphs, summarized with short descriptions.
Training: The system does not involve traditional model training but relies on pretrained embedding models and prompting LLMs (GPT-4o mini) for summaries and pairwise clustering constraints. Hyperparameters for PC-KMeans clustering and retrieval scoring are tunable.
Evaluation Protocol: The evaluation focuses on interactive scenarios demonstrated via a web interface:
- Upload of document collections (e.g., AI papers dataset)
- Construction of hierarchical trees and semantic indices
- Filter queries via natural language with tri-modal retrieval
- Follow-up questions answered through Retrieval-Augmented Generation (RAG) using retrieved passages The paper reports qualitative results via GUI screenshots and example queries but lacks quantitative benchmarks or adversarial evaluation.
- Reproducibility: DocMaster’s source code, demo, and data are publicly available at https://doc-master.github.io/, enabling reproduction of parsing, indexing, filtering, and Q&A workflows. The underlying MinerU parser and embedding models are open-source. However, some LLM calls (pairwise constraints, summarization) depend on external GPT-4o mini APIs, which may impact full offline reproducibility.
Example End-to-End Workflow: A user uploads a folder of PDFs. Each is parsed into hierarchical trees enriched with dense embeddings and summaries. SEC scoring identifies candidate node pairs that GPT-4o mini labels as must-link or cannot-link. PC-KMeans clusters nodes into semantic groups constrained by these labels. Hyper-edges connect related paragraphs within clusters. The user issues a filter query (‘Does this paper propose a RAG method?’). The tri-modal retrieval pipeline aggregates evidence from node traversal, semantic search, and hyper-edge matches. An LLM processes the aggregated evidence and returns boolean filter decisions. After filtering, follow-up questions retrieve supporting passages for grounded answers.
Technical innovations
- Integration of document layout parsing with hierarchical tree construction that explicitly preserves document structure in downstream analysis rather than flattening.
- Structural Entropy Correlation (SEC) score combining semantic similarity and structural entropy to identify semantically similar but structurally distant text node anchors for clustering.
- Use of LLM-guided pairwise-constrained K-Means clustering (PC-KMeans) injecting must-link and cannot-link constraints derived from semantic judgment to improve clustering quality.
- Introduction of hyper-edges connecting semantically related paragraphs across sections with LLM-generated summaries to capture cross-section relationships within the semantic index.
- Tri-modal retrieval strategy combining document-tree traversal, embedding-based similarity search, and hyper-edge matching to boost document filtering accuracy.
Datasets
- AI papers folder — unspecified size — user-uploaded document PDF collection used for demonstration
Baselines vs proposed
- No explicit quantitative baseline comparisons reported; evaluation is qualitative and demonstrated via interactive scenarios.
Figures from the paper
Figures are reproduced from the source paper for academic discussion. Original copyright: the paper authors. See arXiv:2607.08539.

Fig 1: The overall workflow of document analysis.

Fig 2: The DocMaster web interface: users can issue natural-language filter queries, explore the document-tree index, tune

Fig 3: End-to-end example of DocMaster. The user uploads AI papers; each PDF is parsed into a hierarchical document tree,

Fig 4: Document tree view of DocMaster, showing the

Fig 5: Overview of Semantic Index.
Limitations
- Lack of quantitative evaluation or benchmarks comparing DocMaster to flat chunk-based systems on standard datasets.
- Dependence on external LLM APIs (GPT-4o mini) for summarization and constraint labeling limits offline reproducibility and increases cost.
- No adversarial analysis or robustness evaluation against noisy or adversarial document layouts.
- Unclear scalability limits and performance on very large document collections.
- Evaluation primarily qualitative through demonstrations; lacks ablations isolating impact of SEC, PC-KMeans, or hyper-edge components.
- Does not yet support cross-document semantic indices or incremental updates in dynamic collections.
Open questions / follow-ons
- How does DocMaster quantitatively compare to flat-text chunking approaches on standard document filtering and QA benchmarks?
- Can the system scale efficiently to corpora with millions of documents with multi-level hierarchical complexity?
- How would cross-document semantic indices linking related content across documents be constructed and utilized?
- What is the robustness of the tri-modal retrieval method under noisy or adversarial document layouts?
Why it matters for bot defense
For bot-defense and CAPTCHA practitioners, DocMaster illustrates the importance of preserving hierarchical and layout structures in complex document analysis to improve filtering accuracy and context quality. Systems that process documents purely as flat text chunks may lose critical semantic links across sections, leading to poorer interpretation of user queries or challenge generation. DocMaster’s structure-aware indexing and cross-section evidence aggregation offer a valuable design blueprint for building more robust, contextually nuanced filtering and retrieval systems, which could similarly benefit CAPTCHA or bot-detection workflows reliant on textual content analysis. Although DocMaster targets LLM-powered document analysis, its approach to combining structural parsing, semantic embedding, and LLM-guided clustering can inform multi-modal evidence gathering in bot-defense pipelines.
Cite
@article{arxiv2607_08539,
title={ DocMaster: A Hierarchical Structure-Aware System for Document Analysis },
author={ Ziqi Chen and Yingli Zhou and Fangyuan Zhang and Quanqing Xu and Chuanhui Yang and Yixiang Fang },
journal={arXiv preprint arXiv:2607.08539},
year={ 2026 },
url={https://arxiv.org/abs/2607.08539}
}