Capturing Knowledge Graphs and Rules with Octagon Embeddings

Victor Charpenay, Steven Schockaert

Abstract

Knowledge Graph Embeddings (KGEs) have traditionally struggled to balance predictive performance with logical interpretability. This paper introduces Octagon Embeddings, a geometric approach that represents relations as axis-aligned octagons. Unlike existing region-based models such as BoxE or ExpressivE, octagons are mathematically closed under both intersection and composition. This property allows the model to perfectly capture complex logical rules while remaining highly interpretable. Our evaluation on standard benchmarks FB15k-237 and WN18RR demonstrates that Octagon Embeddings achieve competitive link prediction performance and provide a robust framework for rule injection and discovery.

Introduction

Knowledge Graphs (KGs) store facts as triples $(h, r, t)$. While vector-based KGEs like TransE are effective for link prediction, they often function as "black boxes," making it difficult to verify learned logical rules or incorporate prior human knowledge. Region-based models attempt to address this by representing relations as geometric shapes. In these models, a triple is considered true if the joint embedding of the head and tail entities falls within the relation's region.

However, existing shapes face significant limitations. Box-based models cannot represent relational composition (e.g., $A \xrightarrow{r1} B \xrightarrow{r2} C \implies A \xrightarrow{r3} C$). Parallelogram-based models lack closure under composition, meaning the result of chaining two relations may not be representable within the same geometric class. Hexagons improve upon these but still fail to capture certain symmetric, irreflexive relations.

Methodology: The Octagon Framework

The proposed model represents each relation as an axis-aligned octagon in a coordinate-wise embedding space. An octagon is defined by eight parameters per dimension, establishing bounds for $x$, $y$, $y-x$ (the $u$-constraint), and $x+y$ (the $v$-constraint).

Figure 3: Geometric representation of an axis-aligned octagon defined by box constraints and diagonal bands ($u$ and $v$ constraints).

Closure and Expressivity

A key contribution of this work is the proof that octagons are closed under intersection and composition. This "closure property" ensures that any chain of logical rules can be represented by another octagon within the same framework, facilitating deep logical reasoning. Furthermore, the authors prove that octagons are "expressive enough" to represent any arbitrary knowledge graph, overcoming the theoretical limitations of hexagons.

Training and Attention

To enable training via gradient descent, hard geometric boundaries are relaxed into "soft" scores using sigmoid functions. The authors also introduce an attention-based variant ($uvxy^*$) that allows the model to dynamically weight geometric constraints, effectively "ignoring" those that do not contribute to a specific relation's semantics.

Experimental Results

The model was evaluated on the FB15k-237 and WN18RR datasets. Octagon Embeddings ($uvxy^*$) consistently outperformed the BoxE baseline and achieved results comparable to the more complex ExpressivE model.

Model WN18RR MRR FB15k-237 MRR
BoxE 45.1 33.7
Octagon ($uvxy^*$) 47.9 34.8
ExpressivE 50.8 36.2

A critical finding was the impact of the $v$-constraint ($x+y$) on the WN18RR dataset. Without this constraint, the model's performance on Hits@1 was negligible; including it allowed the model to jump to over 40%, highlighting the necessity of specific geometric symmetries for modeling lexical data.

Key Insights and Interpretability

The octagon model strikes a unique balance between simplicity and power. Analysis of the learned parameters reveals that many complex relations naturally simplify into simpler geometric primitives, such as bands or diamonds.

Figure 5: Distribution of learned parameter values across coordinates, showing peaks that suggest simplification into specific geometric sub-types.

This interpretability allows for "Rule Injection," where parameters are pre-set to represent known logical constraints (e.g., transitivity or hierarchy) without disrupting the rest of the model's learning process.

Conclusion

Octagon Embeddings provide a theoretically grounded and high-performing alternative to traditional KGEs. By leveraging the closure properties of axis-aligned octagons, the model bridges the gap between geometric representation and formal logic. Future work will explore cross-coordinate constraints to capture even more complex relational patterns and the automated mining of new rules from learned embeddings.

Summary updated

BibTeX
@inproceedings{charpenay2024capturing,
  author = {Victor Charpenay and Steven Schockaert},
  title = {{Capturing Knowledge Graphs and Rules with Octagon Embeddings}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2024},
}
Figure