HyperCL: A Contrastive Learning Framework for Hyper-Relational Knowledge Graph Embedding with Hierarchical Ontology

Yuhuan Lu, Weijian Yu, Xin Jing, Dingqi YangACL 2024

Introduction

Knowledge Graphs (KGs) are foundational for many AI applications, typically representing information as simple triplets. However, real-world data often requires "hyper-relational" representations where base facts are augmented with qualifiers. For instance, a software release fact might include versioning and platform details. While embedding models for these complex facts exist, they frequently overlook the hierarchical ontology—the structured categorization of entities.

Existing approaches that attempt to incorporate ontology face two primary challenges:

  1. Hierarchy Neglect: Categories are often treated as flat labels, ignoring the rich parent-child relationships (e.g., "macOS" is a subclass of "Operating System," which is a subclass of "Software").
  2. Data Imbalance (The Dominance Issue): The massive volume of instance-level facts often overwhelms the relatively sparse ontological concepts during joint training, rendering the ontology less effective.
A hyper-relational fact (left) and its corresponding hierarchical ontology (right) for the entity 'Apple'.

The HyperCL Framework

To address these issues, the authors introduce HyperCL, a contrastive learning framework designed to be integrated into existing encoder-decoder KG models. HyperCL decouples the learning of instance facts and ontological concepts, aligning them through a dual-view approach.

Architecture Overview

The framework consists of two primary components:

  • Relation-Aware Graph Attention Networks (GATs): These specialized GATs process the ontology by distinguishing between different relationship types, such as instance_of and subclass_of. This allows the model to effectively traverse the hierarchy and capture high-level conceptual information.
  • Concept-Aware Contrastive Learning (CCL): This is the core mechanism that aligns the "Instance View" (based on facts) with the "Ontology View" (based on the hierarchy).
The HyperCL architecture, featuring the Link Prediction and Contrastive Learning pipelines.

Contrastive Loss and Hard Negative Mining

HyperCL employs a contrastive loss to pull the embeddings of the same entity from both views closer together. To enhance discriminative power, it uses a Breadth-First Search (BFS) strategy to identify "hard negatives"—entities belonging to the same concept. This forces the model to learn subtle differences between semantically similar entities, such as distinguishing between two different operating systems.

Experimental Evaluation

The framework was evaluated on three major hyper-relational KG benchmarks: JF17K, WikiPeople, and WD50K. Since these datasets lacked hierarchical information, the authors curated the necessary concept trees from Freebase and Wikidata.

HyperCL was integrated with four state-of-the-art baselines: StarE, HyT, QUAD, and HAHE. The results demonstrated a consistent performance improvement across all datasets, with Mean Reciprocal Rank (MRR) increasing by 3.1% to 7.4%. Notably, the combination of HyperCL and HAHE established new state-of-the-art benchmarks.

Key Insights

  • Decoupling Strategy: By using contrastive learning instead of joint training, HyperCL prevents instance facts from "drowning out" ontological signals, effectively solving the dominance issue.
  • The Value of Depth: Analysis showed that entities with deeper ontological paths (3+ layers) experienced significantly higher performance gains (5.7%) compared to shallow entities (0.8%), validating the importance of capturing the full hierarchy.
  • Efficiency: HyperCL is computationally efficient, adding only about a 10% overhead to training time while providing substantial accuracy gains.

Conclusion and Future Work

HyperCL demonstrates that incorporating hierarchical ontology through contrastive learning significantly enhances the representation of hyper-relational KGs. While highly effective for entity prediction, future research could extend this framework to relation prediction and explore graph augmentation techniques to further refine concept-aware embeddings.

Summary updated

BibTeX
@inproceedings{lu2024hypercl,
  author = {Yuhuan Lu and Weijian Yu and Xin Jing and Dingqi Yang},
  title = {{HyperCL: A Contrastive Learning Framework for Hyper-Relational Knowledge Graph Embedding with Hierarchical Ontology}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.171},
}
Figure