Context-aware Inductive Knowledge Graph Completion with Latent Type Constraints and Subgraph Reasoning

Muzhi Li, Cehao Yang, Chengjin Xu, Zixing Song, Xuhui Jiang, Jian Guo, Ho-fung Leung, Irwin King

Abstract

Knowledge Graph Completion (KGC) is essential for maintaining dynamic and evolving knowledge bases. While transductive methods excel at predicting links between known entities, the inductive setting—reasoning about entirely new entities—remains a significant challenge. We present CATS (Context-aware Inductive Knowledge Graph Completion), a novel framework that utilizes Large Language Models (LLMs) as reasoning engines. CATS incorporates latent type constraints and a sophisticated subgraph reasoning module to overcome the limitations of missing paths and absent entity type labels. Our evaluation across standard benchmarks demonstrates that CATS significantly outperforms existing state-of-the-art methods, achieving an average 7.2% improvement in Mean Reciprocal Rank (MRR).

1. Introduction

Knowledge Graph Completion (KGC) aims to predict missing triples $(h, r, t)$ within a graph. Traditional methods predominantly operate in a transductive setting, assuming all entities in the test set were seen during training. However, real-world knowledge graphs are inherently dynamic, frequently incorporating new entities. This necessitates inductive KGC, where models must generalize to unseen entities based on their local graph structure.

Existing inductive approaches often rely on reasoning paths or explicit entity types. However, these paths are frequently sparse or missing, and many datasets lack explicit ontological type labels. CATS addresses these issues by leveraging the semantic reasoning capabilities of LLMs, specifically Qwen2-7B, to perform context-aware completion without requiring predefined ontologies.

2. The CATS Framework

The CATS framework consists of two primary modules designed to provide the LLM with rich structural and semantic context.

Overview of the CATS framework including Type-aware Reasoning (TAR) and Subgraph Reasoning (SR).

2.1 Type-Aware Reasoning (TAR)

To handle the absence of explicit entity types, CATS introduces latent type constraints. Instead of relying on a fixed ontology, TAR provides the LLM with a set of "demonstration" triples that share the same relation as the query. By analyzing these examples, the LLM can infer the implicit type requirements of the relation and determine if the candidate entity is a semantically appropriate fit.

2.2 Subgraph Reasoning (SR)

The SR module extracts structural evidence from the knowledge graph through two sub-components:

  • Path Extraction and Filtering: This component identifies relation paths between head and tail entities. To manage the context window and reduce noise, it employs a degree-based filtering mechanism, prioritizing rare, highly informative relations over ubiquitous, generic ones.
  • Neighboring Facts Selection: Using text embeddings (BGE), CATS retrieves the most relevant facts surrounding the query entities. This contextual information is crucial for disambiguating entities and providing the LLM with the necessary background to make informed predictions.

The entire system is fine-tuned using Supervised Fine-Tuning (SFT) with a contrastive loss, training the model to distinguish between ground-truth triples and plausible negative samples.

3. Experimental Evaluation

CATS was evaluated on three benchmark datasets: WN18RR (lexical), FB15k-237 (general knowledge), and NELL-995 (extracted facts). The experiments spanned transductive, inductive, and few-shot settings.

4. Results and Discussion

CATS established a new state-of-the-art, outperforming previous methods in 16 out of 18 experimental scenarios.

Main experimental results comparing CATS against baseline methods across multiple datasets and settings.

Key findings include:

  • Inductive Performance: CATS showed remarkable gains in inductive settings, with absolute Hits@1 improvements of 12.8% on WN18RR and 16.2% on FB15k-237 over the previous best models.
  • Few-Shot Robustness: The model maintained high performance even when training data was limited to only 1,000 triples, highlighting the benefit of the LLM's pre-trained semantic knowledge when combined with structural reasoning.
  • Importance of Context: Ablation studies confirmed that the LLM's performance is heavily dependent on the provided graph context; without it, the model's internal knowledge alone is insufficient for accurate KGC.

5. Conclusion and Future Work

CATS demonstrates the power of combining LLMs with structural graph reasoning for inductive KGC. While the framework achieves superior accuracy, its reliance on a 7B-parameter model results in slower inference speeds compared to GNN-based approaches. Future work will focus on optimizing inference efficiency and exploring the scalability of this approach with even larger language models and more complex reasoning tasks.

Summary updated

BibTeX
@inproceedings{li2025context,
  author = {Muzhi Li and Cehao Yang and Chengjin Xu and Zixing Song and Xuhui Jiang and Jian Guo and Ho-fung Leung and Irwin King},
  title = {{Context-aware Inductive Knowledge Graph Completion with Latent Type Constraints and Subgraph Reasoning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i11.33318},
}
Figure