Abstract
Link prediction in Knowledge Graphs (KGs) is a fundamental task for completing structured knowledge bases. While modern inductive models leverage textual descriptions to handle unseen entities, they often rely on heavy, resource-intensive language models. We introduce the Fast-and-Frugal Text-Graph (FnF-TG) Transformer, a framework that achieves state-of-the-art performance by combining lightweight text encoders with a Graph Transformer that processes 1-hop neighborhoods. Our model significantly reduces computational costs and generalizes to entirely unseen relation types through inductive relation encoding.
Introduction
Knowledge Graphs (KGs) represent facts as triples (head, relation, tail). Link prediction—the task of predicting missing connections—is crucial for maintaining these graphs. Traditional transductive models are limited to entities seen during training. Inductive models overcome this by using text descriptions, but they face two primary challenges: high computational latency due to heavy encoders (e.g., BERT-Base) and a failure to generalize to novel relation types at test time.
Methodology
The FnF-TG Transformer addresses these challenges through a modular architecture designed for efficiency and generalization.
Architecture Components
- Text Transformer (TT) Encoder: This module converts textual descriptions of entities and relations into vector embeddings. A key finding of this work is that lightweight "Tiny" or "Mini" BERT variants can be highly effective when paired with structural information.
- Graph Transformer (GT) Encoder: The core of the framework, the GT encoder, processes an entity's "ego-graph" (1-hop neighbors). It utilizes a native self-attention mechanism to dynamically weigh the importance of different neighbors, allowing the model to capture local structural context.
- Inductive Relation Encoding: Unlike models that use fixed relation IDs, FnF-TG encodes the text of the relation. This enables the model to perform link prediction even for relation types it has never encountered during training.
The model is optimized using a margin-based ranking loss (TransE), which ensures that valid triples are scored higher than corrupted ones.
Experimental Results
The model was evaluated on standard inductive benchmarks: WN18RR_IND, FB15k-237_IND, and Wikidata-5M_IND. Additionally, a new Fully Inductive Relations (FIR) benchmark was introduced to test generalization to unseen relations.
Performance and Efficiency
FnF-TG consistently outperformed previous state-of-the-art models like StATIK. On WN18RR_IND, it achieved an MRR of 0.737, a substantial improvement over the previous 0.516. Similar gains were observed across other datasets.
Key Insights
- Structure Compensates for Scale: A "Tiny" BERT model integrated with the FnF-TG graph encoder often outperforms a standalone "Base" BERT model. This suggests that local graph structure can effectively substitute for the representational power of much larger language models.
- The Fast-and-Frugal Tradeoff: Scaling down the text encoder size (e.g., from Base to Tiny) reduces training time by approximately 3x with only a marginal impact on accuracy, making high-performance link prediction accessible on modest hardware.
- Relation Conditioning: The model's ability to "read" relation descriptions is vital; removing relation text conditioning leads to a significant performance drop.
Conclusion and Future Work
The FnF-TG Transformer demonstrates that efficient, lightweight models can be highly effective for inductive link prediction when they properly integrate graph structure. While the model handles 1-hop neighborhoods efficiently, future research could explore multi-hop patterns or adaptive neighborhood sampling for extremely dense "hub" entities. Furthermore, while the model shows promise in the Fully Inductive Relation (FIR) setting, closing the performance gap between seen and unseen relations remains an open challenge.
Summary updated