Introduction
Knowledge graphs (KGs) like Freebase and WordNet represent facts as triplets in the form (head, relation, tail). However, these graphs are often incomplete, necessitating machine learning models to predict missing links. To perform this task effectively, a model must be capable of inferring fundamental logical patterns between relations, specifically symmetry/antisymmetry, inversion, and composition.
Previous state-of-the-art models often struggled to capture all three patterns simultaneously. For example, TransE (which models relations as translations) handles inversion and composition but fails at symmetry. Conversely, ComplEx handles symmetry and inversion but struggles with composition. This paper introduces RotatE, a model designed to capture all three crucial patterns within a single, scalable framework.
The RotatE Model
RotatE maps entities and relations into a complex vector space ($\mathbb{C}^k$). The core innovation is treating a relation as an element-wise rotation from the head entity to the tail entity. Mathematically, for a triplet (h, r, t), the model expects $\mathbf{t} = \mathbf{h} \circ \mathbf{r}$, where $\circ$ denotes the Hadamard (element-wise) product.
By constraining relation embeddings to have a modulus of 1 ($|r_i| = 1$), the relation vector acts purely as a rotation in the complex plane, shifting the phase (angle) of the head entity to match the tail. This formulation elegantly addresses the target logical patterns:
- Symmetry: A relation is its own inverse if it applies a 180-degree rotation ($\pi$), leading the model to learn phases of $0$ or $\pi$.
- Inversion: Two relations are inverses if their rotations are in opposite directions (complex conjugates).
- Composition: A relation is a composition of two others if its rotation angle is the sum of their respective angles.
Self-Adversarial Negative Sampling
To improve training efficiency, the authors introduce self-adversarial negative sampling. Standard distance-based models often stall when uniform random sampling produces "easy" negative examples. This new technique samples negative triplets based on the current model's probability distribution, forcing the model to focus on the "hardest" fake examples. This approach significantly boosts performance not only for RotatE but also for baseline models like TransE and ComplEx.
Experimental Evaluation
RotatE was evaluated on several standard benchmarks, including FB15k-237, WN18RR, and the Countries dataset. The results demonstrate state-of-the-art performance:
- FB15k-237: RotatE achieved a Mean Reciprocal Rank (MRR) of .338, significantly outperforming ComplEx (.247) and ConvE (.325).
- WN18RR: The model reached an MRR of .476, surpassing ConvE (.430).
- Countries Dataset: On the hardest task (S3), which requires multi-step composition, RotatE achieved an AUC-PR of 0.95, nearly doubling the performance of ComplEx (0.43).
Discussion and Insights
One of the most compelling findings is that RotatE naturally learns logical rules without explicit programming. By analyzing the trained relation embeddings, the authors found that the model's phases converged to specific values representing logical properties. For instance, symmetric relations naturally converged to phases of exactly $0$ or $\pi$.
Furthermore, an ablation study using a phase-only model (pRotatE) showed that while the phase handles relational logic, the modulus is essential for modeling complex compositions in harder datasets like FB15k-237.
Conclusion
RotatE provides a simple yet powerful framework for knowledge graph embedding by leveraging the properties of complex rotations. While the current model is deterministic, future work aims to integrate probabilistic frameworks to better model the inherent uncertainties in 1-to-N and N-to-N relations.
Summary updated