TL;DR
DocMaster is a hierarchical, structure-aware document analysis system designed to prevent Retrieval-Augmented Generation (RAG) pipelines from flattening complex PDFs into unstructured text chunks. By parsing documents into hierarchical trees and building cross-section semantic indices, it enables highly accurate document filtering and deep question-answering over complex document collections.
What Problem Does This Paper Address?
When analyzing complex documents like academic papers, technical manuals, or financial reports, standard RAG systems typically shred PDFs into flat, sequential text chunks. This structure-agnostic approach discards vital layout information—such as sections, subsections, tables, figures, and equations—leading to three major challenges:
- Hierarchy Loss: Flattening destroys the structural relationships between headers and content, returning context-poor fragments that hinder accurate filtering and answering.
- Blindness to Cross-Section Semantics: Implicit relationships often span across distant sections (e.g., a method introduced in Section 3 being tied to an evaluation metric in Section 5). Simple vector similarity metrics fail to capture these links.
- Fragmented Evidence Aggregation: Standard systems retrieve chunks independently, making it difficult to aggregate evidence scattered across different parts of a document to satisfy a single filtering condition.
DocMaster addresses these gaps by preserving the document's original layout hierarchy and overlaying it with a structure-aware semantic index.
Methods
The DocMaster pipeline operates in four distinct stages:
- Document Parsing: The system uses MinerU as its extraction backend to convert PDFs into structured content while preserving layout data for text blocks, tables, figures, and equations.
- Document Tree Construction: Parsed content is organized bottom-up into a hierarchical tree consisting of
ROOT,TITLE,TEXT,IMAGE,TABLE, andEQUATIONnodes. Each node stores its raw content, a dense embedding (viaall-MiniLM-L6-v2), and an LLM-generated summary (viaGPT-4o mini) that is recursively composed from its children. - Semantic Index Construction: To capture implicit cross-section relationships, DocMaster introduces a Structural Entropy Correlation (SEC) Score. This score combines semantic similarity with structural divergence to identify "anchor pairs"—text segments that are semantically related but structurally distant. An LLM then labels these pairs as must-link or cannot-link, guiding a Pairwise-Constrained K-Means (PC-KMeans) algorithm to cluster the nodes. Additionally, Hyper-Edges are constructed to group semantically related paragraphs within sections.
- Tri-Modal Retrieval: For any natural-language filter query, DocMaster combines three retrieval strategies: document-tree traversal, FAISS semantic search (weighted by node type and tree depth), and hyper-edge matching.
Datasets
As a system demonstration paper, DocMaster does not introduce a new machine learning benchmark dataset or evaluate on standard training corpora. Instead, the authors demonstrate its utility using collections of unstructured AI research papers uploaded directly into the system.
Key Insights and Ideas
- Bridging Structure and Semantics: The core innovation lies in the SEC score. By penalizing node pairs that are structurally close and favoring those that are structurally distant yet semantically similar, the system explicitly targets the cross-section relationships that standard local retrieval methods miss.
- Cost-Effective LLM Guidance: Rather than using an LLM to evaluate every single text chunk relationship (which would be computationally prohibitive), DocMaster uses the LLM only to label a small, strategically chosen set of anchor pairs ($k$). This bounds the annotation cost to $O(k)$ while still injecting high-level semantic judgment into the clustering process.
Key Results
The authors implemented DocMaster as a fully functional web application featuring a React frontend and a FastAPI backend.
The system successfully demonstrates three interactive user scenarios:
- Document Exploration: Users can upload a folder of PDFs and explore their hierarchical structures visually via a collapsible tree layout.
- Index Inspection: The interface provides multi-view visualizations of the document tree, hyper-edges, and semantic clusters, allowing users to tune hyperparameters ($\alpha, k, K, w$) on the fly.
- Live Filtering & QA: Users can issue complex natural-language queries (e.g., "Does this paper propose a retrieval-augmented generation method?"). The system highlights matching passages across the tree, renders a boolean filtering decision per document, and provides grounded answers with clear citations.
Limitations and Future Work
While DocMaster excels at analyzing individual documents hierarchically, its current semantic indices are built on a per-document basis. The authors note two primary directions for future work:
- Cross-Document Indexing: Extending the semantic index to link related concepts and implicit relationships across an entire multi-document collection.
- Incremental Updates: Developing support for dynamic, incremental index updates so the system can seamlessly adapt as document collections evolve over time.
Summary updated