Replacing Paths with Connection-Biased Attention for Knowledge Graph Completion

Sharmishtha Dutta, Alex Gittens, Mohammed J. Zaki, Charu C. Aggarwal

Abstract

Inductive knowledge graph completion involves predicting missing links between entities not seen during training. Current state-of-the-art models often rely on complex path-encoding modules that are computationally expensive and difficult to tune. We present CBLiP (Connection-Biased Link Prediction), which replaces explicit path modeling with a connection-biased attention mechanism within a Transformer-based subgraph encoder. By utilizing simple entity role embeddings and a connection-biased adjacency matrix, CBLiP implicitly learns structural patterns. Experimental results on WN18RR, FB15K-237, and NELL995 demonstrate that CBLiP achieves state-of-the-art performance while significantly reducing inference overhead.

Introduction

Knowledge Graphs (KGs) represent facts as triples consisting of a head entity, a relation, and a tail entity. As real-world KGs are dynamic and constantly expanding, models must perform inductive completion—predicting links between entities that were absent during the training phase.

Existing high-performance inductive models typically depend on path encoding, which involves searching for and encoding sequences of relations between entities. While effective, this approach suffers from high computational costs during inference, a proliferation of hyperparameters (e.g., path length and sampling size), and architectural complexity. This research explores whether a Transformer-based subgraph encoder can achieve comparable reasoning power without explicit path extraction.

Methodology

The proposed model, CBLiP, eliminates the need for explicit path modeling through two primary architectural innovations:

Entity Role Embeddings

Instead of using computationally intensive distance-based labeling (like double-radius labeling), CBLiP assigns each entity in a subgraph a simple role: head, tail, or other. This allows the model to distinguish target entities from contextual neighbors efficiently.

Connection-Biased Attention

The core of CBLiP is its modified attention mechanism. Standard Transformers treat subgraph triples as a flat sequence. CBLiP introduces a Connection-Biased Adjacency Matrix that identifies specific structural overlaps between triples (e.g., sharing a head or tail). These connection types serve as learnable bias terms in the attention layers, forcing the Transformer to recognize structural flow and learn path-like patterns implicitly.

The CBLiP architecture, highlighting the Transformer encoder layer and the scaled dot-product attention with connection bias.

Experimental Evaluation

CBLiP was evaluated on twelve standard inductive splits derived from three benchmark datasets:

  • WN18RR: Lexical relations from WordNet.
  • FB15K-237: General knowledge facts from Freebase.
  • NELL995: Data from the "Never-Ending Language Learning" project.

The evaluation focused on the model's ability to generalize to unseen entities and its efficiency compared to path-based alternatives.

Results and Discussion

CBLiP demonstrated superior performance across multiple benchmarks, achieving the best Hits@10 results in 7 out of 12 inductive splits. It outperformed both path-free models like GraIL and several advanced path-based models such as ConGLR and LogCo.

Comparative results showing CBLiP's performance (Hits@10) against various rule-based and graph-based methods across inductive benchmarks.

Key Insights

  • Structural Bias Efficiency: The results suggest that explicit path extraction is unnecessary if the attention mechanism is properly biased to understand graph topology.
  • Inference Speed: By avoiding path searches at test time, CBLiP circumvents the primary bottleneck of models like NBFNet, making it suitable for real-time applications.
  • Ablation Proof: Removing the connection bias led to a significant performance drop (e.g., from 97.30 to 92.00 on WN18RR v1), confirming that the biased attention successfully captures structural logic previously handled by path encoders.

Conclusion

CBLiP offers a streamlined and efficient alternative for inductive knowledge graph completion. By replacing explicit paths with connection-biased attention, it achieves state-of-the-art results with reduced complexity. Future work will explore extending this approach to fully inductive settings where relations are also unseen and scaling the biased attention to handle larger, noisier subgraphs.

Summary updated

BibTeX
@inproceedings{dutta2025replacing,
  author = {Sharmishtha Dutta and Alex Gittens and Mohammed J. Zaki and Charu C. Aggarwal},
  title = {{Replacing Paths with Connection-Biased Attention for Knowledge Graph Completion}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i14.33632},
}
Figure