Abstract
Knowledge Graph Completion (KGC) often suffers from a lack of target-side context, leading to ambiguous entity embeddings. We present RAA-KGC (Relation-Aware Anchor Enhanced Knowledge Graph Completion), a novel framework that leverages existing "relation-aware neighbors" as semantic prototypes. By incorporating these neighbors as anchors in the query string, RAA-KGC guides the model toward the correct semantic region of the target entity. Our approach achieves state-of-the-art performance on standard benchmarks and demonstrates exceptional generalization in inductive settings.
Introduction
The task of Knowledge Graph Completion involves predicting the missing tail entity in a triplet (head, relation, ?). While Pre-trained Language Models (PLMs) have improved text-based KGC, they often lack a clear "reference point" for the expected target. For instance, in a query like (Europe, has_part, ?), the model understands the entities but may struggle to distinguish between valid targets (e.g., countries) and plausible but incorrect ones (e.g., cities or landmarks).
RAA-KGC addresses this by identifying "relation-aware" entities—neighbors of the head that already satisfy the query relation—to serve as anchors. These anchors provide the model with a concrete prototype of what a valid answer looks like, narrowing the search space and improving discriminative power.
Methodology
The RAA-KGC workflow consists of three main stages: anchor generation, query enhancement, and contrastive learning.
Anchor-Enhanced Queries
For a given query (h, r, ?), the system identifies entities $t_k$ already connected to $h$ via $r$. A small set of these (typically 4-5) is sampled as anchors. The model then constructs an enhanced input sequence by appending the descriptions of these anchors to the original head and relation text. This allows the PLM to attend to the semantic features of known valid targets during encoding.
Bi-Encoder Architecture and Training
The model utilizes a BERT-based bi-encoder setup. One encoder processes both the classic query and the anchor-enhanced query, while the second encoder processes candidate entities. The training objective uses a dual-objective InfoNCE loss, which minimizes the distance to the true target while pulling the query embedding toward the semantic neighborhood defined by the anchors.
Experimental Evaluation
We evaluated RAA-KGC on WN18RR, FB15k-237, and Wikidata5M-Trans. The model showed significant gains, particularly on WN18RR, with a 4.43% improvement in Mean Reciprocal Rank (MRR) and a 5.61% increase in Hit@1 over the SimKGC baseline.
Inductive Performance
RAA-KGC excels in inductive scenarios where entities are unseen during training. On the WN18RR v1 inductive dataset, it outperformed SimKGC by 8.35% in MRR. This suggests that by relying on the relationship's semantic neighborhood rather than memorizing specific entity IDs, the model generalizes much better to new graph structures.
Discussion and Conclusion
The success of RAA-KGC highlights the importance of relation-aware context. While the model is highly effective, its performance gain is slightly lower on dense graphs like FB15k-237, where an abundance of neighbors can introduce noise that distracts the PLM. Future work will explore more sophisticated topological selection methods to further refine anchor quality. Overall, RAA-KGC provides a robust, "plug-and-play" strategy for enhancing text-based KGC models.
Summary updated