Few-shot Knowledge Graph Relational Reasoning via Subgraph Adaptation (2024)

Abstract: Few-shot Knowledge Graph (KG) Relational Reasoning aims to predict unseen triplets (i.e., query triplets) for rare relations in KGs, given only several triplets of these relations as references (i.e., support triplets). This task has gained significant traction due to the widespread use of knowledge graphs in various natural language processing applications. Previous approaches have utilized meta-training methods and manually constructed meta-relation sets to tackle this task. Recent efforts have focused on edge-mask-based methods, which exploit the structure of the contextualized graphs of target triplets (i.e., a subgraph containing relevant triplets in the KG). However, existing edge-mask-based methods have limitations in extracting insufficient information from KG and are highly influenced by spurious information in KG. To overcome these challenges, we propose SAFER (Subgraph Adaptation for Few-shot Relational Reasoning), a novel approach that effectively adapts the information in contextualized graphs to various subgraphs generated from support and query triplets to perform the prediction. Specifically, SAFER enables the extraction of more comprehensive information from support triplets while minimizing the impact of spurious information when predicting query triplets. Experimental results on three prevalent datasets demonstrate the superiority of our proposed framework SAFER.

## introduction knowledge graphs (kgs) consist of many triplets, i.e., @xcite , which represent specific relationships between real-world entities @xcite . these triplets form directed graphs that store knowledge information and can be applied to various knowledge-based tasks @xcite ; wang 1 our code is available at https://github.com/ haochenliu2000/safer . work with produced by music musician instrument related job singer published in article reporter newspaper editor head entity tail entity entity a entity b entity common relation extract common relations work with related job support graphs created by created by similar relation spurious relation related job work with target relation common subgraph figure 1 : we provide an instance for the two limitations of edge-mask-based methods. in this example, there are two support triplets (music, created_by, musican) and (news article, created_by, reporter). when extracting support information by finding the common subgraph, the extraction of edges with similar meanings but in different graphs will fail, and some spurious information will be extracted, which cannot correctly represent the logical pattern of the relation created_by. currently, there exist two types of approaches for solving the few-shot kgr task. the first type is meta-learning-based methods @xcite @xcite , which utilize the meta-learning framework @xcite to transfer useful knowledge to new kgr tasks @xcite with a limited number of support triplets, to tackle the issue of data scarcity in the target few-shot tasks. nevertheless, the distribution of the manually selected target relations plays an important role in these methods, which will result in suboptimal performance if the meta-training sets are not well-designed. to address this limitation, more recent studies have explored edge-mask-based approaches @xcite , providing an alternative solution to few-shot kgr tasks. edge-mask-based methods analyze each support (or query) triplet by first retrieving its contextualized graph, i.e., the subgraph that consists of the head and tail entities of a triplet, and the most relevant entities and relations of the triplet. the subgraph is referred to as the support (or query) graph. then they extract common subgraphs across support graphs in the form of masks that identify edges with shared meanings for predictions on query triplets. despite the effectiveness of these works, we argue that there are still two major limitations of edge-mask-based methods. (1) existing edgemask-based approaches assume that the largest common subgraph (masks) shared across all support graphs is sufficient to represent the unseen target relation. however, this assumption is difficult to satisfy in certain cases, e.g., when dealing with triplets that involve different but similar relations across other support graphs. as shown in figure 1 , on the support graphs of the target rela-tion created_by, the relations produced_by and published_in preserve similar meanings. however, the strategy of learning edge masks fails to harness the valuable insights from these different yet similar relations, resulting in the insufficient extraction of information from created_by. (2) the extracted common subgraph (masks) often contains unrelated spurious information that can negatively impact prediction performance. for example, during the extraction process in figure 1 regarding the target relation created_by, the support graphs may include spurious relations like related_job, as it can be unhelpful or even misleading when predicting query triplets of relation created_by. to overcome the aforementioned challenges, we propose safer (subgraph adaptation for fewshot relational reasoning), a novel subgraphbased approach that effectively utilizes useful information from support graphs while excluding spurious information. in safer, we first generate the contextualized graphs of support and query triplets with edge weights representing the importance of each relation for performing relational reasoning. subsequently, we perform subgraph adaptation comprising two crucial modules: support adaptation and query adaptation, which aim to extract valuable information from support graphs and exclude spurious information, respectively. in our support adaptation module, we incorporate information from each support graph into others to enable the adaptation to support graphs with different structures to extract and utilize useful information, e.g., similar relations. in our query adaptation module, we adapt the support information to the structure of the query graph so that spurious information among support graphs can be filtered out in a query-adaptive manner. as a result, we can effectively alleviate the adverse impact of spurious information. in summary, our contributions in this paper are as follows: query adaptation (qa) module that allows for excluding the influence of spurious information in the extracted information. ## problem formulation we study the problem of few-shot knowledge graph relational reasoning, i.e., few-shot kgr @xcite . we first denote the background kg as @xmath0, r, t ), where e and r are sets of entities and relations. @xmath1, r, t)|h, @xmath2, @xmath3, each of which contains a head entity, a tail entity, and a relation. for a new target relation r ′ / ∈ r, we are given a support set s r ′ with k triplets {(h i , r ′ , t i )} k @xmath4, where h i , t @xmath5. the number of triplets in the support set k is relatively small (@xmath6. with s r ′ as the reference, we aim to predict tail entities, given a head entity h q , i.e., (h q , r ′ , ?). there are usually multiple candidates of the tail entity that need to be scored and ranked. then the candidate with the highest score is considered as the prediction result. so we will consider the query triplet (h q , r ′ , c) (c is a candidate) as a full triplet to score. ## methodology in this section, we introduce details of our proposed framework safer. as illustrated in figure 2 , for each support (or query) triplet, we first extract a support (or query) graph from the background kg and assign weights for each edge on the graph. then we conduct subgraph adaptation on the generated support and query graphs and finally achieve the prediction score for a query triplet. ## experiments in this section, we elaborate on the experiments for evaluating our proposed framework. ## conclusion in this paper, we introduce safer, a novel approach designed to address the challenges in fewshot knowledge graph relational reasoning (fewshot kgr). safer overcomes the limitations of existing methods by extracting useful information while excluding spurious information. we first generate edge-weighted subgraphs of triplets to retrieve useful information from the knowledge graph. with the generated subgraphs, we perform support adaptation, which enables the incorporation of useful information that is difficult to extract (e.g., different yet similar relations). subsequently, our query adaptation module filters out spurious information that is easily extracted (e.g., unhelpful relations that are shared across support graphs). experimental evaluations on three datasets demonstrate the superiority of safer over other state-ofthe-art baselines under different evaluation metrics. in summary, our work provides valuable insights into the potential of subgraph adaptation to improve performance on few-shot kgr tasks.