cs.LGAug 24, 2026

Hierarchy-Aware Semantic Losses for Knowledge Graph Link Prediction

Authors: Filip Kronström, Ross D. King

Organizations: Department of Computer Science and Engineering, Chalmers University of Technology and University of Gothenburg, Sweden · Department of Chemical Engineering and Biotechnology, University of Cambridge, United Kingdom

Abstract

Knowledge graphs are often accompanied by ontological class hierarchies that encode valuable semantic information, yet many link prediction methods either ignore such hierarchies or incorporate them indirectly through additional graph edges. Recent work introduced hierarchy-aware graph neural networks (GNNs), which use semantic losses derived from box embeddings to encourage satisfaction of subclass relationships during GNN-based representation learning. While this approach has shown promise for biological regression tasks, its effectiveness for knowledge graph link prediction has not been investigated. In this paper we evaluate hierarchy-aware semantic losses on link prediction across three benchmark datasets: AIFB, CoDEx, and BioKG. We combine graph neural network encoders with box-embedding-based semantic losses that encourage learned representations to better satisfy ontology-derived class hierarchies, and compare this approach to both standard link prediction models and models incorporating subclass relations as graph edges. Across all datasets, hierarchy-aware semantic losses significantly improve mean reciprocal rank (MRR) and consistently outperform models that incorporate hierarchy information through additional subclass edges. Relative to the baseline GNN models, MRR improved by 7.6%, 2.4%, and 15.5% on AIFB, CoDEx, and BioKG, respectively. Furthermore, semantic losses consistently outperform the alternative of augmenting the graph with subclass edges. These results are consistent with ontology-derived class hierarchies providing complementary information to graph structure, and suggest that encouraging hierarchical consistency through semantic losses is an effective and comparatively parameter-efficient mechanism for improving knowledge graph link prediction.

Figures & tables

Appendix figures & tables2 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Graph Neural Network based Hierarchy-Aware Embeddings of Knowledge Graphs: Applications to Yeast Phenotype Prediction

    May 5, 2026Filip Kronström, Alexander H. Gower, Daniel Brunnsåker +2Graph Neural NetworksRepresentation Learning

  2. Leveraging Graph Structure in Seq2Seq Models for Knowledge Graph Link Prediction

    May 18, 2026Luu Huu Phuc, Ratan Bahadur Thapa, Mojtaba Nayyeri +3Sequence ModelingKG Completion

  3. Half a Link can Be Enough to Predict a Whole Link: Understanding Generalization in Knowledge Graph Foundation Models

    Jun 16, 2026Cosimo Gregucci, Obaidah Theeb, Daniel Hernandez +2Cross-Domain GeneralizationGraph Foundation Models