Viyan

Viyan AI

LiteRAG Replaces LLM Graph Traversal with Algorithmic Pruning

LiteRAG swaps expensive LLM-based graph navigation for deterministic, query-adaptive filtering to improve retrieval latency and token efficiency.

Graph-based retrieval is intended to solve multi-hop question answering, where the answer requires synthesizing information across fragmented, interconnected sources. Traditional methods often use an LLM at retrieval time to traverse nodes, deciding at each step where to move next. This is conceptually clean but computationally disastrous. Every decision requires a full forward pass of a model. LiteRAG discards this pattern. Instead, it employs deterministic mechanisms to construct a reasoning chain without active LLM inference.

The Mechanism of Deterministic Traversal

LiteRAG replaces the LLM agent with two filtering mechanisms applied to the graph index. The first is query-adaptive thresholding. This compares the embedding of the user query directly against the embedding of each potential candidate node in the neighborhood. Nodes that do not exceed a dynamic threshold score calculated from the query's embedding are discarded immediately. The second mechanism is community-aware hub penalization. This assigns a penalty weight to nodes based on their raw degree count within the graph. A hub node, defined by an excessively high number of incoming or outgoing edges, is dampened by this weight to ensure the traversal avoids generic central nodes that typically generate noise in a retrieval context.

The system constructs a reasoning chain by first performing a keyword-based search to identify initial starting nodes. From this local subgraph, the algorithm executes a shortest-path approach. It calculates the relevance score for each neighboring node using the thresholding and hub penalties. It ranks nodes by these scores and selects the top N highest-scoring paths to build the final context. Because these rules are fixed and rely on pre-computed indices, the search is a single deterministic pass. You are effectively shifting the cost from expensive, real-time model inference to a pre-computed graph index.

Method Latency Improvement Cost Reduction Token Efficiency
GraphRAG Global Base Base Base
DRIFT Base Base Base
LiteRAG >100x >99% 14x fewer tokens vs LinearRAG (UltraDomain)

Implementation Trade-offs

For builders, consider a legal discovery database where nodes represent case precedents. An agentic approach might traverse every cited case, incurring an LLM call for every edge. This quickly becomes non-viable as the chain deepens. LiteRAG treats this as a graph topology problem. By prioritizing nodes with high semantic overlap while dampening the influence of massive hub cases that cite everything, it isolates the relevant lineage of the argument without needing the LLM to process every hop. On the UltraDomain benchmark, this approach achieves an overall quality score of 0.798 while using 14x fewer tokens than a linear RAG baseline.

The primary assumption here is that your graph possesses clear community clustering. The method relies on the premise that information is grouped into distinct, identifiable domains. If your data lacks this structure, the penalization logic will struggle. Specifically, if your data has high degree-centrality and weak community segmentation, the heuristic rules will likely discard the very connections you need for an accurate answer. Before adopting this in production, evaluate your graph for density. You are trading the LLM's capacity for unstructured, fuzzy reasoning for a faster, rule-based approach that requires your data to have a clear structural order.

Sources