Introduction
Knowledge Graphs (KGs) are essential for representing structured real-world facts, yet they are frequently incomplete. Predicting missing links is a fundamental challenge in AI. While recent approaches leverage large-scale text pretraining (e.g., using Wikipedia), these methods often suffer from information leakage and domain mismatch for specialized graphs. This paper explores whether a Transformer can be pretrained to understand graph structure using only the graph itself, bypassing the need for external text data.
Methods: Structural Pretraining Signals
The authors introduce KG-TRSF, a Transformer-based model pretrained using five self-supervised signals derived from classical graph algorithms. These tasks are divided into path-based and neighborhood-based categories to teach the model different aspects of graph topology.
- Relational Shortest Paths (SP): The model learns to predict the sequence of relations along the shortest path between two entities.
- Information Gain Paths (IP): A novel contribution using Kullback-Leibler divergence to identify paths with high information gain, favoring semantically meaningful reasoning chains over random shortcuts.
- K-Hop Neighbor Prediction (KHN): The model predicts which entities are likely to appear within a specific distance (k-hops) of a target node.
- Invariant Adjacency Matrix Classification (IVA): To learn order-invariance, the model is trained to distinguish between a real local adjacency matrix and a corrupted/permuted version.
- Local Clustering Coefficient (LCC): A regression task where the model estimates the density of a node's local neighborhood.
The study finds that a multitask approach (ALL) combining these signals provides the most robust structural understanding.
Experimental Results
The model was evaluated on three diverse benchmarks: FB15K-237 (general knowledge), WN18RR (lexical relations), and JF17K (a knowledge hypergraph involving $n$-ary relations).
As shown in the results table, the multitask model (KG-TRSF ALL) consistently outperforms strong baselines like BOXE and DRGI across almost all metrics. Notably, the IP algorithm alone provides a significant 2-3% improvement in Mean Reciprocal Rank (MRR), demonstrating that structural heuristics can effectively substitute for external text in learning relational semantics. Furthermore, the Transformer architecture handled hypergraphs (JF17K) with minimal modification, surpassing previous state-of-the-art methods.
Key Insights
- Path-based Reasoning: Tasks focusing on paths (SP, IP) are significantly more effective for link prediction than neighborhood-based tasks, suggesting that "reasoning" in graphs is inherently sequential.
- Semantics from Structure: The success of the IP algorithm proves that meaningful reasoning chains can be discovered purely through information-theoretic analysis of graph structure.
- Internal Data Sufficiency: Structural signals alone can drive a model to state-of-the-art performance, offering a robust solution for specialized domains where external text corpora are unavailable or unhelpful.
Conclusion
This work demonstrates that pretraining Transformers on graph-internal structural signals significantly enhances KG completion performance. By leveraging classical graph algorithms as self-supervised tasks, the authors achieve SOTA results without the risks of information leakage associated with text-based pretraining. Future research may explore the integration of these structural signals with text-based embeddings to further improve performance across diverse graph topologies.
Summary updated