Paper commentary
RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space
RotatE models relations as rotations to predict missing knowledge graph links
- Problem Existing embedding models capture only some of the symmetry, inversion and composition patterns that link prediction needs. No earlier model in the comparison handles all three at once.
- Method RotatE defines each relation as a rotation from head entity to tail entity in complex space, unlike TransE's translation. Relation elements have unit modulus, so only their phases are learned.
- Results Reached .949 MRR on WN18 and .338 MRR on FB15k-237 in the main tables, and 0.95 AUC-PR on Countries task S3.
Why link prediction needs relation patterns
A knowledge graph stores facts as triples, each linking a head entity and a tail entity through a relation, and such graphs are usually incomplete. Predicting the missing links is therefore the central task, and the common route is to learn low-dimensional vectors for entities and relations. Those vectors can only give useful predictions if they encode how relations connect entities.
Several recurring patterns matter here: symmetry, where a relation such as marriage holds in both directions; antisymmetry, where a relation such as filiation cannot hold both ways; and inversion, as with hypernym and hyponym. Composition is the third pattern, where one relation follows from a chain of two others, as when a mother's husband turns out to be one's father.
Earlier methods try to capture one or a few of these patterns, either implicitly or explicitly.
What current score functions can and cannot express
Table 1 lists score functions for TransE, DistMult, ComplEx, HolE, ConvE and RotatE. TransE treats a relation as a translation and was designed with inversion and composition in mind, whereas DistMult models three-way interactions among head, relation and tail and targets symmetry. The authors find that no earlier model in this comparison handles all three patterns at once.
For TransE the obstacle is structural: a symmetric relation would have to be a zero translation vector, which pulls the entities of a symmetric pair toward each other. ComplEx extends DistMult with complex embeddings to handle asymmetry and can infer inversion, but it does not model a bijection from head to tail, so composition is out of reach.
TorusE treats embeddings as translations on a compact Lie group with fixed moduli, and the authors regard it as a special case of RotatE with the moduli fixed. Relational path methods model paths explicitly, whereas RotatE learns the patterns implicitly, and KBGAN adds a generator that must be trained alongside the embedding model.
Relations as unit-modulus rotations in complex space
The construction starts from Euler's identity: a complex number of modulus one can be read as a rotation in the complex plane. Head and tail entities are mapped into complex vectors, and the relation is an element-wise rotation that carries the head to the tail. Coordinate by coordinate this reads \( t_i = h_i r_i \) with \( |r_i| = 1 \), and the relation is the vector \( r \) built from such elements.
Each \( r_i \) equals \( e^{i\theta_{r,i}} \), which rotates the matching entity coordinate counterclockwise by \( \theta_{r,i} \) radians. Because the modulus is fixed at one, the only free quantity in each relation element is its phase, and the phases start uniformly between 0 and 2π. For a triple the distance is \( d_r(h,t)=\|h\circ r-t\| \), where \( \circ \) is the Hadamard product, and Table 1 writes the RotatE score as the negative of this distance.
Table 1 writes the RotatE distance with a subscript 2 on the norm, while the footnote says the L1 norm is used for all distance-based models; the body follows the footnote.
The model remains linear in both time and memory, which the authors cite as the basis for scaling to large knowledge graphs. Since every element stays on the unit circle, composing two relations amounts to adding their phases, which the pattern analysis later relies on.
How rotations capture the three patterns
A relation is symmetric when each of its elements is plus or minus one, so that the rotation applied twice returns to the start, which means \( r\circ r = 1 \). Inversion holds when two relations have conjugate embeddings, so one rotation undoes the other. Composition holds when the phase of the composed relation equals the sum of the phases of the two relations it is built from.
Three lemmas state these conditions as results for symmetry/antisymmetry, inversion and composition, with proofs given in the appendix. The lemmas start from the first-order definitions of each pattern, in which a symmetric relation requires its reverse fact to hold. The comparison in Table 2 records RotatE as the only model in the set that covers all three patterns.
For a symmetric relation the construction allows nonzero embeddings that still meet the symmetry condition, so the two entities of a symmetric pair need not collapse together. The lemmas say that RotatE can infer these patterns; how well it learns them from data is a separate question that the experiments address.
Negative sampling loss and self-adversarial weighting
Training uses a logistic loss over one true triple and several corrupted triples, in the style of the negative sampling loss used for word embeddings. The loss is \( L = -\log\sigma(\gamma - d_r(h,t)) - \sum_{i=1}^{n} \frac{1}{k}\log\sigma(d_r(h'_i,t'_i)-\gamma) \), where \( \gamma \) is a fixed margin, \( \sigma \) is the sigmoid and \( (h'_i, r, t'_i) \) is the i-th negative triple.
The true triple's distance is pushed below the margin and the corrupted distances above it.
The self-adversarial scheme draws each negative from a softmax over current model scores, \( p(h'_j,r,t'_j\mid\{(h_i,r_i,t_i)\}) = \frac{\exp(\alpha f_r(h'_j,t'_j))}{\sum_i \exp(\alpha f_r(h'_i,t'_i))} \), where \( \alpha \) is the sampling temperature. Because sampling can be costly, the same probability serves as the weight of each negative term, giving \( \sum_{i=1}^{n} p(h'_i,r,t'_i)\log\sigma(d_r(h'_i,t'_i)-\gamma) \) in the loss.
KBGAN trains a separate generator alongside the embedding model, whereas this scheme depends only on the model being trained and needs no extra optimization component.
Benchmarks, tuning and evaluation protocol
Four benchmarks are used: FB15k, WN18, FB15k-237 and WN18RR. Table 3 gives FB15k 14,951 entities, 1,345 relations and 483,142 training triples. Almost 81% of FB15k test triples can be inferred from a directly linked triple, so the key patterns there are symmetry/antisymmetry and inversion.
WN18 has many inverse relations, so its main patterns are the same as FB15k's, while FB15k-237 and WN18RR remove inverse relations and leave composition as the main pattern in FB15k-237 and symmetry together with composition in WN18RR. Adam is the optimizer, and hyperparameters are tuned on the validation set over a grid: embedding dimension 125, 250, 500 or 1000, batch size 512, 1024 or 2048, temperature 0.5 or 1.0, and margin from 3 to 30.
Real and imaginary parts of entity embeddings are initialized uniformly, and no regularization is used because the fixed margin is said to guard against overfitting. A complex dimension counts as one dimension, so a complex model with the same number of dimensions carries about twice the parameters of a real one. pRotatE fixes every entity modulus to one constant, so its score depends only on phases.
Evaluation is filtered: each test triple is ranked against corrupted candidates that do not appear in the training, validation or test sets. Mean Rank, Mean Reciprocal Rank and Hits at N are the reported metrics.
Link prediction on FB15k, WN18, FB15k-237 and WN18RR
On FB15k in Table 4, RotatE reaches .797 MRR and .884 Hits at 10. DistMult has a slightly higher MRR at .798, pRotatE has .799, and DistMult's Hits at 10 is .893, so RotatE is not first on FB15k MRR in this table. On WN18 RotatE posts the highest MRR (.949) and Hits at 10 (.959) among the listed models, with pRotatE at .947 MRR.
On FB15k-237 in Table 5, RotatE reaches .338 MRR and .533 Hits at 10, against .325 MRR for ConvE and .328 MRR for pRotatE. On WN18RR it reaches .476 MRR and .571 Hits at 10, against .43 MRR for ConvE and .462 MRR for pRotatE. The gap to pRotatE is larger on FB15k-237 (.338 against .328) and WN18RR (.476 against .462) than on FB15k (.797 against .799) and WN18 (.949 against .947).
The authors read this gap as evidence that the modulus matters, and they link it to the many composition patterns in FB15k-237 and WN18RR. The introduction describes RotatE as the first model to reach state-of-the-art performance on all benchmarks; in these tables it leads on WN18, FB15k-237 and WN18RR by MRR, but not on FB15k.
The per-dataset ranking is read against the pattern analysis: on FB15k, ComplEx does well and TransE does poorly, which fits ComplEx covering symmetry and inversion while TransE does not cover symmetry. DistMult does well on FB15k even though it lacks antisymmetry and inversion; the reading offered is that most relations pair entities of different types, so a reversed triple is rarely valid.
On WN18 DistMult drops sharply, which is attributed to nearly all entities being words of one type, so the type cue that helped on FB15k is absent. On FB15k-237 TransE does well and ComplEx does not, which is tied to TransE handling composition and ComplEx not. On WN18RR TransE is weak, which is tied to symmetric relations such as also see and similar to.
Composition inference on Countries
The Countries benchmark has 2 relations and 272 entities: 244 countries, 5 regions and 23 subregions. Task S2 needs neighborOf(c1, c2) with locatedIn(c2, r) to imply locatedIn(c1, r), and S3 adds an intermediate subregion, so the chain is one step longer.
Results are AUC-PR: RotatE scores 1.00 on S1, 1.00 on S2 and 0.95 on S3. ConvE scores 0.86 on S3, DistMult 0.52 and ComplEx 0.43; these scores are taken from prior work, not from runs in this paper. S3 is the hardest task, and the reported margin there is the one the authors emphasize.
Those AUC-ROC values cannot be compared directly with the AUC-PR table. The authors attribute the TransE result to Countries having no symmetric relations between regions, so TransE's weakness on symmetry does not affect it there.
Are the three patterns visible in learned phases?
The check uses histograms of relation phases \( \theta_{r,i} \) for individual relations. A general relation such as hypernym does not show this ±1 pattern.
For inversion, adding the phases of hypernym and its inverse hyponym element-wise gives values at 0 or 2π, so one relation is the inverse of the other. Composition is hard to see on WN18, which has little composition, so this analysis moves to a 1000-dimensional RotatE trained on FB15k-237.
For the composed relation \( r_1 = r_2 \circ r_3 \), the phase sums \( \theta_{2,i}+\theta_{3,i} \) equal \( \theta_{1,i} \) or \( \theta_{1,i}+2\pi \), shown for for1, winner and for2 with their composition. These are histograms of selected relations, so they show the patterns appearing in phases without proving that they hold for every relation.
The pattern matches what the lemmas predict, but the histograms are observations and not proofs.
Self-adversarial sampling against uniform and KBGAN
The comparison trains a 50-dimension TransE with the margin-based ranking criterion used in the KBGAN paper, and tests uniform sampling, self-adversarial sampling and KBGAN. On FB15k-237 the MRR is .242 with uniform sampling, .278 with KBGAN and .298 with self-adversarial sampling. On WN18RR the MRRs are .186, .210 and .223, and on WN18 they are .433, .705 and .736.
On WN18 Hits at 10 is .915 for uniform, .949 for KBGAN and .947 for self-adversarial, so KBGAN leads on that one metric. The reading is that self-adversarial sampling is the most effective of the three on MRR, and it is the strongest on two of the three datasets for MRR.
Table 8 applies self-adversarial sampling and the negative sampling loss to TransE, ComplEx and RotatE alike, so the three share the training scheme. On FB15k MRR is .735 for TransE, .780 for ComplEx and .797 for RotatE, while Hits at 10 is .871, .890 and .884. On FB15k-237 MRR is .332, .319 and .338 for TransE, ComplEx and RotatE, and Hits at 10 is .531, .509 and .533.
Under this shared scheme RotatE still has the highest MRR on both datasets, so the RotatE gain is not from sampling alone.
FB15k results by relation category
Table 9 reports Hits at 10 and MRR separately for head and tail prediction in each category. For head prediction on one-to-one relations RotatE reaches .878 MRR, and on one-to-many relations it reaches .934 MRR.
The first three rows come from He et al. (2015), and the remaining rows are RotatE trained with self-adversarial sampling. On many-to-one head prediction RotatE's Hits at 10 is .602, below ComplEx at .692. The paper says RotatE performs well on non-injective relations, especially many-to-many ones.
KG2E KL (bern) reports higher Hits at 10 than TransH (bern) in every category, for both head and tail prediction. KG2E is a probabilistic framework built on TransE that models uncertainty in entities and relations, and the authors take its consistent advantage as evidence that uncertainty matters. Modeling uncertainty with RotatE is left to future work.
Limits of the evidence
Experiments cover four benchmarks and Countries, and extending to more datasets is listed as future work. On FB15k RotatE's MRR is not the highest in Table 4, so the introduction's state-of-the-art claim is narrower on that dataset.
The Table 7 uniform and KBGAN rows for TransE are taken from the KBGAN paper, while the self-adversarial row is a separate 50-dimension TransE re-implementation. The DistMult, ComplEx and ConvE Countries scores come from Dettmers et al. (2017) rather than from runs in this paper.
The pRotatE to RotatE gap is small on FB15k and WN18, and the reading of the larger gap on FB15k-237 and WN18RR as a modulus effect rests on those two datasets. Modeling uncertainty of entities and relations with RotatE is left for later work.
Paper info
- Authors
- Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Nie, Jian Tang
- Venue
- arXiv · Preprint
- First published
- 2019-2-26
- Added
- 2026-11-12
- Updated
- 2019-2-26
- Version
- v1
- arXiv
- 1902.10197
- Category
- cs.LG · cs.CL · stat.ML
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Nie, Jian Tang (2019). RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space. arXiv:1902.10197v1. https://arxiv.org/abs/1902.10197v1
BibTeX
@misc{sun2019rotate,
title = {{RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space}},
author = {Zhiqing Sun and Zhi-Hong Deng and Jian-Yun Nie and Jian Tang},
year = {2019},
eprint = {1902.10197},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1902.10197v1}
}