HyperFormer: Enhancing Entity and Relation Interaction for Hyper-Relational Knowledge Graph Completion

Zhiwei Hu, Víctor Gutiérrez-Basulto, Zhiliang Xiang, Ru Li, Jeff Z. Pan

Abstract

Hyper-Relational Knowledge Graphs (HKGs) extend traditional triples by incorporating qualifiers that provide essential context to facts. However, completing these graphs is challenging due to the complexity of interactions between entities, relations, and qualifiers. Existing methods often rely on deep Graph Convolutional Networks (GCNs) that aggregate multi-hop information, which can introduce significant noise. We present HyperFormer, a novel framework that prioritizes local sequential information and bidirectional interactions. By utilizing an Entity Neighbor Aggregator (ENA), a Relation Qualifier Aggregator (RQA), and a Convolution-based Bidirectional Interaction (CBI) module, HyperFormer captures intricate dependencies without the overhead of global graph structures. Furthermore, the integration of a Mixture-of-Experts (MoE) strategy reduces computational costs while maintaining high performance. Experimental results on benchmark datasets like WD50K and JF17K demonstrate that HyperFormer achieves state-of-the-art results, particularly in data-sparse scenarios.

1. Introduction

Knowledge Graphs (KGs) are fundamental to modern AI applications, representing information as triples $(h, r, t)$. However, real-world facts are often more complex. Hyper-Relational Knowledge Graphs (HKGs) address this by adding qualifiers—key-value pairs that contextualize a triple. For instance, the fact (Joe Biden, educated at, University of Delaware) can be enriched with qualifiers like (degree: Bachelor of Arts) and (start time: 1961).

The task of Hyper-Relational Knowledge Graph Completion (HKGC) involves predicting missing entities or relations within these complex structures. While qualifiers provide rich information, they also increase the dimensionality and sparsity of the data, making traditional completion methods less effective.

2. The Challenge of Global Noise

Most current HKGC models utilize Graph Convolutional Networks (GCNs) to learn representations. These models aggregate features from an entity’s multi-hop neighborhood. The authors of HyperFormer identify a critical flaw in this approach: global-level aggregation often introduces irrelevant noise. In a dense graph, a node may be connected to many entities that share a relation but do not contribute to the specific prediction task. For example, when predicting a person's education, the educational history of their colleagues (connected via a "colleague" relation) is often irrelevant and potentially distracting to the model.

3. The HyperFormer Framework

HyperFormer shifts the focus from global graph topology to local interaction and sequence modeling. The architecture consists of three core components:

3.1 Entity Neighbor Aggregator (ENA)

To avoid the noise of multi-hop lookups, the ENA focuses exclusively on an entity’s immediate (1-hop) neighbors. This provides a "multi-perspective" representation of the entity, capturing its direct roles and attributes without pulling in distant, unrelated nodes.

3.2 Relation Qualifier Aggregator (RQA)

Qualifiers are not just metadata; they fundamentally alter the meaning of a relation. The RQA treats qualifiers as "pseudo-triples" to refine the relation embedding. This ensures that the representation of a relation like "educated at" is specifically tailored to the associated "degree" or "major" qualifiers.

3.3 Convolution-based Bidirectional Interaction (CBI)

The CBI module is the heart of HyperFormer. Unlike previous models that treat qualifiers as secondary inputs, CBI uses 1D convolutional operations to facilitate bidirectional communication between the entity, the relation, and the qualifiers. This allows the qualifiers to help define the relation while the relation simultaneously contextualizes the qualifiers, leading to more robust and expressive embeddings.

3.4 Efficiency via Mixture-of-Experts (MoE)

To handle the increased complexity of these interactions without a massive increase in parameters, HyperFormer adopts a Mixture-of-Experts (MoE) strategy within its Transformer blocks. A gating network dynamically selects a subset of "expert" feed-forward layers for each input. This approach increases model capacity while significantly reducing the number of active parameters and floating-point operations (FLOPs).

4. Experimental Evaluation

HyperFormer was evaluated on three standard benchmarks: WD50K, WikiPeople, and JF17K. These datasets vary in qualifier density, with JF17K being the most qualifier-heavy (45.9% of facts) and WikiPeople the least (2.6%).

4.1 Performance Metrics

HyperFormer achieved State-of-the-Art (SoTA) performance on WD50K and JF17K. On the JF17K dataset, it improved the Mean Reciprocal Rank (MRR) by 4.7% over previous benchmarks. The model's performance was particularly notable in "Low Degree" scenarios—where entities have very few connections. For entities with only one neighbor, HyperFormer outperformed existing models by nearly 7%, demonstrating its ability to make accurate predictions based on limited but high-quality local context.

4.2 Computational Efficiency

The MoE strategy proved highly effective. On the WD50K dataset, HyperFormer reduced FLOPs by over 50% (from approximately 286G to 118G) compared to standard transformer architectures, while simultaneously improving accuracy.

5. Discussion and Conclusion

The success of HyperFormer suggests two major insights for the field of Knowledge Graph Completion. First, local context is often superior to global structure in hyper-relational settings; immediate neighbors and qualifiers provide more predictive power than distant graph nodes. Second, bidirectional interaction between relations and their qualifiers is essential for capturing the nuances of complex facts.

While HyperFormer excels in qualifier-rich environments, its performance on datasets with very low qualifier density (like WikiPeople) is more modest, as the specialized modules have less data to leverage. Future research will focus on integrating textual descriptions and numerical literals into the embeddings and scaling the architecture to the full Wikidata graph.

Summary updated

BibTeX
@inproceedings{hu2023hyperformer,
  author = {Zhiwei Hu and Víctor Gutiérrez-Basulto and Zhiliang Xiang and Ru Li and Jeff Z. Pan},
  title = {{HyperFormer: Enhancing Entity and Relation Interaction for Hyper-Relational Knowledge Graph Completion}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2023},
  doi = {10.1145/3583780.3614922},
}
Figure