Abstract
Knowledge Graphs (KGs) are essential for structured data representation but frequently suffer from incompleteness. While traditional Knowledge Graph Embedding (KGE) methods struggle with scalability and inductive reasoning, generative Language Models (LMs) offer a promising alternative by treating link prediction as a text-to-text task. This paper explores the integration of local graph structure—specifically a node's neighborhood—as textual context for LMs. By combining the internal knowledge of models like T5 with external structural evidence, the proposed method achieves state-of-the-art performance in both transductive and inductive link prediction tasks.
Introduction
Knowledge Graphs (KGs), such as Wikidata or Freebase, represent facts as triples in the form of (head entity, relation, tail entity). Despite their utility in search and recommendation, KGs are inherently incomplete. The task of Link Prediction (LP) aims to fill these gaps. Historically, this was addressed using Knowledge Graph Embeddings (KGE), which map entities and relations into low-dimensional vector spaces. However, KGEs face two major hurdles: they do not scale well to massive graphs and they fail in "inductive" settings where the model must predict links for entities not seen during training.
Recent advancements have pivoted toward using pre-trained Language Models (LMs) for KG completion. By verbalizing triples into natural language, models like T5 can leverage their vast internal knowledge to predict missing entities. Yet, these models often ignore the existing structural context surrounding a query. This research demonstrates that providing an LM with the "neighborhood" of an entity significantly enhances its predictive accuracy.
Methodology: The Neighborhood-Aware Pipeline
The authors propose a multi-step pipeline designed to transform graph structure into a reading comprehension task for generative models.
1. Neighborhood Extraction and Semantic Sorting
For any given query, such as (Steve Jobs, place of birth, ?), the system first identifies the "1-hop" neighbors of the head entity. Because LMs have finite context windows (e.g., 512 tokens for T5), not all neighbors can be included. The authors employ Semantic Sorting using FastText embeddings to rank neighbors based on the similarity between their relations and the query relation. This ensures that the most relevant contextual clues are prioritized.
2. Verbalization and Generation
The query and its top-ranked neighbors are converted into a single natural language string. A typical input might look like: predict Steve Jobs place of birth [SEP] place of death Palo Alto [SEP] country of citizenship United States. This string is processed by a generative model—specifically T5 or GPT-3.5-turbo—which outputs the name of the missing entity directly.
3. Disambiguation
To resolve ambiguities where multiple entities share the same name, the system appends unique identifiers or descriptions to the text, ensuring the model distinguishes between different individuals or locations with identical labels.
Experimental Evaluation
The methodology was tested across three primary benchmarks:
- Wikidata5M: A large-scale dataset for transductive link prediction.
- ILPC-small & ILPC-large: Benchmarks from the Inductive Link Prediction Challenge, designed to test the model's ability to reason about entirely new entities.
Key Results
The inclusion of neighborhood information yielded substantial performance gains. On the Wikidata5M dataset, the Hits@1 (the accuracy of the top-ranked prediction) for a T5-small model rose from 0.240 to 0.327. This improvement highlights that even small models benefit immensely from structural context.
In the inductive setting (ILPC), the approach achieved state-of-the-art (SOTA) results. By relying on semantic reasoning and the provided neighborhood, the model outperformed complex Graph Neural Networks (GNNs), which often require more intensive computation and lack the inherent linguistic knowledge of LMs.
Discussion: Why Context Matters
The research underscores a "Better Together" philosophy: the synergy between an LM’s internal parameters and a KG’s external structure. The neighborhood acts as a vital "hint." For instance, knowing an entity's "place of death" or "citizenship" provides a strong semantic prior for predicting their "place of birth."
Furthermore, the study included an ablation analysis where the most informative triplets were removed from the context. The resulting drop in accuracy confirmed that the model was not merely relying on its pre-trained memory but was actively "reading" and utilizing the provided graph context to make informed predictions.
Limitations and Future Directions
While successful, the approach faces constraints:
- Context Limits: The 512-token limit of standard T5 models restricts the amount of neighborhood data that can be processed. Future iterations could utilize LongT5 or other long-context architectures.
- Domain Specificity: While effective for general knowledge, the model's performance on specialized KGs (e.g., medical or chemical) may require domain-specific pre-training.
- Selection Logic: The current semantic similarity approach for neighbor selection is effective but could be improved through more advanced sub-graph sampling or learned retrieval methods.
Conclusion
By treating Knowledge Graph completion as a context-aware generative task, this work bridges the gap between structural graph data and linguistic reasoning. The results demonstrate that providing local neighborhood information allows Language Models to overcome the limitations of traditional KGEs, particularly in challenging inductive scenarios, paving the way for more robust and scalable knowledge management systems.
Summary updated