Jakir Hossain, Ahmet Erdem Sarıyüce
7 min
Abstract
Retrieval-Augmented Generation (RAG) enhances large language models by incorporating external knowledge. However, existing vector-based methods often fail on global sensemaking tasks that require reasoning across many documents. GraphRAG addresses this by organizing documents into a knowledge graph with hierarchical communities that can be recursively summarized. Current GraphRAG approaches rely on Leiden clustering for community detection, but we prove that on sparse knowledge graphs, where average degree is constant and most nodes have low degree, modularity optimization admits exponentially many near-optimal partitions, making Leiden-based communities inherently non-reproducible. To address this, we propose replacing Leiden with k-core decomposition, which yields a deterministic, density-aware hierarchy in linear time. We introduce a set of lightweight heuristics that leverage the k-core hierarchy to construct size-bounded, connectivity-preserving communities for retrieval and summarization, along with a token-budget-aware sampling strategy that reduces LLM costs. We evaluate our methods on real-world datasets including financial earnings transcripts, news articles, and podcasts, using three LLMs for answer generation and five independent LLM judges for head-to-head evaluation. Across datasets and models, our approach consistently improves answer comprehensiveness and diversity while reducing token usage, demonstrating that k-core-based GraphRAG is an effective and efficient framework for global sensemaking.
Alex: That onion idea clicks—denser inside means central ideas stay together. But what about nodes peeled off early? Don't they get lost?
Sam: Good question. Residual-aware k-core Hierarchy, or RkH, handles "residual" sparse nodes by separating them from dense cores at each layer. It splits oversized groups from high-degree seeds to keep connections intact. Single leftovers group by 2-hop links—like friends of friends—or attach to nearby clusters, forming a stable tree hierarchy without random splits.
Alex: Right, so peeling gives nested levels, and RkH cleans up edges without messing up cores. Does this respect token limits for language models?
Sam: Yes—it sets cluster sizes by estimating tokens per node for efficient summaries. Unlike Leiden's random outputs, this runs in linear time, always the same way. It's more robust on sparse graphs, where low-degree nodes cause modularity degeneracy—many near-equal groupings.
Alex: Huh, so the math shows why sparse graphs fool Leiden, but k-cores ignore that noise. That seems like a clear win for consistency.
Sam: Precisely. The paper tests it across datasets with language models judging summaries head-to-head. RkH hierarchies yield steadier, more complete retrieval—about twice as reliable in preserving key themes without fragmentation.
Alex: You mentioned handling peeled-off residuals carefully. How does it deal with tiny groups in sparse graphs without fragmenting everything?
Sam: Peeling often leaves tiny groups, like pairs of loosely connected nodes. These get low summary scores and ignored, hurting the picture. The cleanup merges them into the nearest bigger cluster via strong links—like attaching small puzzle pieces—or uses rules for 2-hop pairs and residuals to keep the hierarchy tight.
Alex: So it's tidying up after peeling to avoid losing info. And it respects token limits?
Sam: Exactly. To cut token costs from overlapping info, it ranks edges by endpoint connections, picking prominent ones first. Round-Robin Token-Constrained Selection shares the budget across communities from outer to inner shells for balanced coverage.
Alex: Huh, prioritizing busy edges and sharing evenly. How did they test improvements over Leiden?
Sam: Head-to-head on podcast transcripts, news, and earnings calls—using post-training-cutoff data. Three models generated answers from hierarchies, judged blindly by five others on thoroughness. K-core setups, especially with leaf-level merges, beat Leiden in about three-quarters of matchups.
Alex: Solid edge in consistency, with few ties on tougher data.
Sam: Yes. Wilcoxon tests confirm wins aren't luck, with low p-values. Leaf-level clusters beat higher ones by 5 to 10 percentage points on average. Stronger models narrow the gap slightly, but k-cores still edge out Leiden systematically on sparse graphs.
Alex: Token savings stand out—fewer communities, less text, yet performance holds. How big a deal practically?
Sam: Substantial for cost. Heuristics cut communities by 30 to 40 percent and token coverage to 55 to 60 percent of source text, matching or topping Leiden. RRTC preserves quality even trimming edges.
Alex: Efficiency without much loss. Any spots where it falls short?
Sam: The paper notes heuristics work well here but could lag on triangle-rich graphs—tight loops of three nodes. K-truss might fit better there, demanding edges surrounded by triangles. No single method fits all perfectly.
Alex: Huh, so heuristics trade generality for speed on sparse real-world graphs like financial or news data.
Sam: Precisely. The takeaway: a reliable, deterministic swap for Leiden in GraphRAG—linear time hierarchies that boost steady reasoning on sparse knowledge graphs, with token savings.
Alex: That's a grounded step forward for trustworthy global questions across documents. Thanks, Sam, for breaking it down so clearly.
Sam: My pleasure, Alex. Thanks for listening to ResearchPod.