Learning to Sample and Aggregate: Few-shot Reasoning over Temporal Knowledge Graph
Anonymous Author(s)
AfﬁliationAddress email
Abstract
In this paper, we investigate a realistic but underexplored problem, called few-shottemporal knowledge graph reasoning, that aims to predict future facts for newlyemerging entities based on extremely limited observations in evolving graphs.
Itoffers practical value in applications that need to derive instant new knowledgeabout new entities in temporal knowledge graphs (TKGs) with minimal supervision.
The challenges mainly come from the few-shot and time shift properties of newentities.
First, the limited observations associated with them are insufﬁcient fortraining a model from scratch.
Second, the potentially dynamic distributions fromthe initially observable facts to the future facts ask for explicitly modeling theevolving characteristics of new entities.
We correspondingly propose a novel Meta
Temporal Knowledge Graph Reasoning (MetaTKGR) framework.
Unlike priorwork that relies on rigid neighborhood aggregation schemes to enhance low-dataentity representation, MetaTKGR dynamically adjusts the strategies of samplingand aggregating neighbors from recent facts for new entities, through temporallysupervised signals on future facts as instant feedback.
Besides, such a meta temporal reasoning procedure goes beyond existing meta-learning paradigms on staticknowledge graphs that fail to handle temporal adaptation with large entity variance.
We further provide a theoretical analysis and propose a temporal adaptation regularizer to stabilize the meta temporal reasoning over time.
Empirically, extensiveexperiments on three real-world TKGs demonstrate the superiority of MetaTKGRover eight state-of-the-art baselines by a large margin.
Introduction
Temporal knowledge graphs (TKGs) [25, 3, 20], storing temporally evolving facts (By facts, we referto a subject entity has a relation with an object entity at some time, e g., “ Macron ” was “ elected ”as “ French president ” in “ 2017 ”).
It has been increasingly used in various knowledge-driven andtime-sensitive applications, such as social event forecasting [28, 21], question answering [30] andrecommendation [50, 49].
Large scale TKGs are hard to obtain due to the time-varying nature oflabels and the excessive cost of human annotation.
As such, automating prediction and reasoningabout missing facts over time has attracted more recent interest [36, 9, 12, 37, 19].
However, mostprior efforts are limited to reasoning about existing entities but neglecting the commonly observedlow-data regime where many new entities emerge with extremely few observations as new events ortopics evolve over time [33].
This restricts their applicability
Instead, inspired by the human ability to recognize new concepts from exposure to only very fewinstances, we propose and solve a practical and challenging few-shot temporal knowledge graphreasoning problem that speciﬁcally aims to predict future facts for newly emerging entities witha few observed links on TKGs.
For example, as shown in Figure 1, there is only one observable fact about a new person joining the TKG, yet our goal is to predict their missing facts in the future.
Existing efforts [14, 39, 1, 7] in similar settings simplify the task by ignoring the emergence ofnew entities over time and randomly simulating unseen entities on static knowledge graphs.
Thisformulation, originating from few-shot learning in the vision domain [10, 29], fails at capturingthe real-world divergence between the distributions of seen and unseen entities.
To the best of ourknowledge, the generalized few-shot temporal reasoning task, that aims to imitate the fast learningability of humans, has still not been formally investigated.
Time travel to work in ! " !
# ! $ ? ?
existing entity new entity few-shot links founded in travel to acquire work in founded in leave work in [Figure] to isfriend
[Figure] The challenges in solving this problem are two-fold: 1)few-shot : the extremely few facts associated with newentities cannot provide sufﬁcient information for representation learning from scratch.
2) time shift : new entitiesusually exhibit different characteristics in the future, dueto the time-evolving nature of TKGs.
It leads models togeneralize poorly in the future.
Unfortunately, prior workfails to overcome these two challenges simultaneously.
On one hand, to enhance low-data entity characterization,a diverse range of neighborhood aggregation schemes thatretrieve related information from other entities are explored, such as hard subgraph sampling methods (e.g., vanilla hop-based sampling [31], randomsampling [15], personalized Pagerank sampling [47], importance sampling [5], etc) and soft samplingvia trainable attention mechanisms [36, 37, 19].
However, those rigid methods cannot well adapt tothe new entities with the time-varying distributions due to the lack of instant supervision.
On theother hand, recent attempts [1, 48, 18, 4] leverage meta-learning to improve unseen entity adaptation.
While the setup for unseen entities is simulated by randomly splitting entity sets from static graphs,they fail to handle the more realistic temporal adaptation with large entity variances.
To overcome both the aforementioned challenges, we propose a novel Meta Temporal Knowledge
Graph Reasoning (MetaTKGR) framework, where learning the strategies for sampling and aggregating neighbors from recent facts (to enhance the new entities’ predictions) can be dynamicallyadapted from signals of temporal supervision on their future facts as instant feedback.
Intuitively, theglobal knowledge of sampling and aggregating can be extracted as learning to learn ability throughsuch a meta-optimization, which takes the time-evolving nature of knowledge into consideration,avoiding progressive performance drift over time.
Concretely, we formulate this learning strategy tobe parameterized by a temporal encoder.
On the simulated new entities during training phase, startingfrom the initial few-shot links, the temporal encoder can softly sample and attentively integraterelative and time-aware information from the temporal neighbors, making the strategy learning(neighbor sampling + aggregation) differentiable.
The quantitative measurement of how well thecurrent strategy performs can be reﬂected in the performance on predicting future facts allowingone to automatically adjust the strategy in turn.
During the nested loop for meta-optimization, weﬁrstly learn the temporal encoder on recent facts ( inner loop ), then gradually increase the difﬁcultiesby autoregressively adapting it to farther away future facts ( outer loop ).
Furthermore, to betterestimate the supervision signal given by future facts in different and unseen distributions, we adoptthe PAC-Bayes method [26] to theoretically analyze the temporal adaptation bound on the future facts.
This can serve as an adaptation regularizer to provide stability and improve the generalization abilityof current strategy over time.
Empirically, extensive experiments on three real-world TKGs validatethe effectiveness of MetaTKGR, which signiﬁcantly outperforms all baselines from static/temporal
KG reasoning and few-shot (knowledge) graph learning areas, by up to 11 .
4% relative gain on averagewith competitive efﬁciency.
To sum up, our main contributions are three-fold:
• Problem formulation: We explore a practical few-shot temporal knowledge graph reasoning
setting, minimizing the gap with the realistic few-shot learning scenarios for humans.
[Table] • Novel framework: We propose a novel meta temporal reasoning framework on TKGs, namely MetaTKGR, to address both few-shot and time shift challenges.
• Extensive evaluation: the proposed MetaTKGR method demonstrates signiﬁcant gains in effectiveness on three real-world TKGs over a diverse range of state of the art baselines.
Problem Deﬁnition
In this section, we formally deﬁne the few-shot temporal knowledge graph reasoning task.
First ofall, a temporal knowledge graph can be deﬁned as follows:
Deﬁnition 2.1 ( Temporal Knowledge Graph).
A temporal knowledge graph can be denoted as
G T = { ( e s , r, e o , t ) } ✓ E T ⇥ R ⇥ E T ⇥ T , where E T denotes a set of entities that appear in time 94 interval (0 , T ) ,
R denotes relation set, and T denotes timestamp set.
Each temporal link ( e s , r, e o , t )refers to the fact that a subject entity e s 2 E T has a relation r 2 R with an object entity e o 2 E T at 96 timestamp t 2 T .
As a temporal knowledge graph evolves, new entities continuously emerge, leading to an expansionof the entities set E T over time.
We further deﬁne new entities as follows:
Deﬁnition 2.2 ( New Entities in a Temporal Knowledge Graph).
Given a time interval ( T, T 0 )( T 0 > T ), entities that join the graph during ( T, T 0 ) , i.e., ˜ e 2 E T 0 \ E T ( \ denotes setminus), aredeﬁned as new entities on time interval ( T, T 0 ) .
Knowledge graph reasoning (KGR) is essentially the problem of predicting missing facts in thepartially observed KG.
While existing few-shot KGR models simulate unseen entities by randomlyselecting from the existing entities, we focus speciﬁcally on predictions for newly emerging entitiesover time, which can be formalized as few-shot temporal knowledge graph reasoning task:
Deﬁnition 2.3 ( Few-shot Temporal Knowledge Graph Reasoning).
Given a temporal knowledgegraph G T collected no later than T , for each new entity ˜
e 2 E T 0 \ E T ( T 0 > T ) , we assume the ﬁrst 108 K associated facts are observed: { (˜ e, r i , e i , t i ) or ( e i , r i , ˜ e, t i ) } Ki =1 .
The task aims to predict themissing entities in the future facts (˜ e, r, ? , t ) or (? , r, ˜ e, t ) given the relation r 2 R and speciﬁc timet 2 ( T, T 0 ) .
We further assume K is a small number, as a realistic setting.
Learning to Sample And Aggregate with MetaTKGR
In this section, we present a novel framework MetaTKGR to solve the few-shot temporal knowledgegraph reasoning problem.
We ﬁrst introduce the basic setup of our learning objective and the overallframework, and then detail the temporal encoder module to represent new entities, followed byintroduction of meta temporal reasoning for model training. Learning Objective .
Suppose we are given a temporal knowledge graph G T
= { ( e s , r, e o , t ) } ✓
E T ⇥ R ⇥ E T ⇥ T collected no later than time T .
For each new entity ˜ e appearing within a later interval 118 ( T, T 0 ) , we aim to predict future links (˜ e, r, e, t ) or ( e, r, ˜ e, t ) happening at timestamp t 2 ( T, T 0 ) .
Towards this goal, we measure correctness of each possible quadruple by a score function s ( · ;  )parameterized by  , and maximize the scores of true quadruples containing any new entities in orderto rank them higher than all other false quadruples: [Equation] , where ˜
[Equation]
where p ( ˜ E ) denotes distribution of all new entities,  denotes parameters of model to represententity/relation into d -dimensional space h ˜ e , h e , h r 2 R d .
To represent ˜ e into h ˜ e via  , as aforementioned, the challenges lie in how to enable  to encode generalized knowledge (how to sample andaggregate temporal neighbors) that can be easily adapted to new ˜ e and achieve robust performanceover time, even for a long time interval ( T, T 0 ) .
We thereby formulate few-shot temporal knowledgegraph reasoning as a meta-learning problem to extract such knowledge. MetaTKGR Framework .
Figure 2 shows the MetaTKGR framework.
To be more formal, eachtask corresponds to each new entity ˜ e over distribution p ( ˜ E ) , and the links can be represented asa chronological sequence { (˜ e,
r i , e i , t i ) or ( e i , r i , ˜ e, t i ) | t i 2 ( T, T 0 ) , t i  t j if i < j } N ˜ e i =1 , where 131 N ˜ e denotes total number of links associated to ˜ e .
Then we divide them into support set S ˜ e
={ (˜ e, r i , e i , t i ) or ( e i , r i , ˜ e, t i ) } K i =1 , and query set Q ˜
e = { (˜ e, r i , e i , t i ) or ( e i , r i , ˜ e, t i ) } N ˜
e i =
K +1 , where 133 K denotes the amount of initially observable facts of ˜ e .
During the meta-training phase, we simulate a set of new entities from existing entity set by assumingthere are only few-shot links of these entities (support set S ˜ e ).
The model ﬁrst ﬁne-tunes parameters on S ˜ e ( inner loop ), and then minimizes the predictive loss on corresponding query set Q ˜ e using the
[Figure]
[Figure]
ability over time.
updated parameters  ˜
e ( outer loop ).
It optimizes the global sampling and aggregation strategy asgeneralized knowledge (i.e., learning to learn ability) by this bi-level optimization, as this proceduremimics the normal machine learning and inference process.
For simplicity, to represent new entity˜ e along time, we denote f  ˜ e as the temporal encoder parameterized by  ˜ e , L ( f  ˜ e , S ˜ e ) as model 141 predictive loss on
S ˜ e .
Model-agnostic meta-learning (MAML) [10] can be utilized to fulﬁll this goalas follows:
[Equation]
where ⌘ denotes inner-loop learning rate.
However, this training strategy cannot guarantee goodgeneralization ability over time ( challenge 2 ), as they assume identical distributions between S ˜ e and
Q ˜ e , contradicting the facts that new entities are highly evolving over time on TKGs.
To coherentlyresolve the two challenges, we advance the existing few-shot KG reasoning works by proposing:
• Temporal encoder , which learns the time-aware representation of each new entity ˜ e by
sampling and aggregating information from TKG neighbors on continuous domain.
• Meta temporal reasoning , which learns an optimal sampling and aggregating strategy that
can be easily adapted to new entities.
It
explicitly
assumes the distribution discrepancy between S ˜ e and Q
˜
e , so as to improve the model generalization ability over time. Input: New entity ˜ e , temporal knowledge graph G t , current timestamp t , neighbor budget b , time bound  t . Output: Temporal Neighbor N ˜ e ( t ) . Initialize Queue ˜ e , N ˜ e ( t ) {} ; while |N ˜
e ( t ) | < b and Queue is not empty do e
Queue.dequeue () ; for each ( e s , r, e o , t ) in G t do if e s ==
e and t > t max   t then
Add ( e s , r, t ) to N ˜ e ( t ) , Add e s to Queue ; if e o ==
e and t > t max   t then
Add ( e o , r, t ) to N ˜ e ( t ) , Add e o to Queue ;
Temporal Encoder .
On temporalknowledge graphs, entities are evolvingover time.
The temporal encoder f  isdesigned to embed each entity ˜ e intolow-dimensional latent space at eachtime: h ˜ e ( t ) 2 R d , where it can modelthe temporal pattern of ˜ e along time.
Bydoing so, it resolves the scarcity issuescaused by few-shot links to some extent.
Towards this goal, f  ﬁrst samplestemporal neighbors from TKGs, then attentively aggregates information fromthe temporal neighbors of each entity,which takes neighbor feature, relationfeature and time feature into account.
To better represent few-shot entities, awider range of neighbors should be considered, as the close neighbors around the new entities areusually insufﬁcient.
Conventionally, stacking several graph neural networks (GNNs)-based layerscan integrate information from multi-hop neighbors [31, 15].
In few-shot cases, such layer-bylayer procedure faces difﬁculties.
For one thing, the limited one-hop neighbors can dominate theaggregation process, as the information of multi-hop neighbors is all propagated from them to thetarget entity.
Also, the size of neighbors grows exponentially with the increase of GNN layers, as theycollect all neighbors in each hop without strategic selection, causing severe efﬁciency issues.
Instead,our temporal encoder ﬁrst samples multi-hop neighbors via a time-bounded breadth-ﬁrst-search algorithm, then aggregates information directly from the sampled neighbors in an attentive manner.
As summarized in Algorithm 1, at each time, it selectively samples up to b multi-hop temporalneighbors N ˜ e ( t ) which have interactions within a recent time range  t .
Given the temporal neighbor N ˜ e ( t ) for each new entity, temporal encoder f
represents a new entity as h ˜ e ( t ) at time t :
[Equation]
where l denotes the layer number,  ( · ) denotes the activation function ReLU , ↵ ˜ e,e i denotes theattention weight of entity i to new entity ˜ e , and W is the trainable transformation matrix.
Toaggregate from history, ↵ ˜ e,e i is supposed to be aware of entity feature, time delay and topologyfeature induced by relations.
Thus, we design ↵ ˜ e,i as follows:
[Equation]
where q ˜ e,e i measures the pairwise importance by considering the entity embedding, relation embedding and time embedding, a 2 R 4 d is the shared parameter in the attention mechanism.
Following [40], we adopt random Fourier features as time encoding  (  t ) to reﬂect the time [-difference.3.
-]difference.
Meta Temporal Reasoning .
Let h L ˜ e ( t ) denote the representations of new entity ˜ e produced byf  with L layers.
For each quadruple (˜ e, r, e, t ) , we deploy translation-based score function [2] tomeasure the correctness: s (˜ e, r, e, t ;  ) =
k h L ˜ e ( t ) + h r  h
Le ( t ) k 2 .
We ﬁrst ﬁne-tune f  on supportset S
˜ e for entity-speciﬁc parameters f  ˜ e , and then optimize training loss on query set Q ˜ e to learn the 191 global parameters shared by all entities.
To calculate the predictive loss, since each set only containspositive quadruples, we perform negative sampling [2] to update MetaTKGR by training it to rankpositive quadruples higher than negative ones.
Speciﬁcally, taking the support set S ˜ e of entity ˜ e as anexample, we construct a negative set S  ˜
e = { (˜ e, r, e  , t ) or ( e  , r, ˜ e, t ) } by replace the ground truthentity e with a corrupted entity e  .
We then use empirical hinge loss on the given set as follows:
[Equation]
where  > 0 is a margin value to distinguish positive and negative quadruples.
Algorithm
Input: Temporal knowledge graph
[Equation]
initialized
[Equation]
Output: Learned global parameter  . Simulate new entity set ˜ E from E T ; Train model parameter  from many-shot entities
E T \ ˜ E ; Construct
S ˜ e and Q ˜ e for each new entity ˜ e , where
Q
[Equation]
e } ; while  not converge do for each time interval m do for each new entity ˜ e do
Calculate ˆ L ( f  , S ˜ e ) on S ˜ e by Eq. 5; Perform adaptation by Eq.
6 to update
˜ e ;
Calculate ˆ L ( f  ˜ e , Q ( m ) ˜
[Equation]
) by
Calculate temporal adaptation regularizer by Eq Update  ( m ) by 9;   ( m )
During the meta-training phase, foreach task corresponding to new entity˜ e ⇠ p ( ˜ E ) , we ﬁrst adapt the globalparameter  for each new entity ˜ e byminimizing the predictive loss on thesupport set S ˜ e :
[Equation]
where ⌘ is the inner loop learning rate.
By Eq.
6, we simulate the adaption fornew entities.
Updating from an optimal global parameter  , the model isﬁne-tuned into entity-speciﬁc for newentities.
Thus, it is crucial to design ameta-learning strategy to learn an optimal global parameter  with a robustgeneralization ability over time.
Since new entities evolve over time,it is not only Q ˜ e but also each part of Q ˜ e that follows different distributions.
Thus, instead of optimizing the metalearner on the whole query set Q ˜ e at 217 once by Eq. 2,
we ﬁrst adapt entityspeciﬁc parameters  ˜
e to recent facts, then gradually increase the difﬁculties by autoregressively adapting it to farther away future facts.
Through this process, we are able to guide and stablize thetraining of global parameters via a temporal signal.
Speciﬁcally, we split the time span of query setsinto M equidistant time intervals, where each new entity has a sequence of query set correspondingto different time intervals Q ˜ e = {Q (1)˜ e , Q (2)˜ e , · · · , Q ( M ) ˜
e } .
We ﬁrst adapt and optimize  ˜
e for eachnew entity on Q (1)˜ e for  (1) encoding global knowledge for predictions in the 1 -st time interval.
Thenwe gradually adapt each  ˜
e ﬁne-tuned from last time interval on farther away intervals until  ( M ) islearned, which maintain temporal robustness from time interval 1 to M .
We then discuss how to measure the feedback (predictive loss) from each adaptation.
To simulatereal scenarios, we assume query sets to follow different and unseen distributions.
Taking adaptationfrom m -th time interval to m + 1 -th time interval as example, we view p (  ( m ) ) as prior parameterdistribution and aim to learn the posterior parameter distribution q (  ( m +1) ) conditioning on queryset in m + 1 -th interval.
The unseen query set distribution in m + 1 -th interval prevent us to estimateq (  ( m +1) ) by either using unbiased empirical loss or Bayes rules.
To resolve this, we instead adoptthe PAC-Bayes method [26], which allows one to learn a parameter posterior that ﬁts the observationswithout knowing the observations distribution.
We propose the following theorem to relate realpredictive loss in new time interval with its empirical verson:
Theorem 3.1 ( PAC-Bayes Generalization Bound on Temporal Adaptation).
Let D ( m +1) =
S ˜ e 2 ˜ E Q ( m +1)
˜
e denote all query sets in m + 1 -th time interval of all new entities from ˜ E .
For any 2 (0 , 1) and learned parameter distribution p (  ( m ) ) in last time interval, with probability at least1   on D ( m +1) :
[Equation]
where L ( f  ( m ) , D ( m +1) )
=
E ˜ e ⇠ p (˜ E ) h L ( f  ( m ) ˜
e , Q ( m +1)
˜ e ) i denotes real predictive loss on new timeinterval with new and unknown data distribution, ˆ L ( f  ( m ) , D ( m +1) ) denote the empirical version ofthe loss, and KL ( · k · ) is the Kullback-Leibler divergence.
Readers can refer to Appendix A.1 for proof.
Thus, using Theorem 3.1, we can adapt  ( m ) to m + 1time interval and estimate the feedback (predictive loss) for our meta-learning framework via thefollowing temporal adaptation regularizer :
[Equation]
Remark .
To interpret the temporal adaptation regularizer R ( f  ( m ) ; D ( m +1) ) , it can be viewed as acombination of empirical risk on the query set in the new time interval as well as a regularizer ofparameter distribution across time intervals in form of KL-divergence.
The regularizer along timedomain can guarantee that global knowledge  is trained by predictive losses from all time intervalswithout overﬁtting in speciﬁc time interval.
Thus, we can improve the generalization ability of ourmeta-learner over time by the following update step by step, from m = 1 to m =
M :
[Equation]
where  (0) can be obtained by training on existing entities.
The meta-training phase of MetaTKGR issummarized in Algorithm 2.
During meta-test phase, given a new entity ˜ e , we can ﬁrst ﬁne-tune  onfew-shot links, and then utilize f  ˜ e to represent ˜ e for future predictions.
Experiment
Datasets.
We evaluate the proposed MetaTKGR framework on three public TKGs, where YAGO [25]and WIKI [20] stores time-varying facts and ICEWS18 [3] is event-centric.
They are collected fromdifferent time ranges and have different time units, which can validate our framework in the contextof various types of evolution.
Notably, most new entities appear with few-shot facts, validating thepractical value of our proposed setting.
Table 1 shows the detailed statistics.
We report detaileddataset descriptions as well as entity links distribution in the Appendix A.2.
[Table]
[Table] [Table]
Baselines.
We compare eight state-of-the-artbaselines from four related areas: 1) TransE
TransR [24], 3) RotatE
Translationdistance based embedding methods for staticknowledge graphs; 4) RE-NET [19]: A temporal knowledge graph embedding method; 5) LAN [39]; 6) I-GEN [1]; 7) T-GEN [1]: Few-shotmethods on static knowledge graph; 8) MetaDyGNN [45]: A meta-learning framework for few-shotlink prediction on homogeneous graphs.
We describe the baselines in detail in Appendix A.3.
Experimental Setup.
Given the temporal knowledge graph, we ﬁrst split the time duration into fourwith a ratio of 0.4:0.25:0.1:0.25 chronologically, then we collect the entities that ﬁrstly appear in eachperiod as training/meta-training/meta-validation/meta-test entity set.
We train our model on trainingset as initialization and simulate few-shot tasks on meta-training set.
To construct few-shot tasks, weassume the ﬁrst K = 1 , 2 , 3 quadruples of new entities are known and report the performance of theremaining quadruples in the future.
For fair comparison, we keep the dimension of all embeddings as128 , and utilize pre-trained 1 -shot TransE embeddings for initialization for models if applicable.
Wereport detailed experimental setup, especially of MetaTKGR, in the Appendix A.4.
Evaluation Protocol and Metrics.
For each prediction (˜ e, r, ? , t ) or (? , r, ˜ e, t ) , we use rankingscheme to evaluate the performance.
Speciﬁcally, we rank all entities at the missing position inquadruples, and adopt mean reciprocal rank ( MRR ) and Hits at {1,3,10} ( H@{1,3,10} ) as evaluationmetrics.
It is worth noting that we measure the ranks in a ﬁltered setting, where we ﬁlter other truequadruples existing in datasets, following [24, 35].
Main Results.
Table 2 and Table 3 report overall result for K = 3 and K = 1 , 2 few-shot experimentsrespectively.
Our model outperforms all baselines by 11 .
4% relative gains on average, demonstratingthe superiority of MetaTKGR in modeling new entity evolution in low-data regime.
Baselines( TransE, TransR, RotatE, RE-NET ) that do not optimize for new entities perform poorly on alldatasets, although they are trained on both existing entities and new entities with few-shot links.
LAN, I-GEN, T-GEN also produce unsatisﬁed results, despite the fact that they propose special designsto represent new entities.
Note that they have worse performance in some cases than RE-NET thatdoes not optimize for new entities, as they ignore the temporal information and perform poorly infuture predictions.
Compared with MetaDyGNN, MetaTKGR shows consistently better performance, because our temporal encoder can handle multi-relational graphs in low-data regimes better, and ourtemporal meta-learning framework can produce more robust predictions.
Performance of Prediction over Time .
Next,we study the performanceof MetaTKGR over time.
Figure 3 shows the performance comparisons of3 -shot predictions overdifferent timestamps onthe YAGO and ICEWS18datasets, measured byﬁltered H @10 metrics.
MetaTKGR consistently beats all strong baselines.
Although the comparedbaselines can optimize newly emerging entities, they perform poorly in wide time intervals becausethey largely ignore the temporal information and the distribution discrepancy caused by evolution.
We notice that the relative gains of our model get more signiﬁcant with increasing time steps.
Itillustrates that our temporal meta-learning framework can improve the generalization ability overtime.
Performance on ICEWS18 ﬂuctuates more severely.
This is expected since the evolution of
ICEWS18 is not stable due to the much shorter time unit (day).
Ablation Study .
We evaluate performance improvements brought by the temporal meta-learningframework by following ablations: 1) Fine-Tuning is trained on existing entities without using anymeta-learning strategy, and then ﬁne-tuned on new entities; 2) Static Meta-Learning utilizes conventional MAML to train models; 3) MetaTKGR w/o Regularizer meta-trains model parameters on eachtime interval step by step, without explicitly optimizing the temporal adaptation regularizer.
Figure 4reports the results measured by ﬁltered H @10 .
We can conclude that modeling the distributiondiscrepancy caused by the temporal evolution and optimizing the temporal adaptation regularizer canimprove the performance in the future prediction.
Also, simply ﬁne-tuning the model parameters onnew entities leads to poor results, as during training phase, the model does not extract generalizedknowledge that can be easily adapted to new entities
[Table]
[Table]
Cross-shot Learning .
In reality, new entities are usually associated with various numbers of factsinitially.
Thus, the robustness of models on different numbers of shots during testing phase is critical.
To simulate such scenario, we evaluate MetaTKGR by varying the number of shots including 1-,3-, 5-, and random-shot (R-S: between 1 and 5) during meta-training and meta-test phases.
Table 4reports the cross-shot learning results.
As expected, with the increase of observable shots duringtesting phase, the performance becomes better.
The differences in the number of shots used fortraining do not signiﬁcantly affect the results, demonstrating that MetaTKGR trained with a ﬁxednumber of shots performs robustly under the various number of shots during testing.
Efﬁciency Analysis .
To demonstrate the efﬁciency of our temporal meta-learning framework, we train
MetaTKGR and baseline models from scratch on both existing entities and new entities and comparethe training time, for the 3-shot experiment on YAGO.
Figure 5 shows that MetaTKGR signiﬁcantlyoutperforms baseline models with reasonable training time.
Compared with slow temporal models
RE-NET, MetaDyGNN for knowledge graph reasoning, MetaTKGR is more efﬁcient because 1) ourtemporal encoder can learn temporal entity embeddings via sampled temporal neighbors at eachcontinuous timestamp without using RNNs; 2) our temporal neighborhood sampler can prevent thesize of multi-hop neighbors from increasing exponentially.
Related Work
Few-shot Learning on Knowledge Graph .
Few-shot learning (FSL) [41] aims at learning generalized knowledge from existing tasks to extract transferable priors for new tasks with few labeled samples, including metric learning based approaches [38, 34] and meta-learning based approaches [10, 29, 11, 46].
For knowledge graph reasoning, the success of few-shot learning has facilitated learning the representations of scarce entities [14, 39, 32, 1] and scarce relations [48, 43, 6, 27]respectively.
In this paper, we are primarily interested in works to represent entities with few-shotfacts, as relation set is relatively stable along time [33].
Given a new entity linked with few-shotfacts, the neighborhood aggregator used in graph neural networks (GNNs) reduces the inductivebias via structural knowledge [15, 31].
[14] computes the representations of few-shot entities by
GNN-based neighboring aggregation scheme.
[39, 32, 27] further extend it by utilizing attentionmechanisms.
However, those models are usually trained on both many-shot and few-shot entities,ending up being suboptimal for few-shot entities.
To address it, a recent work [1] explores how tomate-train the neighborhood aggregator so as to effectively adapt global knowledge for few-shotknowledge reasoning.
More broadly on homogeneous graphs, Meta-Graph [4], G-Meta [18] and
MetaDyGNN [45] are proposed to utilize meta-learning for link prediction across multiple graphs, onstatic/temporal homogeneous graphs respectively.
However, most of the above works are designedfor few-shot learning on static (knowledge) graphs.
How to aggregate neighbors considering timefactors and optimize for long-term performance are unsolved.
MetaDyGNN [45] is a very recentframework combining MAML with TGAT [8] on temporal homogeneous graph.
But it did notconsider distribution difference between few-shot facts and future facts caused by the evolution ofnew entities either, leading to increasingly poor performance over time, especially on temporal KGswith much more complicated structures.
Temporal Knowledge Graph Reasoning .
Temporal knowledge graphs (TKGs) store time-varyingfacts in the real-world.
Temporal knowledge graph reasoning aims to predict missing facts at acertain time in the future.
It is mostly formulated as measuring the correctness of factual samples andnegative samples by specially designed score functions [2].
Compared with static KG reasoning tasks,the main challenge lies in how to incorporate time information into the representation process.
Severalembedding-based methods have been proposed.
They encode time-dependent information of entitiesand relations by decoupling embeddings into static component and time-varying component [44,13, 16], utilizing recurrent neural networks (RNNs) to adaptively learn the dynamic evolution fromhistorical fact sequence [19, 42], or learning a sequence of evolving representations from discreteknowledge graph snapshots [17, 23, 22, 19].
However, all of the existing temporal KG reasoningmodels aim to extrapolate future facts among existing entities, and how to predict future factsspeciﬁcally for new emerging entities is largely under-explored.
Conclusion
We studied a realistic but underexplored few-shot temporal knowledge graph reasoning problem,which aims at predicting future facts for newly emerging entities with a few facts.
To this end, weproposed a novel Meta Temporal Knowledge Graph Reasoning framework, namely MetaTKGR.
Itextracts the global knowledge of sampling and aggregating temporal neighbors, which can be adapted to new entities for future prediction.
Such procedure is gradually guided by the performance on predicting future facts, from near time intervals to far away ones.
We further theoretically analyzed and proposed a temporal adaptation regularizer to stabilize and generalize the learned knowledge on future tasks.
We empirically validated the effectiveness of MetaTKGR on three real-world temporal knowledge graphs, on which the proposed framework signiﬁcantly outperforms an extensive set of
SOTA baselines