Abstract
Large Language Models (LLMs) often struggle with factual accuracy, a challenge addressed by Graph Retrieval-Augmented Generation (GraphRAG). However, existing GraphRAG systems frequently rely on rigid, "one-size-fits-all" retrieval strategies that are either inefficient or insufficient for complex queries. This paper introduces PolyG, a framework that employs adaptive graph traversal by categorizing questions into a formal taxonomy and generating tailored Cypher queries. PolyG demonstrates significant improvements in answer quality, achieving up to a 90% reduction in token costs and a 2x improvement in latency compared to state-of-the-art methods.
Introduction
While GraphRAG improves LLM grounding by retrieving structured data from Knowledge Graphs (KGs), current research faces two primary hurdles. First, evaluation benchmarks often focus on simple attribute lookups, failing to capture the complexity of real-world information needs. Second, most systems use fixed retrieval patterns—such as simple Breadth-First Search (BFS)—regardless of the question's nature. This leads to "context stuffing," where irrelevant data consumes tokens and degrades performance. PolyG addresses these issues by matching the "shape" of graph traversal to the specific requirements of the user's query.
The PolyG Framework
PolyG implements an adaptive workflow consisting of five integrated stages designed to optimize retrieval precision and efficiency.
1. Question Categorization and Decomposition
The system first identifies whether a question is "basic" or "nested." Nested questions are decomposed into a sequential plan of basic sub-questions. For instance, a query about the relationship between two scientists is broken down into identifying each scientist before finding the path between them.
2. Adaptive Cypher Query Generation
Unlike methods that perform blind walks, PolyG prompts an LLM to generate specific Cypher queries based on the identified question pattern. This allows for targeted operations like SHORTEST PATH for relationship queries or specific attribute lookups, ensuring only relevant nodes and edges are retrieved.
3. Execution and Context Formation
PolyG includes a self-correction loop: if a query fails due to syntax or schema mismatches, the error is fed back to the LLM for refinement. Once successful, the retrieved graph data is formatted into structured tables, providing a clean context for the LLM to generate the final response.
Evaluation and Results
The authors introduced PolyBench, a benchmark covering three diverse domains (Academia, Literature, and E-commerce) and a wide array of question patterns.
Performance Gains
PolyG significantly outperformed baselines like Microsoft’s GraphRAG and Graph-CoT:
- Quality: Achieved a 54.75% "Overall Winner" score, nearly triple the next best baseline.
- Efficiency: Reduced token consumption by up to 90% and halved end-to-end latency.
- Accuracy: Demonstrated 89% accuracy in question categorization and over 95% success in query generation through its self-correction module.
Conclusion
PolyG demonstrates that formalizing natural language queries into a triple-based framework ($⟨ s, p, o ⟩$) allows for mathematically optimal graph traversal. While highly effective for relationship and fact-based queries, future work will focus on extending this taxonomy to handle "global" summarization tasks and managing extremely complex schemas. By prioritizing precision over volume, PolyG sets a new standard for efficient and effective GraphRAG.
Summary updated