LogicENN: A Neural Based Knowledge Graphs Embedding Model With Logical Rules

Mojtaba Nayyeri, Chengjin Xu, Mirza Mohtashim Alam, Jens Lehmann, Hamed Shariat Yazdi

Introduction

Knowledge Graphs (KGs) represent information as triples (head entity, relation, tail entity). Despite their utility, KGs are often incomplete. Knowledge Graph Embedding (KGE) models address this by mapping entities and relations into vector spaces to predict missing links. However, traditional models like TransE often struggle with complex logical properties, such as symmetry, without compromising entity representations.

LogicENN is a novel neural-based KGE model that bridges the gap between deep learning and symbolic logic. It is the first neural embedding model proven to be "fully expressive"—capable of learning any ground truth in a KG—while efficiently incorporating complex logical rules without the computational burden of exhaustive grounding.

Architecture and Methodology

The core innovation of LogicENN lies in its neural network architecture, which treats entity pairs as inputs and relations as outputs. Unlike models that assign fixed vectors to each relation, LogicENN utilizes a shared "Universal Mapping" across all relations.

LogicENN Architecture: A shared universal mapping layer followed by relation-specific output weights.

The plausibility of a triple $(h, r, t)$ is calculated using a score function $f^r_{h,t} = \Phi_{h,t}^T \beta^r$, where $\Phi_{h,t}$ represents the feature mapping from shared hidden layers, and $\beta^r$ denotes the specific relation weights. This structure allows the model to learn a universal way to relate entities before specializing for specific relations in the final layer.

Grounding-Free Rule Injection

LogicENN incorporates logical rules (e.g., symmetry, inversion, transitivity) directly into the loss function via algebraic formulas. Crucially, for implication ($r_1 \Rightarrow r_2$) and equivalence ($r_1 \Leftrightarrow r_2$), the model enforces rules by constraining relation weights ($\beta$) alone. This approach bypasses the need for "grounding"—the expensive process of generating every possible triple that satisfies a rule. To handle real-world noise, slack variables ($\xi$) are introduced to provide flexibility during training.

Experimental Results

The model was evaluated on standard benchmarks: FB15k, WN18, and FB15k-237. LogicENN demonstrated significant improvements over state-of-the-art models in link prediction tasks.

Performance comparison of LogicENN against state-of-the-art models on FB15k and WN18 datasets.

On the FB15k dataset, LogicENN achieved a Hits@10 of 87.4% (filtered), outperforming models like RUGE and ComplEx-NNE+AER. On the more challenging FB15k-237 dataset, which removes simple inverse relations, the model achieved a Hits@10 of 47.3% (filtered), indicating its capacity for genuine relational reasoning. Furthermore, the inclusion of symbolic knowledge proved highly effective; adding the "Inverse" rule alone improved the Mean Rank (MR) on FB15k from 320 to 187.

Key Insights and Conclusion

LogicENN's "Full Expressivity" (Theorem 1) provides a theoretical guarantee that the architecture can represent any set of true facts in a KG. By sharing hidden layers, the model achieves parameter efficiency while maintaining high performance.

While LogicENN significantly advances KGE by avoiding the grounding explosion for certain rules, some rules like transitivity still require grounding in the current formulation. Future work may explore extending the model to n-ary relations and further optimizing the hyperparameter search for slack variables. Overall, LogicENN represents a major step toward integrating symbolic reasoning with deep learning for knowledge representation.

Summary updated

BibTeX
@article{nayyeri2019logicenn,
  author = {Mojtaba Nayyeri and Chengjin Xu and Mirza Mohtashim Alam and Jens Lehmann and Hamed Shariat Yazdi},
  title = {{LogicENN: A Neural Based Knowledge Graphs Embedding Model With Logical Rules}},
  journal = {IEEE Trans. Pattern Anal. Mach. Intell.},
  year = {2019},
  doi = {10.1109/tpami.2021.3121646},
}
Figure