M eta TKG : Learning Evolutionary Meta-Knowledge for Temporal Knowledge Graph Reasoning (2022)

Abstract: Reasoning over Temporal Knowledge Graphs (TKGs) aims to predict future facts based on given history. One of the key challenges for prediction is to learn the evolution of facts. Most existing works focus on exploring evolutionary information in history to obtain effective temporal embeddings for entities and relations, but they ignore the variation in evolution patterns of facts, which makes them struggle to adapt to future data with different evolution patterns. Moreover, new entities continue to emerge along with the evolution of facts over time. Since existing models highly rely on historical information to learn embeddings for entities, they perform poorly on such entities with little historical information. To tackle these issues, we propose a novel Temporal Meta-learning framework for TKG reasoning, MetaTKG for brevity. Specifically, our method regards TKG prediction as many temporal meta-tasks, and utilizes the designed Temporal Meta-learner to learn evolutionary meta-knowledge from these meta-tasks. The proposed method aims to guide the backbones to learn to adapt quickly to future data and deal with entities with little historical information by the learned meta-knowledge. Specially, in temporal meta-learner, we design a Gating Integration module to adaptively establish temporal correlations between meta-tasks. Extensive experiments on four widely-used datasets and three backbones demonstrate that our method can greatly improve the performance.

## introduction temporal knowledge graphs (tkgs) @xcite are of great practical values as an effective way to represent the real-world timeevolving facts. in tkgs, the expression of a fact is extended from a triple to a quadruple, such as (obama, run f or, president, 2012). due to the great practical values of tkgs, related research on tkg reasoning has continued to emerge in recent years. in this paper, we mainly focus on predicting future facts over tkgs, which is beneficial for a wide range of practical scenarios such as health care and financial analysis. specifically, given a tkg that contains historical facts from t 0 to t n , we aim to predict new facts at timestamp t with @xmath0, such as @xcite . the vast majority of existing solutions on tkg reasoning @xcite @xcite mainly focus on exploring evolutionary information in history to obtain effective temporal embeddings for entities and relations. however, it is far from sufficient to only consider the temporal information for the complex evolution process of facts. specifically, due to the diversity of facts, they exhibit various evolution patterns in the evolution process. this brings up the issue that most models are hard to adapt to future data with different evolution patterns. for example, models trained with facts before covid-19 are hard to adapt to facts that happen under the circumstance of covid-19, because the evolution pattern of facts changes with the outbreak of covid-19. thus, it is important to learn variations in evolution patterns so as to guide models quickly adapt to future data with diverse evolution patterns. however, existing tkg reasoning models ignore the learning for evolution patterns. from figure 1a , we can see the performance of existing tkg models drops along time, because models trained on historical data learn the old pattern which is not applicable to future data @xcite . moreover, as facts evolve constantly over time, there will be new entities continuing to emerge during the evolution of facts. most of these new entities have little historical information and thus are hard to learn. as shown in figure 1b , we can see that an extremely great number of future entities appear less than 50 times during evolution, and the performance of existing methods on such entities is much worse than others. hence, improving the performance on entities with little historical information is necessary for prediction. however, most existing methods fail to address the issue, because they highly rely on sufficient historical information to obtain effective temporal embeddings of entities. to deal with the aforementioned challenges, we propose a novel temporal meta-learning framework for tkg reasoning, metatkg for brevity. metatkg is plug-and-play and can be easily applied to most existing backbones for tkg prediction. specifically, metatkg regards tkg prediction as many temporal meta-tasks for training, and utilizes a temporal meta-learner to learn the evolutionary meta-knowledge from these meta-tasks. specially, each task consists of two kgs with adjacent time stamps in tkgs. in this way, the temporal meta-learner can learn the variation in evolution patterns of two temporally adjacent kgs, which can guide the backbones to learn to adapt quickly to future data with different evolution patterns. besides, from the learning process of each task, the backbones can derive the meta-knowledge learned from entities with sufficient history to study how to obtain effective embeddings for entities with little historical information. moreover, we specially design a gating integration module in temporal metalearner according to the characteristics of tkgs, to adaptively establish the temporal correlations between tasks during the learning process. to summarize, the major contributions can be listed as follows: ## related work there are mainly two settings in tkg reasoning: interpolation and extrapolation. in this paper, we focus on the latter setting, which aims to predict future facts based on the given history. and we briefly introduce the applications of meta-learning in kgs and tkgs in this section. tkg reasoning with extrapolation setting. several early attempts such as ghnn @xcite , know-evolve @xcite and dyrep @xcite build a temporal point process to obtain continuous-time dynamics for tkg reasoning, but they merely focus on continuous-time tkgs. recently, re-net @xcite ) models tkgs as sequences, utilizing r-gcns and rnns to capture structural and global temporal information, respectively. following re-net, re-gcn @xcite captures more complex structural dependencies of entities and relations, and utilizes static information to enrich embeddings of entities. besides, cygnet @xcite proposes a copy-generation mechanism, which utilizes recurrence patterns in history to obtain useful historical information. tango @xcite applies the neural ordinary differential equations (nodes) on tkgs to capture continuous temporal information. and cen @xcite considers the length diversity of history and explores the most optimal history length of each dataset for prediction. moreover, xerte @xcite designs an inference graph to select important entities for prediction, which visualizes the reasoning process. and titer @xcite presents a path-search model based on reinforcement learning for tkg prediction. however, all of these models are unable to well adapt to new data with diverse evolution patterns, and fail to learn entities with little historical information. ## preliminaries in this section, we mainly formulate tkgs and the problem of tkg reasoning, then give brief notations used in this work. definition 1 (temporal knowledge graph). let e and r represent a set of entities and relations. a temporal knowledge graph (tkg) g can be defined as a temporal sequence consisting of kgs with different timestamps, i.e., @xmath1, g 2 , • • • , g n }. each g @xmath2. and a fact is described as a quadruple (e s , r, e o , t), in which e s , e @xmath3. definition 2 (tkg reasoning). the task of tkg reasoning with extrapolation setting can be categorized into entity prediction and relation prediction. the entity prediction task aims to predict the missing object entity of (e s , r, ?, t + 1) or the missing subject entity of (?, r, e o , t+1) similarly, the relation prediction task aims to predict the missing relation of (e s , ?, e o , t + 1). in this paper, we mainly evaluate our models on the entity prediction task. definition 3 (backbones for tkg reasoning). we denote tkg reasoning backbones as a parametrized function f θ with parameters θ. definition 4 (meta-task). in the traditional setting of meta-learning @xcite , the training process is based on a set of meta-tasks. we denote a meta-task as t t . each meta-task consists of a support set t s t and a query set t q t , which can be denoted as t @xmath4, t q t }. during the training process of each task t t , the backbones are first trained on t s t . then the backbones are trained on t q t with the feedback from the loss of t s t . ## proposed approach in this section, we present the proposed metatkg in detail. the framework of our model is shown in figure 2 . in metatkg, tkg prediction is regarded as many temporal meta-tasks for training. the temporal meta-learner in our model is built to learn evolutionary meta-knowledge from these meta-tasks. we aim to guide the backbones to learn to adapt quickly to future data and learn to deal with entities with little historical information by the learned meta-knowledge. moreover, in the temporal meta-learner, the gating integration module shown in the middle part of figure 2 is specially designed to adaptively capture the temporal correlation between tasks. ## experiment in this section, we conduct experiments to evaluate metatkg on four typical datasets of temporal knowledge graph and three backbones for tkg prediction. the implementation details can be seen in appendix b. then we answer the following questions through experimental results and analyses. ## conclusion in this paper, we have proposed a novel temporal meta-learning framework metatkg for tkg reasoning, which can be easily served as a plugand-play module for most existing tkg prediction models. metatkg regards tkg prediction as temporal meta-tasks, and utilizes a temporal meta-learner to learn the evolutionary meta-knowledge from these tasks. metatkg aims to guide the backbones to adapt quickly to future data and enhance the performance on entities with little historical information by the learned meta-knowledge. specially, in the temporal meta-learner, we develop a gating integration module to establish temporal correlations between tasks. extensive experiments on four benchmarks and three state-of-the-art backbones for tkg prediction demonstrate the effectiveness and superiority of metatkg.