NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

TreeRAG: Unleashing the Power of Hierarchical Storage for Enhanced Knowledge Retrieval in Long Documents

Wenyu Tao, Xiaofen Xing, Yirong Chen, Linyi Huang, Xiangmin XuACL 2025

Abstract

Retrieval-Augmented Generation (RAG) has become a cornerstone for large language model (LLM) applications, yet it struggles with the structural complexities of long documents. This paper introduces TreeRAG, a framework that organizes document chunks into a hierarchical tree structure. By utilizing hierarchical prefixing and a novel bidirectional traversal retrieval strategy, TreeRAG significantly enhances recall and precision in complex tasks like Query-Focused Summarization (QFS). Experimental results on the Dragonball benchmark demonstrate that TreeRAG outperforms existing methods, achieving up to 83.63% recall in financial domains.

Introduction

Traditional RAG systems typically rely on "naive chunking," where documents are split into fixed-size blocks for vector-based retrieval. While efficient, this approach often severs semantic ties and strips chunks of their broader context. When a query requires synthesizing information across a long document, standard top-K retrieval often fails to capture the logical associations between distant but related text segments. TreeRAG addresses these challenges by shifting from flat storage to a structured, hierarchical index.

The Limitations of Traditional RAG

The authors identify three critical failure points in current RAG frameworks:

  1. Destructive Chunking: Fixed-size splitting breaks sentences and logical units.
  2. Loss of Information Integrity: Individual chunks lose context, making pronouns like "it" or "the company" ambiguous.
  3. Disruption of Associations: Relevant information for a single query may be scattered across different sections, making them distant in a flat vector space even if they are logically linked.

The TreeRAG Framework

TreeRAG introduces a two-pronged innovation to solve these issues: structured storage and intelligent retrieval.

Figure 1: System architecture of TreeRAG, detailing the pipeline from document chunking to bidirectional retrieval.

Tree-Chunking and Hierarchical Prefixing

Instead of arbitrary splits, TreeRAG uses an LLM to analyze the document and generate a general-to-specific tree structure. Each chunk is assigned a title and an index reflecting its position in the hierarchy.

A key innovation is the use of hierarchical prefixes. Before embedding, each chunk is prepended with the titles of its parent nodes (e.g., "Section 1 > Subsection A > [Chunk Text]"). This "contextual anchoring" ensures that the semantic embedding captures the chunk's specific location and role within the document's logic, effectively resolving ambiguous references.

Figure 2: A visualization of the tree-chunking process, transforming a linear document into a hierarchical structure.

Bidirectional Traversal Retrieval

Retrieval in TreeRAG begins with intent identification. An LLM determines if the query necessitates a broad summary or a specific fact. If a broader context is required, the system employs a bidirectional search:

  • Root-to-Leaves: Gathering all granular details under a relevant high-level heading.
  • Leaf-to-Roots: Identifying the high-level context and governing principles for a specific detail.

This ensures that if a single relevant chunk is found via vector similarity, its logical "relatives" in the tree are automatically considered, bridging the gap between mathematical similarity and document structure.

Experimental Evaluation

The framework was rigorously tested using the Dragonball dataset, covering Finance, Law, and Medical domains. TreeRAG demonstrated substantial performance gains over competitors like Late-Chunking and RAPTOR:

  • Recall: In the Finance subset, TreeRAG achieved a recall of 83.63% (Top-10), vastly outperforming Late-Chunking (29.02%).
  • Effective Information Rate (EIR): In the Medical subset, TreeRAG’s EIR reached 54.48%, nearly doubling the performance of its closest rivals.
  • Generation Quality: Qualitative assessments using ROUGE-L and METEOR confirmed that the retrieved hierarchical context led to more comprehensive and accurate LLM responses.

Key Insights

  • Contextual Glue: Prefixing acts as a semantic bridge, solving the "demonstrative pronoun" problem that plagues flat RAG systems.
  • Logical vs. Vector Space: TreeRAG highlights that logical relevance does not always equate to vector proximity. The tree structure serves as a vital index table to navigate these logical connections.
  • Efficiency through Intent: By analyzing query intent first, the system avoids unnecessary computational overhead for simple factoid questions.

Conclusion and Future Work

TreeRAG represents a significant step forward in handling long-document retrieval by prioritizing structural integrity. While currently limited to single-document trees, future iterations aim to explore cross-document node linking and advanced knowledge aggregation techniques to further refine the quality of generated summaries.

Summary updated

BibTeX
@inproceedings{tao2025treerag,
  author = {Wenyu Tao and Xiaofen Xing and Yirong Chen and Linyi Huang and Xiangmin Xu},
  title = {{TreeRAG: Unleashing the Power of Hierarchical Storage for Enhanced Knowledge Retrieval in Long Documents}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure