RotatE is a knowledge graph embedding model that represents each relation as a rotation in complex vector space ā mapping entity pairs through element-wise phase rotations, enabling explicit and provable modeling of all four fundamental relational patterns (symmetry, antisymmetry, inversion, and composition) that characterize real-world knowledge graphs.
What Is RotatE?
- Definition: An embedding model where each relation r is a vector of unit-modulus complex numbers (rotations), and a triple (h, r, t) is plausible when t ā h ā r ā the tail entity equals the head entity after element-wise rotation by the relation vector.
- Rotation Constraint: Each relation component r_i has |r_i| = 1 ā representing a pure phase rotation Īø_i ā the entity embedding is rotated by angle Īø_i in each complex dimension.
- Sun et al. (2019): The RotatE paper provided both the geometric model and theoretical proofs that rotations can capture all four fundamental relation patterns, improving on ComplEx and TransE.
- Connection to Euler's Identity: The rotation r_i = e^(iĪø_i) connects to Euler's formula ā RotatE is fundamentally about angular transformations in complex vector space.
Why RotatE Matters
- Provable Pattern Coverage: RotatE is the first model proven to explicitly handle all four fundamental patterns simultaneously ā previous models handle subsets.
- State-of-the-Art: RotatE achieves significantly higher MRR and Hits@K than TransE and DistMult on major benchmarks ā the geometric constraint is practically beneficial.
- Interpretability: Relation vectors encode angular transformations ā the "IsCapitalOf" relation corresponds to specific rotation angles that consistently map country embeddings to capital embeddings.
- Inversion Elegance: The inverse of relation r is simply -Īø ā relation inversion is just negating the rotation angles, making inverse relation modeling trivial.
- Composition: Rotating by r1 then r2 equals rotating by r1 + r2 ā compositional reasoning maps to angle addition.
The Four Fundamental Relation Patterns
Symmetry (MarriedTo, SimilarTo):
- Requires: Score(h, r, t) = Score(t, r, h).
- RotatE: r = e^(iĻ) for each dimension ā rotation by Ļ is its own inverse. h ā r = t implies t ā r = h.
Antisymmetry (FatherOf, LocatedIn):
- Requires: if (h, r, t) is true, (t, r, h) is false.
- RotatE: Any non-Ļ rotation is antisymmetric ā rotation by Īø ā Ļ maps h to t but not t back to h.
Inversion (HasChild / HasParent):
- Requires: if (h, r1, t) then (t, r2, h) for inverse relation r2.
- RotatE: r2 = -r1 (negate all angles) ā perfect inverse by angle negation.
Composition (BornIn + LocatedIn ā Citizen):
- Requires: if (h, r1, e) and (e, r2, t) then (h, r3, t) where r3 = r1 ā r2.
- RotatE: r3 = r1 ā r2 (angle addition) ā relation composition is complex multiplication.
RotatE vs. Predecessor Models
| Pattern | TransE | DistMult | ComplEx | RotatE |
|---------|--------|---------|---------|--------|
| Symmetry | No | Yes | Yes | Yes |
| Antisymmetry | Yes | No | Yes | Yes |
| Inversion | Yes | No | Yes | Yes |
| Composition | Yes | No | No | Yes |
Benchmark Performance
| Dataset | MRR | Hits@1 | Hits@10 |
|---------|-----|--------|---------|
| FB15k-237 | 0.338 | 0.241 | 0.533 |
| WN18RR | 0.476 | 0.428 | 0.571 |
| FB15k | 0.797 | 0.746 | 0.884 |
| WN18 | 0.949 | 0.944 | 0.959 |
Self-Adversarial Negative Sampling
RotatE introduced a novel training technique ā sample negatives with probability proportional to their current model score (harder negatives get higher sampling probability), significantly improving training efficiency over uniform negative sampling.
Implementation
- PyKEEN: RotatEModel with self-adversarial sampling built-in.
- DGL-KE: Efficient distributed RotatE for large-scale knowledge graphs.
- Original Code: Authors' implementation with self-adversarial negative sampling.
- Constraint: Enforce unit modulus by normalizing relation embeddings after each update.
RotatE is geometry-compliant logic ā mapping the abstract semantics of knowledge graph relations onto the precise mathematics of angular rotation, proving that the right geometric inductive bias dramatically improves the ability to reason over structured factual knowledge.