Learning First-Order Rules with Relational Path Contrast for Inductive Relation Reasoning

Yudai Pan, Jun Liu, Lingling Zhang, Xin Hu, Tianzhe Zhao, Qika LinarXiv 2021

Abstract

Knowledge Graph (KG) reasoning has traditionally relied on transductive models that require all entities to be present during training. However, real-world applications demand inductive reasoning capabilities to handle unseen entities. This paper introduces RPC-IR (Relational Path Contrast for Inductive Reasoning), a framework that learns entity-independent logical rules. By utilizing a contrastive learning strategy that compares valid relational paths against corrupted "negative" paths, RPC-IR overcomes the challenge of data scarcity in local subgraphs. Experimental results on benchmark datasets demonstrate that RPC-IR significantly outperforms existing state-of-the-art inductive models while providing human-readable explanations for its predictions.

Introduction

Knowledge Graphs store factual information as triples in the form of (Head Entity, Relation, Tail Entity). While traditional models excel at predicting missing links between known entities, they fail in inductive settings where new entities—such as new users or products—emerge constantly. Inductive reasoning requires the model to learn the underlying logic of relations rather than memorizing specific entity pairs.

Inductive reasoning involves learning entity-independent rules from a training graph and applying them to unseen entities in a test graph.

As shown in Figure 1, an inductive model can learn a rule like partOf(X, Z) ^ locatedIn(Z, Y) → liveIn(X, Y) from a training set (e.g., Trump and the Grand Hyatt) and successfully apply it to a test set containing entirely new entities (e.g., Bill Gates and Microsoft). The primary hurdles in this field are entity dependency and the scarcity of supervision within small, local subgraphs.

The RPC-IR Framework

To address these challenges, the authors propose the RPC-IR framework, which focuses on relational paths rather than individual nodes. The process involves three critical stages:

  1. Subgraph Extraction & Node Labeling: For any target triple, the model extracts an enclosing subgraph. It employs a "double radius vertex labeling" scheme to provide a topological map of the nodes relative to the head and tail entities.
  2. Relational Path Contrast: This is the core innovation of the paper. The model identifies valid paths between entities using Breadth-First Search (BFS). To combat data scarcity, it uses contrastive learning by treating actual paths as "positive" samples and creating "negative" samples by randomly swapping relations within those paths.
  3. Joint Training Regime: The model is optimized using a combination of associative contrast (linking structure to semantics), path contrast (distinguishing logical sequences), and standard supervised cross-entropy loss.
The RPC-IR workflow extracts an enclosing subgraph, identifies positive relational paths, generates negative 'fake' paths for contrastive learning, and maps them to a target relation embedding.

Key Insights and Results

By prioritizing relational paths over specific entities, RPC-IR becomes truly entity-agnostic. The contrastive learning component acts as a form of data augmentation, teaching the model to recognize the boundaries of logical reasoning even when gold-standard training data is sparse.

Performance and Efficiency

RPC-IR was evaluated on inductive versions of WN18RR, FB15K-237, and NELL-995. It consistently outperformed state-of-the-art models like GraIL and CoMPILE. Notably, on the WN18RR dataset, it achieved an average AUC-PR boost of 12.53% over traditional rule-based methods. Furthermore, the model is highly efficient; for instance, it utilizes approximately 21k parameters on WN18RR_v4 compared to the 34k parameters required by CoMPILE.

Interpretability

Unlike many "black-box" neural networks, RPC-IR offers built-in interpretability. The attention mechanism within the model assigns weights to different relational paths, which can be directly translated into First-Order Logic rules. This allows researchers to audit the model's reasoning process and verify the logic behind its predictions.

Conclusion

RPC-IR represents a significant advancement in inductive relation reasoning by leveraging relational path contrast. By focusing on the semantics of relation sequences rather than entity identities, it provides a robust, efficient, and interpretable solution for evolving Knowledge Graphs. Future work may explore extending this framework to capture longer relational dependencies and applying it to more complex domains like commonsense reasoning.

Summary updated

BibTeX
@misc{pan2021learning,
  author = {Yudai Pan and Jun Liu and Lingling Zhang and Xin Hu and Tianzhe Zhao and Qika Lin},
  title = {{Learning First-Order Rules with Relational Path Contrast for Inductive Relation Reasoning}},
  year = {2021},
  eprint = {2110.08810},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.08810},
}
Figure