A neuro-symbolic framework for answering conjunctive queries

Pablo Barceló, Tamara Cucumides, Floris Geerts, Juan L. Reutter, Miguel Romero · DOI

Abstract

Knowledge Graphs (KGs) are essential for representing large-scale relational data, yet they are inherently incomplete. Answering queries on these graphs requires reasoning about missing information, a task complicated by complex query structures. This paper introduces UnRavL (Unraveling-based Learning), a neuro-symbolic framework designed to answer arbitrary graph pattern queries, including cyclic and unanchored ones. By unraveling cyclic queries into optimized tree-like approximations and employing a uniform prior for unanchored variables, UnRavL provides a safe and high-performance solution for reasoning over incomplete networks.

Introduction

Knowledge Graphs such as Freebase and NELL serve as critical backbones for various AI applications. However, their utility is often limited by incompleteness. Reasoning about "hard" answers—entities that should satisfy a query but are missing from the graph—requires models that can generalize beyond simple pattern matching. While recent neuro-symbolic models have made progress, they typically struggle with structural constraints (limited to tree-like queries) and anchoring requirements (requiring specific starting entities).

Structural Challenges in Knowledge Graph Reasoning

Existing Graph Neural Network-based Query Engines (GNN-QE) face two primary hurdles:

  1. Cyclic Patterns: Most models cannot handle queries that loop back on themselves, such as finding "triangles" of related entities.
  2. Unanchored Variables: Models often require queries to be "anchored" to specific constants. They struggle with existentially quantified variables, such as finding an entity $x$ that is friends with someone (an unknown $y$) who works at a specific company.

The UnRavL Framework

UnRavL addresses these limitations through two core innovations in its architecture.

Handling Unanchored Variables

For tree-like queries involving unanchored leaves, UnRavL introduces a latent space initialization strategy. Instead of using a specific entity's indicator vector, unanchored variables are initialized with an "all-ones" vector. This represents a uniform prior over all possible entities in the KG, allowing the model to reason about existential quantification without a fixed starting point.

The Unraveling Strategy for Cyclic Queries

To handle cyclic queries, UnRavL employs an "approximation by unraveling." This process transforms a cyclic query into a tree-like traversal of a specific depth ($d$) starting from the target variable. This approach is mathematically safe, meaning it produces no false negatives; any valid answer to the original cyclic query is guaranteed to be present in the unraveled approximation. Furthermore, it is optimal, providing the best possible tree-like over-approximation for a given depth.

Experimental Evaluation

The model was evaluated on three standard knowledge graph benchmarks: FB15k-237, FB15k, and NELL995. To address the lack of existing benchmarks for complex query classes, the authors introduced new test sets specifically for unanchored tree-like queries and various cyclic patterns, including triangles ($3c$), four-cycles ($4c$), and "lollipop" queries ($1p2c$).

Results and Key Insights

  • Superior Cyclic Performance: UnRavL consistently outperformed baselines like MPQE on complex cyclic queries, achieving higher Mean Reciprocal Rank (MRR) and Hits@1 scores across multiple datasets.
  • Versatility and Safety: The addition of cyclic and unanchored capabilities did not degrade performance on traditional anchored tree-like queries. The safety guarantee of the unraveling approach ensures reliable results even in complex graph topologies.
  • The Depth Trade-off: The parameter $d$ allows for a tunable trade-off between approximation accuracy and computational cost. While higher depth improves the approximation, it also increases the potential for "error stacking" in the neural modules.

Conclusion

UnRavL represents a significant step toward a universal neural query engine for knowledge graphs. By combining symbolic logic biases with neural predictive power, the framework effectively handles the structural complexities of real-world queries. Future work will focus on refining these over-approximations and exploring methods for exact cyclic query answering.

Summary updated

BibTeX
@inproceedings{barcelo2024neuro,
  author = {Pablo Barceló and Tamara Cucumides and Floris Geerts and Juan L. Reutter and Miguel Romero},
  title = {{A neuro-symbolic framework for answering conjunctive queries}},
  booktitle = {LoG},
  year = {2024},
  url = {https://openreview.net/forum?id=183XrFqaHN},
}
Figure