[Paper Review] LMKG: Learned Models for Cardinality Estimation in Knowledge Graphs
LMKG proposes a deep learning framework for cardinality estimation in knowledge graphs using both supervised (LMKG-S) and unsupervised (LMKG-U) models that encode SPARQL queries as subgraph patterns via a novel SG-Encoding. It achieves state-of-the-art accuracy and efficiency by learning correlations across subgraph patterns, outperforming existing methods in estimation accuracy and inference speed while maintaining low memory usage.
Accurate cardinality estimates are a key ingredient to achieve optimal query plans. For RDF engines, specifically under common knowledge graph processing workloads, the lack of schema, correlated predicates, and various types of queries involving multiple joins, render cardinality estimation a particularly challenging task. In this paper, we develop a framework, termed LMKG, that adopts deep learning approaches for effectively estimating the cardinality of queries over RDF graphs. We employ both supervised (i.e., deep neural networks) and unsupervised (i.e., autoregressive models) approaches that adapt to the subgraph patterns and produce more accurate cardinality estimates. To feed the underlying data to the models, we put forward a novel encoding that represents the queries as subgraph patterns. Through extensive experiments on both real-world and synthetic datasets, we evaluate our models and show that they overall outperform the state-of-the-art approaches in terms of accuracy and execution time.
Motivation & Objective
- To address the challenge of inaccurate cardinality estimation in RDF-based knowledge graphs due to schema-free data, correlated predicates, and complex multi-join SPARQL queries.
- To develop a unified framework that supports both supervised and unsupervised deep learning models for cardinality estimation in knowledge graphs.
- To design an effective subgraph encoding (SG-Encoding) that compactly represents complex query patterns while preserving structural correlations.
- To evaluate the framework on real-world and synthetic datasets, demonstrating superior accuracy and efficiency compared to state-of-the-art approaches.
Proposed method
- LMKG formulates cardinality estimation as a deep learning problem by modeling subgraph patterns derived from SPARQL queries.
- It introduces SG-Encoding, a novel, compact representation that captures multiple subgraph patterns (e.g., star and chain patterns) while reducing input dimensionality.
- For supervised learning, LMKG-S uses deep neural networks trained on labeled subgraph patterns to predict cardinalities.
- For unsupervised learning, LMKG-U employs autoregressive models trained on sampled subgraph patterns to estimate selectivity without ground-truth labels.
- The framework uses an efficient sampling strategy to generate diverse and representative training data for both models, focusing on relevant subgraph structures rather than individual triples.
- The models are trained to capture correlations between predicates and terms, avoiding independence assumptions that degrade traditional estimation techniques.
Experimental results
Research questions
- RQ1Can deep learning models effectively estimate cardinalities in knowledge graphs despite the absence of schema and high predicate correlation?
- RQ2How does modeling subgraph patterns instead of individual triples improve estimation accuracy and efficiency?
- RQ3To what extent does the proposed SG-Encoding outperform standard encodings in representing complex query patterns for deep learning models?
- RQ4How do supervised and unsupervised variants of LMKG compare in accuracy, memory usage, and inference speed across diverse workloads?
- RQ5What are the key scalability and robustness challenges in learned cardinality estimation, and how can they be mitigated?
Key findings
- LMKG-S and LMKG-U both outperform state-of-the-art methods in estimation accuracy across real-world and synthetic datasets, with LMKG-S achieving the highest accuracy.
- LMKG-S achieves faster estimation times than all competitors except CSET, and maintains low memory usage—e.g., 43MB for k=3 on SWDF, significantly less than MSCN and CSET.
- LMKG-U shows more consistent performance across query sizes and types, though it suffers from higher memory consumption on large datasets with high term diversity.
- The SG-Encoding enables compact, informative input representations that improve model generalization and reduce training data requirements.
- Outlier queries remain a challenge for LMKG-S, but the framework supports a buffer list for handling such cases, suggesting a path for future robustness improvements.
- Memory consumption of LMKG-U increases with dataset size and term count, indicating a need for optimized sampling or dimensionality reduction in future work.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.