Learning Hierarchy-Aware Knowledge Graph Embeddings for Link Prediction

Zhanqiu Zhang, Jianyu Cai, Yongdong Zhang, Jie Wang

Abstract

Knowledge graph (KG) embeddings are essential for tasks such as link prediction, yet traditional models often struggle to capture the semantic hierarchies inherent in many datasets. We present HAKE (Hierarchy-Aware Knowledge Graph Embedding), a novel approach that maps entities into a polar coordinate system. By utilizing the radial coordinate to represent hierarchical depth and the angular coordinate to distinguish between entities at the same level, HAKE effectively models tree-like structures. Our experiments on benchmark datasets like WN18RR and YAGO3-10 demonstrate that HAKE significantly outperforms existing state-of-the-art models.

Introduction

Knowledge graphs are massive networks of facts represented as triples, such as (dog, is_a, mammal). To leverage these graphs in machine learning, entities and relations are embedded into low-dimensional vector spaces. While models like TransE and RotatE successfully capture logical patterns like symmetry and inversion, they often fail to represent semantic hierarchies. In a hierarchy, entities exist at different levels of generality (e.g., mammal vs. golden retriever). Standard models frequently struggle to distinguish between these levels or between "sibling" entities at the same depth.

Methodology

HAKE addresses these limitations by representing entities in a polar coordinate system $(r, \theta)$. The model consists of two primary components:

  1. The Modulus Part (Radial): This component models hierarchical depth. Inspired by tree structures, entities at higher levels (closer to the root) are expected to have smaller radii. The relation acts as a scaling factor: $h_m \circ r_m = t_m$.
  2. The Phase Part (Angular): This component distinguishes entities at the same hierarchical level. Even if two entities share the same radius, they can be separated by their angular positions using a rotation-like transformation: $(h_p + r_p) \mod 2\pi = t_p$.
Figure 1: Mapping a hierarchical tree structure to a polar coordinate system. The radius represents depth, while the angle distinguishes siblings.

By combining these parts, HAKE places "parent" entities in smaller inner circles and "child" entities in larger outer circles, while spreading "sibling" entities along the circumference.

Experimental Evaluation

We evaluated HAKE on three standard benchmark datasets:

  • WN18RR: A subset of WordNet rich in hierarchical relations (e.g., hypernyms).
  • FB15k-237: A subset of Freebase with complex, non-hierarchical relations.
  • YAGO3-10: A large-scale dataset where entities often have high connectivity.

Key Results and Discussion

HAKE achieved new state-of-the-art results, particularly on hierarchical datasets. On WN18RR, HAKE reached an MRR (Mean Reciprocal Rank) of 0.497, surpassing RotatE's 0.476. On YAGO3-10, the improvement was even more significant, with an MRR of 0.545 compared to RotatE's 0.495—a 10% relative gain.

Figure 4: Histograms of modulus/phase distributions for various relations. HAKE effectively distinguishes between hierarchical relations (like hypernyms) and non-hierarchical ones (like similar_to).

As shown in the distributions above, HAKE successfully learns to separate entities based on the nature of the relation. For hierarchical relations like _hypernym, the model produces distinct modulus shifts, whereas for symmetric relations like _similar_to, the modulus remains centered around 1.0. This empirical evidence confirms that HAKE automatically learns hierarchical structures from raw triples without requiring external type information.

Conclusion

HAKE provides a geometrically intuitive and highly effective framework for modeling hierarchies in knowledge graphs. While its primary strength lies in hierarchical data, future work will explore extending this polar framework to better handle complex non-hierarchical relations found in datasets like FB15k-237.

Summary updated

BibTeX
@inproceedings{zhang2020learning,
  author = {Zhanqiu Zhang and Jianyu Cai and Yongdong Zhang and Jie Wang},
  title = {{Learning Hierarchy-Aware Knowledge Graph Embeddings for Link Prediction}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i03.5701},
}
Figure