Abstract
Retrieval-Augmented Generation (RAG) has proven to be widely successful in improving the output quality of Large Language Models (LLMs). However, traditional RAG systems typically retrieve context from flat document stores, which struggles with queries requiring hierarchical or relational reasoning. This paper presents HG-RAG (Hierarchy-Guided RAG), a framework that performs graph traversal over a hierarchical knowledge graph to provide structured context to a language model.
My retrieval pipeline resolves a named entity anchor from the query, then expands context upward through parent nodes, laterally through relational neighbors, and downward through child nodes as needed. I evaluate HG-RAG against a dense retrieval baseline across three world scales (18-800 nodes) with four query types: local fact, hierarchical, neighborhood, and multi-hop. Results show that HG-RAG consistently outperforms the flat baseline on hierarchical, relational, and multi-hop reasoning tasks while reducing hallucination and maintaining locality coherence.
Blogger's Review: HG-RAG significantly enhances the performance of knowledge graphs in complex query scenarios by introducing hierarchical and relational reasoning, opening new avenues for the application of large language models. Future research will focus on optimizing retrieval efficiency and model integration.