Logic Embeddings for Complex Query Answering

Francois P. S. Luus, Prithviraj Sen, Pavan Kapanipathi, Ryan Riegel, Ndivhuwo Makondo, Thabang Lebese, Alexander G. GrayarXiv 2021

Introduction

Knowledge Graphs (KGs) such as Freebase and NELL are foundational for modern AI, yet they are inherently incomplete. Answering complex queries—those involving multiple relations and logical operators like AND, OR, and NOT—requires models that can perform both link prediction and multi-step reasoning. Traditional methods often struggle with negation or the computational overhead of modeling uncertainty.

This paper introduces Logic Embeddings (LOGICE), a framework that represents queries as vectors of truth bounds. By leveraging Skolemisation and fuzzy logic t-norms, LOGICE provides a faster and more accurate approach to complex query answering (CQA) on massive, incomplete datasets.

The LOGICE Framework

The core innovation of LOGICE lies in its transition from First-Order Logic (FOL) to a more computationally efficient "Skolem set logic." This allows the model to treat sets of potential entities as single "lifted" elements, making the mathematics of reasoning significantly more efficient than tracking individual entities.

Overview of the LOGICE framework showing Skolemisation, logical negation, and real-valued logic operations.

Skolemisation and Truth Bounds

Instead of representing a query as a single point or a complex probability density, LOGICE uses an $n$-tuple of intervals $[l, u]$ between 0 and 1. These bounds represent the "truth value" of latent propositions that describe the answer set. This interval-based approach allows the model to capture uncertainty: a wide interval (high entropy) suggests a large or uncertain answer set, while a narrow interval suggests a specific, well-defined set of entities.

Logical Operations via T-norms

To handle logical operators, LOGICE employs t-norms—mathematical functions from fuzzy logic that provide a strong inductive bias for reasoning.

  • Intersection (AND): Modeled using t-norm operators such as Minimum, Product, or Łukasiewicz.
  • Negation (NOT): Handled naturally as a simple inversion of the truth interval: $\neg[l, u] = [1-u, 1-l]$. This is a significant improvement over box-based embeddings, where the complement of a box is not easily represented as another box.
  • Union (OR): Handled via corresponding t-conorms.
Visualization of truth bounds and logical operations for a query involving film awards and starring relations.

To evaluate candidate entities, LOGICE uses a simple $L_1$-norm to measure how well an entity's embedding satisfies the query's truth bounds, avoiding the expensive numerical integrations required by distribution-based methods.

Experimental Evaluation

The model was benchmarked on standard large-scale KG datasets: FB15k, FB15k-237, and NELL995. The evaluation covered 14 distinct query structures, including multi-hop paths and complex logical combinations.

Key Results

  • Superior Accuracy: LOGICE outperformed previous state-of-the-art models (BetaE, Q2B, GQE) across nearly all query forms. It was particularly effective at handling negation queries, showing a clear lead in Mean Reciprocal Rank (MRR).
  • 2-3x Training Speedup: On NVIDIA Tesla V100 hardware, LOGICE trained 2 to 3 times faster than Beta Embeddings. This efficiency stems from using simple interval arithmetic rather than complex probability density functions.
  • Better Uncertainty Modeling: LOGICE demonstrated a much higher Spearman’s rank correlation between its internal entropy and the actual size of the answer set compared to previous methods. In cardinality prediction experiments, LOGICE reduced prediction error to 83% (compared to 96% for BetaE).

Conclusion

LOGICE represents a significant advancement in neural symbolic reasoning. By combining the efficiency of vector embeddings with the formal rigor of t-norm logic, it provides a scalable and accurate solution for querying incomplete knowledge bases. Future work may explore "attention-based" logic to better capture contextual relations within specific query domains.

Summary updated

BibTeX
@misc{luus2021logic,
  author = {Francois P. S. Luus and Prithviraj Sen and Pavan Kapanipathi and Ryan Riegel and Ndivhuwo Makondo and Thabang Lebese and Alexander G. Gray},
  title = {{Logic Embeddings for Complex Query Answering}},
  year = {2021},
  eprint = {2103.00418},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.00418},
}
Figure