Abstract
Knowledge Graph (KG) completion is a critical task for large-scale databases like Freebase and WordNet. While TransE introduced an efficient translation-based embedding method ($h + r \approx t$), it struggles with complex mapping properties such as one-to-many (1-N), many-to-one (N-1), and many-to-many (N-N) relations. We present TransH (Translation on Hyperplanes), which models relations as translations on relation-specific hyperplanes. By projecting entity embeddings onto these hyperplanes, TransH allows entities to have different representations depending on the relation context. Experimental results show that TransH significantly outperforms TransE on complex relations while maintaining comparable efficiency and scalability.
Introduction
Knowledge Graphs are massive repositories of structured facts, typically represented as triplets $(h, r, t)$. Despite their size, they are often incomplete. Knowledge Graph Embedding (KGE) methods aim to map entities and relations into a continuous vector space to predict missing links.
The TransE model was a breakthrough due to its simplicity and efficiency, using the principle that the tail embedding should be the translation of the head embedding by the relation vector. However, TransE's rigid structure leads to "collapsed" embeddings for complex relations. For instance, in a 1-N relation where a director $h$ directed multiple movies $t_1, t_2, \dots$, TransE forces all movie embeddings to be nearly identical to satisfy $h + r \approx t_i$.
Methodology: Translation on Hyperplanes
To overcome the limitations of TransE, TransH introduces relation-specific hyperplanes. Instead of a single vector space for all relations, each relation $r$ is characterized by two vectors: a norm vector $w_r$ of a hyperplane and a translation vector $d_r$ within that hyperplane.
Projection and Scoring
For a triplet $(h, r, t)$, the entity embeddings $h$ and $t$ are first projected onto the hyperplane defined by $w_r$: $$h_\perp = h - w_r^\top h w_r$$ $$t_\perp = t - w_r^\top t w_r$$
The score function then measures the translation distance within this projected space: $$f_r(h, t) = \|h_\perp + d_r - t_\perp\|_2^2$$
This mechanism allows an entity to assume different "roles" depending on the relation. For example, an entity representing a person would have different projected embeddings when involved in a "Director" relation versus a "Place of Birth" relation.
Bernoulli Sampling
Training KGE models involves generating negative triplets by corrupting positive ones. Standard uniform sampling often creates "false negatives," especially in 1-N or N-1 relations. TransH employs a Bernoulli sampling strategy that adjusts the probability of replacing the head or tail based on the mapping properties of the relation, leading to more effective training gradients.
Evaluation and Results
TransH was evaluated on standard benchmarks including WordNet (WN18, WN11) and Freebase (FB15k, FB13, FB5M).
Link Prediction
On the FB15k dataset, TransH achieved a Hits@10 of 64.4%, a significant improvement over TransE’s 47.1%. The gains were most pronounced in complex mapping scenarios. For 1-N relations, the Hits@10 for tail prediction jumped from 19.7% (TransE) to 39.8% (TransH).
Triplet Classification
The model also demonstrated superior discriminative power in triplet classification tasks, effectively distinguishing true facts from noise.
Scalability
Testing on the FB5M dataset (5 million entities, 19 million triplets) confirmed that TransH remains highly scalable. It provides a significant boost in modeling capacity with only a marginal increase in parameter count (one additional vector per relation).
Conclusion
TransH successfully addresses the "flaw" of TransE regarding complex relations by introducing hyperplane projections. This approach provides entities with distributed, context-aware representations while preserving the efficiency that makes translation-based models attractive for large-scale KGs. Future work may explore non-linear projections or the integration of external text data to further enhance embedding quality.
Summary updated