SpaceE: Knowledge Graph Embedding by Relational Linear Transformation in the Entity Space

Jinxing Yu, Yunfeng Cai, Mingming Sun, Ping Li

Introduction

Knowledge Graphs (KGs) serve as the backbone for various AI applications, from recommendation engines to question-answering systems, by storing information as triples in the form of (head entity, relation, tail entity). To utilize this structured data in machine learning, researchers use Knowledge Graph Embedding (KGE) frameworks to map entities and relations into a continuous mathematical vector space.

Historically, popular models such as TransE (which treats relations as translations) and RotatE (which treats them as rotations) have dominated the field. However, these models share a fundamental limitation: they rely on injective operations. In an injective mapping, every unique input must map to a unique output. While mathematically elegant, this does not reflect real-world data. Many relations are non-injective, such as starred_in (many actors in one movie) or wasBornIn (many people in one city). When injective models attempt to represent these many-to-one or many-to-many relationships, they often "collapse" the entity space, forcing distinct entities to have nearly identical embeddings to satisfy the geometric constraints. This paper introduces SpaceE, a framework designed to overcome these limitations by modeling relations as linear transformations in the entity space.

The SpaceE Framework

SpaceE moves beyond simple vectors by representing entities as $p \times q$ matrices and relations as $q \times q$ square matrices. This shift allows for a more expressive transformation mechanism.

The Score Function

A fact is considered likely to be true if the transformation of the head entity by the relation matrix approximates the tail entity. Formally, the model seeks to satisfy $HR \approx T$, where $H$ is the head matrix, $R$ is the relation matrix, and $T$ is the tail matrix. The "distance" or error of a triple is measured using the Frobenius norm.

Singularity as a Feature

The core innovation of SpaceE is its handling of singular matrices. Unlike previous models that require transformations to be invertible, SpaceE allows the relation matrix $R$ to have a determinant of zero. Mathematically, a singular matrix can map multiple distinct input matrices to the same output matrix. This property perfectly mirrors the "many-to-one" nature of real-world relations, allowing the model to represent complex relationships without sacrificing the distinctness of entity embeddings.

Training and Regularization

To ensure robust learning, the authors implement two key strategies:

  1. Reciprocal Learning: The model learns both a forward relation $R$ and a reverse relation $\hat{R}$ such that $T\hat{R} \approx H$, improving performance on both head and tail prediction tasks.
  2. Orthogonal Regularization: A regularization term is used to encourage relation matrices to remain nearly orthogonal. This preserves the structural integrity of the embedding space during training while still providing the flexibility for matrices to become singular when the data requires it.

Theoretical Advantages

SpaceE is not just a new model but a generalization of existing ones. The authors provide a mathematical proof that RotatE is a restricted, special case of SpaceE. By utilizing a more general matrix form, SpaceE retains the strengths of rotation-based models while gaining the ability to model more complex logical patterns.

Furthermore, SpaceE excels at relational composition. It can distinguish between Abelian (commutative) and non-Abelian (order-dependent) compositions. For instance, it can correctly model that the sequence of relations "mother of father" results in a different entity than "father of mother," a nuance that simpler models often struggle to capture.

Experimental Results

The model was evaluated against five standard benchmarks: FB15k, WN18, FB15k-237, WN18RR, and YAGO3-10. SpaceE achieved state-of-the-art or highly competitive results, particularly in datasets characterized by high relational complexity.

  • YAGO3-10: In this large-scale dataset featuring many descriptive attributes (e.g., worksAt), SpaceE significantly outperformed RotatE and BoxE. It achieved a Hits@10 of 0.702, compared to RotatE's 0.670, validating its effectiveness in handling non-injective data.
  • FB15k-237: SpaceE reached a Mean Reciprocal Rank (MRR) of 0.351. Notably, in a breakdown of Many-to-Many (N-N) relations, SpaceE showed a substantial performance jump over RotatE, proving that the matrix transformation approach successfully manages relational uncertainty.

Conclusion and Future Work

SpaceE represents a significant step forward in KGE by addressing the injectivity bottleneck. By allowing relational transformations to be singular, it provides a mathematically grounded way to represent the complex, overlapping relationships found in real-world knowledge.

While the model is more computationally expensive than vector-based models like TransE—requiring more memory to store matrix representations—the authors mitigated this by optimizing matrix dimensions. Future work may involve applying this linear transformation approach to other domains, such as causal discovery, or further optimizing the hyperparameter selection process for different graph topologies.

Summary updated

BibTeX
@inproceedings{yu2022spacee,
  author = {Jinxing Yu and Yunfeng Cai and Mingming Sun and Ping Li},
  title = {{SpaceE: Knowledge Graph Embedding by Relational Linear Transformation in the Entity Space}},
  booktitle = {HT},
  year = {2022},
}
Figure