TL;DR
This paper introduces HiRAG, a novel Retrieval-Augmented Generation (RAG) system that leverages hierarchical knowledge to improve LLM performance on knowledge-intensive tasks. By organizing knowledge in a hierarchical graph and employing a three-level retrieval strategy, HiRAG effectively addresses challenges like distant semantic relationships between entities and the knowledge gap between local and global information, leading to significant performance gains.
What Problem Does This Paper Address?
Large Language Models (LLMs) often struggle with domain-specific or knowledge-intensive tasks, leading to "hallucinations" or inaccurate information. Retrieval-Augmented Generation (RAG) aims to mitigate this by providing relevant text chunks as context. However, existing RAG methods, especially those using graph structures, often fail to capture the inherent hierarchical nature of human knowledge. This leads to two main problems:
- Distant structural relationships: Semantically similar entities might be structurally distant in a flat knowledge graph, making it hard for the RAG system to connect them.
- Knowledge gap between local and global information: RAG systems might retrieve specific entity details (local knowledge) but struggle to integrate them with broader community-level summaries (global knowledge), leading to disjointed reasoning and incomplete answers.
The authors argue that existing graph-based RAG methods overlook these limitations, hindering their ability to provide comprehensive and coherent responses.
Methods
HiRAG introduces two core components:
- HiIndex (Indexing with Hierarchical Knowledge): This module constructs a hierarchical knowledge graph (KG).
- It starts with a basic KG built from entity and relation extraction.
- Subsequent layers are built by clustering entities from the previous layer using Gaussian Mixture Models (GMMs).
- Summary entities are generated by LLMs to represent clusters of entities in the layer below. This creates "semantic hubs" that abstract and connect semantically related entities, even if they are structurally distant in lower layers.
- The number of layers is determined dynamically based on cluster sparsity.
- The Leiden algorithm is used to compute communities within this hierarchical KG, each with an interpretable semantic report.
- HiRetrieval (Retrieval with Hierarchical Knowledge): This module retrieves information at three levels to bridge the knowledge gap.
- Local-level knowledge: Retrieves the top-n most relevant entities based on query similarity.
- Global-level knowledge: Identifies communities connected to the retrieved entities and retrieves their semantic reports.
- Bridge-level knowledge: Constructs reasoning paths (shortest paths) between key entities from retrieved communities. This acts as a crucial link between local details and global context.
These three levels of knowledge are then fed to the LLM for answer generation.
Datasets
The authors used four datasets from the UltraDomain benchmark: Mix, CS, Legal, and Agriculture. These datasets are designed for evaluating RAG systems on diverse applications, focusing on long-context tasks and high-level queries. The paper also mentions using benchmark queries provided within UltraDomain for each dataset.
Key Insights and Ideas
- Hierarchical knowledge is crucial: Human cognition naturally organizes information hierarchically. Capturing this structure in RAG systems significantly improves their ability to understand semantic relationships and bridge knowledge gaps.
- Semantic hubs as connectors: Higher layers in the hierarchical KG act as "semantic hubs," abstracting and connecting semantically related entities that might be far apart in lower layers. This enhances connectivity and provides a more cohesive view of knowledge.
- Three-level retrieval for coherence: The combination of local entity details, global community summaries, and bridge-level reasoning paths is essential for generating comprehensive and contextually coherent answers. This directly addresses the "knowledge gap" problem.
- Bridging the gap is key: The bridge-level knowledge, formed by reasoning paths, is critical for connecting disparate pieces of information and ensuring that the LLM can synthesize local and global contexts effectively.
Key Results
- Superior performance: HiRAG consistently outperformed baseline methods (NaiveRAG, GraphRAG, LightRAG, KAG, FastGraphRAG) across all four datasets and four evaluation dimensions (Comprehensiveness, Empowerment, Diversity, Overall) based on win rates judged by GPT-40.
- Significant win rates: HiRAG achieved win rates of 87.6% against NaiveRAG, 64.1% against GraphRAG, 65.9% against LightRAG, and 97.7% against KAG on the Mix dataset. Similar strong performance was observed across other datasets.
- Ablation studies confirm effectiveness:
- Replacing the hierarchical KG with a flat KG (w/o HiIndex) led to significant drops in win rates, highlighting the importance of hierarchical indexing.
- Removing the bridge-level knowledge (w/o Bridge) also resulted in significant performance drops, underscoring the necessity of the bridge-level context.
- Efficiency: While HiRAG's indexing is more resource-intensive, its retrieval is efficient, not costing tokens for retrieval, unlike some baselines.
Limitations and Future Work
- Token consumption and time overhead: Constructing a high-quality hierarchical KG can incur substantial token consumption and time overhead due to LLM summarization in each layer. The authors suggest parallelizing indexing to reduce time and note that LLM costs are decreasing.
- Sophisticated query-aware ranking: The HiRetrieval module currently relies on LLM-generated weights for relation ranking, which could be improved. Future work could focus on developing more effective ranking mechanisms.
- Incorporating causality: The authors suggest incorporating causality into HiRAG to further enhance reasoning capabilities.
Summary updated