# Commonsense-Guided Inductive Relation Prediction with Dual Attention Mechanism
## 1 Introduction  
Knowledge graphs (KGs) are composed of organized knowledge in the form of factual triples (_entity_, _relation_, _entity_), and they form a collection of interrelated knowledge, thereby facilitating downstream tasks such as question answering [1], relation extraction [2], and recommendation systems [3]. However, even state-of-the-art KGs suffer from an issue of incompleteness [4, 5], such as FreeBase [6] and WikiData [7]. To solve this issue, many studies have been proposed mining missing triples in KGs, in which the embedding-based methods become a dominant paradigm, such as TransE [8], ComplEx [9], RGCN [10], and CompGCN [11]. In particular, certain scholars have explored knowledge graph completion under low-data regime conditions [12]. In actuality, the aforementioned methods are often only suitable for _transductive_ scenarios, which assumes that the set of entities in KGs is fixed. However, KGs undergo continuous updates, whereby new entities and triples are incorporated to store additional factual knowledge, such as new users and products on e-commerce platforms. Predicting the relation links between new entities requires _inductive reasoning capabilities_, which implies that generality should be derived from existing datasets and extended to a broader spectrum of fields, as shown in Figure 1. The crux of the inductive relation prediction [13] resides in utilizing information that is not specifically tied to a particular entity. A representative strategy in inductive relation prediction techniquesis rule mining [14], which extracts first-order logic rules from a given KG and employs weighted combinations of these rules for inference. Each rule can be regarded as a relational path, comprising a set of relations from the head entity to the tail entity, which signifies the presence of a target relationship between two entities. For example, consider the straightforward rule (\(X\), _part_of_, \(Y\)) \(\wedge\) (\(Y\), _located_in_, \(Z\)) \(\rightarrow\) (\(X\), _lives_in_, \(Z\)), which was derived from the KG depicted in Figure 1a. These relational paths exist in symbolic forms and are independent of particular entities, thus rendering them inductive and highly interpretable. Motivated by graph neural networks (GNNs) that have the ability of aggregating local information, researchers have recently proposed GNN-based inductive models. GraIL [15] models the subgraphs of target triples to capture topologies. Based on GraIL, some works [16; 17; 18] have further utilized enclosing subgraphs for inductive prediction. Recent research has also considered few-shot settings for handling unseen entities [19; 20]. SNRI [21] extracts the neighbor features of target node and path features, solves the problem of sparse subgraphs, and introduces mutual information (MI) maximization to model from a global perspective, which improves the prediction effect of inductive relationships. Nonetheless, we still observe several issues from the existing literature: (1) _Ignorance of neighboring information outside the enclosing subgraph_. Inductive relation prediction models relying on the enclosing subgraph disregard the remaining neighbors of the node. However, neighbors in proximity to the target nodes harbor valuable information for inferring the relation; (2) _Overlooking the influence of different neighboring relations_. Existing methods overlook variations in the impact of distinct structures on subgraph modeling, as well as in the diverse relationships of target nodes regarding relation predicting; and (3) _Generation of facts that violate commonsense_. Some of the predictions generated violate commonsense, which can be easily avoided by introducing the commonsense knowledge for screening. To address these issues, we propose a Commonsense-guided **N**eighboring relation InfoMax model based on a dual-**A**ttention mechanism (CNIA).