P - INT : A Path-based Interaction Model for Few-shot Knowledge Graph Completion (2021)

Abstract: Few-shot knowledge graph completion is to infer the unknown facts (i.e., query head-tail entity pairs) of a given relation with only a few observed reference entity pairs. Its general process is to first encode the implicit relation of an entity pair and then match the relation of a query entity pair with the relations of the reference entity pairs. Most existing methods have thus far encoded an entity pair and matched entity pairs by using the direct neighbors of concerned entities. In this paper, we propose the P-INT model for effective few-shot knowledge graph completion. First, P-INT infers and leverages the paths that can expressively encode the relation of two entities. Second, to capture the fine grained matches, P-INT calculates the interactions of paths instead of mix- ing them for each entity pair. Extensive experimental results demonstrate that P-INT out- performs the state-of-the-art baselines by 11.2– 14.2% in terms of Hits@1. Our codes and datasets are online now.

## introduction large scale knowledge graphs (kgs) can benefit various applications, such as question answering @xcite , retrieval @xcite , and recommender systems @xcite . the completion of kgs plays a critical role in these applications. to complete kgs, most existing embedding based techniques demand sufficient triplets for each relation as the training data, such as transe @xcite , ro-tate @xcite , conve @xcite , and compgcn @xcite . however, the majority of relations have limited (few-shot) triplets in commonly used kgs @xcite . for example, 96.9% of all the relations are with fewer than 5 triplets in freebase, 0.0 0.5 0.0 0.0 p s 1 < l a t e x i t s h a 1 _ b a s e 6 4 = " 6 k 3 p e b u 5 e g j l q d h x g 8 k 7 z u 1 o w b @xmath0. ## related work to solve the few-shot kg completion problem, meta-learning models including the optimizationbased and the metric-based categories have been both investigated @xcite . the optimization-based model is based on the maml algorithm. for example, metar @xcite represents a relation by the support entity pairs and transfers the meta information of the relation from the support entity pairs to the query entity pairs. meta-kgr @xcite and fire @xcite represent a relation using the paths traversed by a multi-hop agent and then transfer the meta information similarly as metar. however, the latter two models ignore the interactions of paths. the metric-based model measures the similarity between two entity pairs based on the representations of the entity pairs. for example, gmatching @xcite averages the neighbors of an entity, concatenates the head and the tail for an entity pair, applies a transformer to aggregate all the support entity pairs, and finally matches the aggregated support pairs with each query entity pair by a lstm-based meta learner. fsrl @xcite aggregates the neighbors by a fixed attention mechanism, applies a recurrent autoencoder to aggregate all the support pairs, and matches the aggregation with the query entity pair by lstm. faan @xcite aggregates the neighbors by a dynamic attention mechanism, applies a transformer to encode an entity pair, aggregates all the support pairs by an attention mechanism, and finally matches the aggregation with the query pair by dot product. this paper studies a metric-based meta-learning model, which changes the representation-based similarity measurement into an interaction-based measurement on the paths connecting the head and the tail entities. w m b m z + a 8 y u 5 r f 8 w e n c / i g m j a 8 5 j w i k n m 2 x u 8 i e m a i z z n q 7 e 9 t l n l 1 y k + 4 c z i r x c l k c h p w e / d x t x z s n m e q q i n y d z 0 3 q z 4 h c t g w b f r u p z g m h i z j g h u m l i z j 2 s / n l u + f c k h 0 n j j u p i c 5 c / t 2 r k u j r s r s y z o j g u c 9 7 m / e / r 5 n i e o v n x c y p m k k x i 8 j u o b g 7 s w m b m z + a 8 y u 5 r f 8 w e n c / i g m j a 8 5 j w i k n m 2 x u 8 i e m a i z z n q 7 e 9 t l n l 1 y k + 4 c z i r x c l k c h p w e / d x t x z s n m e q q i n y d z 0 3 q z 4 h c t g w b f r u p z g m h i z j g h u m l i z j 2 s / n l u + f c k h 0 n j j u p i c 5 c / t 2 r k u j r s r s y z o j g u c 9 7 m / e / r 5 n i e o v n x c y p m k k x i 8 j u o b g 7 s w m b m z + a 8 y u 5 r f 8 w e n c / i g m j a 8 5 j w i k n m 2 x u 8 i e m a i z z n q 7 e 9 t l n l 1 y k + 4 c z i r x c l k c h p w e / d x t x z s n m e q q i n y d z 0 3 q z 4 h c t g w b f r u p z g m h i z j g h u m l i z j 2 s / n l u + f c k h 0 n j j u p i c 5 c / t 2 r k u j r s r s y z o j g u c 9 7 m / e / r 5 n i e o v n x c y p m k k x i 8 j u o b g 7 s w m b m z + a 8 y u 5 r f 8 w e n c / i g m j a 8 5 j w i k n m 2 x u 8 i e m a i z z n q 7 e 9 t l n l 1 y k + 4 c z i r x c l k c h p w e / d x t x z s n m e q q i n y d z 0 3 q z 4 h c t g w b f r u p z g m h i z j g h u m l i z j 2 s / n l u + f c k h 0 n j j u p i c 5 c / t 2 r k u j r s r s y z o j g u c 9 7 m / e / r 5 n i e o v n x c y p m k k x i 8 j u o b g 7 s a t e x i @xmath1: spouse reasoned query subgraph similarity embeddings p s 1 < l a t e x i t s h a 1 _ b a s e 6 4 = " 7 e 1 ## problem definition a kg is denoted by @xmath2, r, t) ∈ e × r × e}, where e and r denote the sets of its entities and relations, respectively. problem 1. few-shot kg completion. given a relation @xmath3, t s )|(h s , r, t s ) ∈ g} with small size |s r | foot_1 , for each query head entity h q , the goal is to complete the triplet (h q , r, ?) with ? as the ground truth tail t q to be predicted from the candidate entity foot_2 set c q . we follow the common setting of few-shot kg completion @xcite . specifically, predicting triplets for a relation r is defined as a task. for each task of r, the related entity pairs are provided, that is, d @xmath4, q r }, where s r consists of k-shot support entity pairs and q @xmath5, t q )} contains the query entity pairs, each of which is composed of a query head h q and a ground truth tail t q . the relations @xmath6, r meta-train , r meta-validation and r meta-test . correspondingly, their triplets form the background knowledge graph g background , the meta-training set d meta-train , the meta-validation set d meta-validatiaon and the meta-test set d meta-test . ## the proposed model this section introduces the proposed p-int, which consists of a reasoning component to infer the paths from a query head entity to the candidate tail entities according to the support entity pair, and a matching component to compute the interactions between the support entity pairs and each query entity pair. in addition, the attention mechanism that considers the relevance to the target relation is applied to each path. a kernel aggregation function is adopted to extract the similarity features from the interactions. figure 2 presents the whole framework of p-int. ## conclusion this paper solves the few-shot knowledge graph completion by building the interactions of paths between the support entity pair and the query entity pair. the paths are expressive to represent a relation and the interaction matching can capture fine grained matches between entity pairs to reduce the negative influence of the noisy paths. experimental results on two benchmarks show that p-int achieves the best performance among all the stateof-the-art few-shot learning models.