Learning Latent Relations for Temporal Knowledge Graph Reasoning
Year: 2023

Abstract:
Temporal Knowledge Graph (TKG) reasoning aims to predict future facts based on historical data. However, due to the limitations in construction tools and data sources, many important associations between entities may be omitted in TKG. We refer to these missing associations as latent relations. Most of the existing methods have some drawbacks in explicitly capturing intra-time latent relations between co-occurring entities and inter-time latent relations between entities that appear at different times. To tackle these problems, we propose a novel Latent relations Learning method for TKG reasoning, namely LTKG. Specifically, we first utilize a Structural Encoder (SE) to obtain representations of entities at each timestamp. We then design a Latent Relations Learning (LRL) module to mine and exploit the intraand inter-time latent relations. Finally, we extract the temporal representations from the output of SE and LRL for entity prediction. Extensive experiments on four datasets demonstrate the effectiveness of LTKG.

heading: 1 Introduction
text: Temporal knowledge graphs (TKGs) play a vital role in capturing temporal facts in the real world. Each fact in a TKG is represented as a quadruple (s, r, o, t), such as (Obama, run for, president, 2012). Reasoning over TKGs involves two primary settings: interpolation and extrapolation. In recent years, there has been significant interest in the extrapolation setting due to its practical value in event prediction (Deng et al., 2020), question answering (Mavromatis et al., 2022), and other applications. In the extrapolation setting, the objective is to predict facts that occur at a time t with t > tn, based on the historical information available in the TKG from t0 to tn.
*To whom correspondence should be addressed.
Most extrapolation models utilize the temporal and structural information available in the TKG for reasoning. For example, RE-NET (Jin et al., 2020a) and RE-GCN (Li et al., 2021) incorporate recurrent neural networks and graph neural networks to capture the temporal and structural dependencies of historical TKG sequences. Additionally, xERTE (Han et al., 2021a) and TITer (Sun et al., 2021) develop sub-graph search and path search strategies to predict target entities based on existing TKG structures, respectively.
While these methods demonstrate promising results in TKG reasoning, they still face the challenge of missing associations within TKGs. Specifically, the majority of TKG data is automatically identified and extracted from diverse news articles, such as ICEWS data (Boschee et al., 2015). Many crucial associations between entities may be omitted from TKGs due to the limitations of construction tools and data sources. We refer to these missing associations as latent relations between entities. Existing approaches fail to explicitly discover and utilize these latent relations, which manifest primarily in two aspects.
Firstly, existing methods fail to explicitly capture intra-time latent relations between co-occurring en-
12617
tities. During TKG reasoning, certain concurrent entities may lack direct connections but exhibit strong semantic correlations. Figure 1 illustrates this phenomenon, where Afghanistan and Taliban are not connected in the TKG for May 2021. However, in reality, the Taliban was involved in negotiations with Afghanistan during that time, significantly impacting the situation in Afghanistan. Hence, it is crucial to model the critical latent relations among concurrent entities. Most existing TKG reasoning models rely on Relational Graph Neural Networks (RGNNs) (Schlichtkrull et al., 2018; Li et al., 2021) to capture the semantic dependencies between entities at each timestamp. However, RGNNs heavily depend on existing edges or associations, making it challenging to model critical semantic dependencies among indirectly connected entities.
Secondly, existing methods ignore the inter-time latent relations between entities appearing at different timestamps. Some entities at various timestamps can exhibit strong semantic dependencies, providing essential auxiliary information for TKG reasoning. Therefore, it is necessary to consider the associations between these entities. Taking Figure 1 as an example, the impact of the USA in May 2021 on Afghanistan in August 2021 is significant. However, as these two entities appear at different times, they cannot be directly related in the TKG. Existing TKG reasoning models primarily focus on modeling the semantic dependencies of the same entities at different times but fall short when addressing entities at distinct timestamps.
To address the aforementioned challenges, we propose a novel Latent relations Learning method for TKG reasoning, L2TKG for brevity. The overall framework of L2TKG is presented in Figure 2. Specifically, we first employ a Structural Encoder (SE) to generate the representations of entities at each timestamp. Inspired by graph structural learning (Jin et al., 2020b; Zhu et al., 2021b; Liu et al., 2022), we design a Latent Relations Learning module (LRL) for learning the two types of missing associations in TKG reasoning. Utilizing the embeddings of entities at each timestamp, LRL enables the creation of new crucial associations between unconnected entities in a learnable manner and then encodes the learned latent relational graph to obtain more comprehensive representations of entities. Finally, we extract temporal representations from the output of SE and LRL components
for the entity prediction task. In summary, our work makes the following main contributions: • We emphasize and investigate the necessity
of capturing critical missing associations in TKG reasoning. • We introduce graph structure learning into TKG reasoning, and propose a novel and effective latent relations learning method to alleviate the problem of missing associations in TKG reasoning. • We conduct extensive experiments on four typical TKG datasets, which demonstrate the effectiveness of our proposed model.

heading: 2 Related Work
text: In this paper, we illustrate the related work about TKG reasoning under the extrapolation setting and graph structure learning.

heading: 2.1 TKG Reasoning under the Extrapolation Setting
text: TKG reasoning under the extrapolation setting aims to predict new facts in future timestamps based on historical TKG sequence.
Specifically, GHNN (Han et al., 2020) and Know-Evolve (Trivedi et al., 2017) use temporal point process (TTP) to model the TKG data for capturing the continuous-time temporal dynamics, and they predict the future facts by estimating the conditional probability of TTP. CyGNet (Zhu et al., 2021a) proposes a copy-generation mechanism that predicts the future based on repeating patterns in historical facts.
Some recent methods (Jin et al., 2020a; Li et al., 2021, 2022) combine graph neural networks (GNNs) and recurrent neural networks (RNNs) to model the semantic and temporal dependencies between entities. For instance, RE-NET (Jin et al., 2020a) incorporates RNNs and RGCNs to capture the temporal and structural dependencies from entity sequences. RE-GCN (Li et al., 2021) considers adjacent structural dependencies of entities while introducing static properties of entities. To incorporate global temporal information, TiRCN (Li et al., 2022) designs a global history encoder network that collects repeated historical facts. HGLS (Zhang et al., 2023b) designs a Hierarchical Graph Neural Network to explicitly encode long-term temporal information. Furthermore, TANGO (Han et al., 2021b) employs Neural Ordinary Differen-
tial Equations for fine-grained temporal information in TKG reasoning, specifically for forecasting future links. Additionally, some works (Han et al., 2021a; Sun et al., 2021) propose sub-graph or path search strategies for TKG reasoning. xERTE (Han et al., 2021a) designs an explainable model for entity prediction, utilizing a sub-graph search strategy to identify answer entities. TITer (Sun et al., 2021) performs a path search based on reinforcement learning to predict future entities, incorporating a time-shaped reward using the Dirichlet distribution for guiding model training. Recently, MetaTKG (Xia et al., 2022) proposes a temporal meta-learner to learn evolution patterns of facts. CENET (Xu et al., 2023) combines the contrastive learning strategy with TKG models to identify significant entities from historical and nonhistorical dependency. However, all of these above methods rely on existing associations between entities or structures in TKG and disregard the utilization of important latent associations between entities.

heading: 2.2 Graph Structure Learning
text: Graph Neural Networks (GNNs) have gained significant attention for their ability to handle graphstructured data and have shown promising performance in various tasks, including Recommender Systems (Wu et al., 2019; Chen and Wong, 2020; Zhang et al., 2021, 2020a, 2023a) and Natural Language Processing (Yao et al., 2019; Zhang et al., 2020b). However, it has been observed that graph data can contain noise, which can negatively impact the training of GNNs (Jin et al., 2020c). To address this issue, researchers have proposed graph structure learning (GSL) methods, which aim to jointly learn an optimized graph structure and node representations.
GSL models can be categorized into three main categories (Zhu et al., 2021b): metric-learningbased methods (Jiang et al., 2019; Chen et al., 2020; Cosmo et al., 2020; Li et al., 2018b), probabilistic methods (Franceschi et al., 2018, 2019; Zhang et al., 2019), and direct-optimized methods (Yang et al., 2019; Jin et al., 2020c). For example, PTDNet (Luo et al., 2021) proposes a parameterized topological denoising network to improve the robustness and generalization performance of GNNs by learning to drop task-irrelevant edges. LDS (Franceschi et al., 2019) introduces a method for simultaneous learning of graph structure and graph convolutional network parameters. This is achieved
by solving an approximate bilevel program that determines a discrete probability distribution on the graph edges. NeuralSparse (Chen et al., 2020) proposes a supervised graph sparsification technique that improves generalization power by learning to remove potentially task-irrelevant edges from input graphs.
Drawing inspiration from GSL approaches, our work centers on metric-learning-based methods. The goal is to discover new and important missing associations within TKG data while obtaining optimal entity representations for TKG reasoning.

heading: 3 Preliminaries
text: In this section, we introduce the definition of TKG, formulate the task of TKG reasoning, and explain some notations used in this paper.
Definition 1 (Temporal Knowledge Graph). Let E and R represent a set of entities and relations. A quadruple qt = (es, r, eo, t) represents a relation r ∈ R that occurs between subject entity es ∈ E and object entity eo ∈ E at time t. All quadruple occurring at time t constitute a knowledge graph Gt. ets ∈ Gt indicates that entity es occurs at time t. A temporal knowledge graph (TKG) G is defined as a sequence of knowledge graphs with different timestamps, i.e., G = {G1,G2, · · · ,Gt}. Definition 2 (Temporal Knowledge Graph Reasoning). This paper primarily emphasizes the entity prediction task within TKG reasoning. The objective of the entity prediction task is to forecast the missing object entity of (es, r, ?, t+ 1) or the missing subject entity of (?, r, eo, t+ 1) based on the historical KG sequence {G1,G2, · · · ,Gt}.
Let xs ∈ Rd and xr ∈ Rd denote the static embedding of entity es and relation r, where d represents the dimension. The general paradigm of TKG reasoning is to learn future representations of each entity for predicting Gt+1 by using the historical KG sequences {Gi}ti=0, along with static entity and relation embeddings xs and xr. The embeddings xs and xr serve as learnable parameters.

heading: 4 Methodology
text: In this section, we present the proposed L2TKG. The overall framework of L2TKG is illustrated in Figure 2. There are three main components: (1) Structural Encoder (SE), which captures the semantic dependencies among concurrent entities at each timestamp using the existing TKG structure.
(2) Latent Relations Learning (LRL), which mines and exploits critical intra-time and inter-time latent relations between entities. (3) Temporal Representation Learning, which extracts temporal representation for each entity from the output of SE and LRL.

heading: 4.1 Structural Encoder
text: At each timestamp, there exist strong semantic dependencies among connected co-occurring entities. To capture these semantic dependencies, we propose a structural encoder based on relational graph convolution neural network (Schlichtkrull et al., 2018; Li et al., 2021), which aims to obtain the embedding of each entity at the timestamp of its appearance.
Formally, the structural encoder can be defined as follows:
hl+1s,ti = f
  ∑
eo∈N ties
W1 ( hlo,ti + xr ) +W2h l s,ti  
where N ties is the set of neighbors of es in Gti , f(·) is the ReLU function, W1 and W2 ∈ Rd×d are trainable weight parameter matrices in each layer, and the initial entity embedding h0s,ti and h 0 o,ti are set to static embedding xs and xo. After ω-layer convolution, the entity representation hωs,ti at time ti is obtained. We denote the embedding of es at time ti as hs,ti , omitting the superscript ω.

heading: 4.2 Latent Relations Learning
text: After capturing the semantic dependencies among concurrent entities at each timestamp, we introduce a latent relations learning module to identify and leverage significant missing associations: intratime latent relations and inter-time latent relations, between historical entities.

heading: 4.2.1 Learning latent relational graph
text: The purpose of this part is to mine latent relations between entities appearing in TKG sequence G = {Gt−L, · · · ,Gt}. In this context, the same entity appearing at different times is treated as distinct entities, such as etis and e tj s . Consequently, the number of entities considered in this module is N =
∑t tk=t−L ntk , where ntk represents the num-
ber of entities in Gtk , and L represents the length of historical sequence.
Assuming no loss of generality, we posit that highly associated entities also exhibit similarity
within the embedding space. As a result, we first compute the similarity between entity embeddings. There are many similarity metrics that can be chosen. We use simple cosine metrics to compute the similarity:
d(x,y) = (W3x)
T (W4y)
∥W3x∥∥W4y∥ , (1)
where ·T represents transposition, W3 and W4 ∈ Rd×d are learnable weight parameters.
To reduce the complexity of calculations, we only calculate the similarity between entity pairs that have not connected in the TKG sequence. Next, we will introduce in detail how to obtain the crucial intra-time and inter-time latent relations, respectively. Intra-time latent relation learning. We calculate the similarity between any two entity representations appearing at the same timestep tp but not becoming connected. The similarity matrix Stp ∈ Rntp×ntp between unconnected entities at time tp is computed by
S tp i,j = d(hei,tp ,hej ,tp), (2)
where (ei, ej) ∈ Gtp and (ei, r, ej , tp) /∈ Gtp , for all r ∈ R. For other case, the value of Stpi,j is set to 0.
To retain important latent relations and reduce noise interference, we use the sparse operation based on k-NN (Chen et al., 2009) for each matrix Stp , that is: for each entity, we only keep latent relations with the top-k scores. In this way, the final similarity matrix at time tp is calculated as:
Ŝ tp i,j =
{ S tp i,j , S tp i,j ∈ Top-k(S tp i,:)
0, otherwise , (3)
where Stpi,: denotes the i-row of S tp . Each Ŝtp records the important intra-time latent relations between entities at time tp. Inter-time latent relation learning. We calculate the similarity between any two entity representations appearing at different timesteps tp and tq.
Q tp,tq i,j = d(hei,tp ,hej ,tq), (4)
where ei ∈ Gtp , ej ∈ Gtq , tp ̸= tq. For other cases, the value of Qtp,tq is 0. Similar to intra-time latent relation learning, we also perform sparsification on the similarity matrix:
Q̂ tp,tq i,j =
{ Q
tp,tq i,j , Qi,j ∈ Top-k(Q tp,tq i,: )
0, otherwise . (5)
Each Q̂tp,tq records the important inter-time latent relation between entities at different times.
We independently choose Top-k values for the sparse operations in learning the two types of latent relations, denoted as k1 and k2, respectively. Based on the acquired similarity matrices, we proceed to construct a latent relational graph denoted as P . Specifically, if Ŝtpi,j > 0, we construct an intra-time latent relation between etpi and e tp j within P . Similarly, if Q̂tp,tqi,j > 0, we construct an inter-time latent relation between etpi and e tq j within P . In this graph P , we solely consider latent relations and omit original relations of the TKG sequence. Furthermore, similar to existing relations, we transform the two types of latent relations into lowdimensional embedding vectors, which serve as learnable parameters. To facilitate presentation, we directly employ numerical numbers {1, ..., N} to represent the nodes in P in the subsequent section.

heading: 4.2.2 Encoding latent relational graph
text: After obtaining the latent relational graph P , we perform message propagation and aggregation operations on it to capture the semantic dependencies of entities under the newly learned associations.
In specific, we first utilize a graph attention mechanism (Lv et al., 2021) to calculate the coefficient between two adjacent nodes i and j under the learned latent relation r in P:
αij = exp
( f ( aTW3 [ zli ∥ zlj ∥ zijr ]))
∑ k∈Ni exp ( f ( aTW3 [ zli ∥ zlk ∥ zikr ])) ,
where initial embedding z(0)i is the corresponding entity embedding obtained by Structural Encoder (§4.1), zijr is the embedding of latent relation between node i and node j, Ni is the set of neighbors of i in P , a ∈ R3d and W5 ∈ R3d×3d are learnable weight parameters in each layer, f(·) is the LeakyReLU activation function, and ∥ is the concatenation operation.
After that, we obtain a more comprehensive representation for each entity by aggregating the embeddings from its neighbors in the latent relational graph,
zl+1i = g
 ∑
k∈Ni αijW6
( zlk + z ik r ) +W7z l i   ,
where g(·) is the ReLU activation function, W6 and W7 are weight parameter matrices in each layer. For simplicity, we use zi to represent z β i after β-layer operation.

heading: 4.3 Temporal Representations Learning
text: In addition to the semantic dependencies under different relations, the temporal patterns of entities are also crucial for TKG reasoning. This section discusses how to obtain the temporal representations of entities based on the output of SE and LRL.

heading: 4.3.1 Global temporal representation
text: Since the LRL module captures the semantic dependencies of the entity under the new associations, its output contains more global information. We
further input them into GRU to get the global temporal representation of each entity:
eGs,t+1 = GRUG ( eGs,t, zs,t ) , (6)
where zs,t corresponds to the output representation of LRL (§4.2) at entity ets.

heading: 4.3.2 Local temporal representation
text: Local temporal representation reflects the semantic changes of entities in recent times. Following (Li et al., 2021, 2022), we adopt GRU to encode the most recent m timestamps of each entity based on the output of the structural encoder:
eLs,t+1 = GRUL ( eLs,t,hs,t ) , (7)
where hs,t is the corresponding entity embedding obtained by Structural Encoder (§4.1).

heading: 4.3.3 Gating Integration
text: To facilitate model reasoning, we adopt a learnable gating function (Hu et al., 2021) to adaptively integrate the global and local temporal representations into a unified temporal representation. Formally,
es,t+1 = σ(ge)⊙ eGs,t+1 + (1− σ(ge))⊙ eLs,t+1,
where ge ∈ Rd is a gate vector parameter to tradeoff two types of temporal information of each entity e, σ(·) is to constrain the value of each element in [0, 1], and ⊙ denotes element-wise multiplication.

heading: 4.4 Parameter Learning
text: In this section, we describe how to get the score for each quadruple (es, r, eo, t + 1) and the learning objective for training our model.
We first calculate the probability of interaction between entity es and eo under the relation r at time t+ 1. Formally,
pt+1(o|s, r) = σ (eo,t+1 f (es,t+1,xr)) , where f(·) is decoder function ConvTransE (Li et al., 2021), es,t+1 and eo,t+1 are temporal representations that contain both global- and local temporal information. The learning tasks can be defined as,
Le = − T∑
t=0
∑
(es,r,eo,t+1)∈Gt+1 log pt+1(o|s, r).
Thus, the objective function is as follows:
L = Le + λ1∥Θ∥2, where ∥ · ∥2 is L2 norm and λ1 is to control regularization strength.

heading: 5 Experiments
text: In this section, we perform experiments on four TKG datasets to evaluate our model. We aim to answer the following questions through experiments.
• Q1: How does L2TKG perform compared with state-of-the-art TKG reasoning methods on the entity prediction task? • Q2: How does L2TKG perform in learning missing associations? • Q3: How do different components affect the L2TKG performance? • Q4: How sensitive is L2TKG with different hyper-parameter settings?

heading: 5.1 Experimental Setup

heading: 5.1.1 Datasets
text: We evaluate our L2TKG on four representative TKG datasets in our experiments: ICEWS14 (García-Durán et al., 2018), ICEWS18 (Jin et al., 2020a), ICEWS05-15 (García-Durán et al., 2018), and GDELT (Jin et al., 2020a). The first three datasets are from the Integrated Crisis Early Warning System (Boschee et al., 2015) and record the facts in 2014, 2018, and the facts from 2005 to 2015, respectively. The last one is from the Global Database of Events, Language, and Tone (Leetaru and Schrodt, 2013). The details of data split strategy and data statistics are shown in Appendix A.

heading: 5.1.2 Baselines
text: We compare L2TKG with static KG (SKG) reasoning models: DisMult (Yang et al., 2015),ComplEx (Trouillon et al., 2016), R-GCN (Schlichtkrull et al., 2018), ConvE (Dettmers et al., 2018), and RotatE (Sun et al., 2019), as well as TKG models such as CyGNet (Zhu et al., 2021a), RE-NET (Jin et al., 2020a), xERTE (Han et al., 2021a), TIEer (Sun et al., 2021), RE-GCN (Li et al., 2021), TiRCN (Li et al., 2022), and CENET (Xu et al., 2023). We provide implementation details of baselines and L2TKG in Appendix B and C, respectively.

heading: 5.1.3 Evaluation Metrics
text: We adopt widely-used metrics (Jin et al., 2020a; Li et al., 2021), MRR and Hits@{1, 10} to evaluate the model performance in the experiments. For a fair comparison, we follow the setup of Li et al. (2022), using the ground truth history during multi-step inference, and report the experimental results under the time-aware filtered setting for all compared models.
Model ICEWS14 ICEWS05-15 ICEWS18 GDELT
MRR Hit@1 Hit@10 MRR Hit@1 Hit@10 MRR Hit@1 Hit@10 MRR Hit@1 Hit@10
DisMult 25.31 17.93 42.22 17.43 10.08 30.12 16.59 10.01 31.69 15.64 9.37 29.01 ComplEx 32.33 23.21 52.37 23.14 14.56 41.63 18.84 11.41 25.78 12.23 8.30 20.36
RGCN 28.14 19.43 46.02 27.43 20.15 44.62 18.04 8.57 35.68 10.93 4.59 22.38 ConvE 30.93 21.74 50.18 25.25 16.07 44.34 24.28 15.61 44.59 17.28 10.34 30.63 RotatE 27.53 18.60 47.62 19.39 10.19 38.57 15.35 7.10 33.09 5.48 1.96 13.76
CyGNet 37.65 27.43 57.90 40.42 29.44 61.60 27.12 17.21 46.85 20.22 12.35 35.82 RE-NET 39.86 30.11 58.21 43.67 33.55 62.72 29.78 19.73 48.46 19.55 12.38 34.00 xERTE 40.79 32.70 57.30 46.62 37.84 63.92 29.31 21.03 46.48 19.45 11.92 34.18 TITer 41.73 32.74 58.44 47.60 38.29 64.86 29.98 22.05 44.83 18.19 11.52 31.00

heading: 5.2 Performance Comparison (RQ1)
text: The performance of all models on the entity prediction task is presented in Table 1. Based on the results, we made the following observations: L2TKG achieves the best performance on all ICEWS datasets with most evaluation metrics, which verifies the effectiveness of our model. Specifically, L2TKG significantly outperforms all compared static models, demonstrating the importance of modeling temporal information in TKG reasoning. Our model is better than RE-GCN and TiRCN. The reason might be that RE-GCN only utilizes the most recent historical sequence of TKG and neglects the global historical information of the entities. Although TiRCN considers more historical dependencies than RE-GCN, it only utilizes the first-order repetitive patterns of global history. Our L2TKG not only encodes some recent information but also exploits more learned latent relations between historical entities, allowing it to make better use of global historical data than TiRCN. Compared with L2TKG and TiRCN, both the RE-NET and CyGNET ignore the use of local temporal information about entities and thus perform less well than most TKG models. In contrast to our model, xERTE and TITer employ sub-graph-based search and path-based search, respectively, for target entity prediction. However, their search methods are constrained by existing paths, limiting their search scope and compromising their performance.
In the case of the GDELT data, it contains a higher number of facts at each time, and the issue of
missing associations is less severe. Consequently, our model exhibits limited improvement compared to state-of-the-art models.

heading: 5.3 Performance Comparison in Learning Missing Associations (RQ2)
text: To further validate the capacity of L2TKG in discovering and leveraging latent relations, we evaluate its performance on datasets with different levels of missing associations. On the ICEWS and GDELT datasets, we mask a range of {0.1, ..., 0.9} of the existing relations in the knowledge graph for each timestamp. Figure 3 presents the performance comparison of RE-GCN, TiRCN, and L2TKG using various mask ratios, while Figure 4 illustrates the relative improvements of L2TKG over RE-GCN and TiRCN. From the results, we have the following observations:
From Figure 3 we find that the performance of all models decreases to different degrees as the mask rate increases, which is due to the gradual decrease of historical association information in the dataset. Nonetheless, our model suffers a relatively small drop in performance and maintains satisfactory results even when faced with significant missing association information (mask rate > 0.6). In Figure 4, the relative performance improvement of our model compared to RE-GCN and TiRCN gradually increases. In particular, the model performance improves substantially when the mask rate exceeds 0.6. These findings all indicate that our latent relations learning method can effectively mine and exploit the missing associa-
tions between entities and alleviate the problem of missing associations in history.

heading: 5.4 Ablation Studies (RQ3)
text: To investigate the superiority of each component in our model, we compare L2TKG with different variants in terms of MRR. Specifically, we modify L2TKG by removing the latent relation learning module (w/o LRL), intra-time relation learning of LRL (w/o LRL-Intra), inter-time relation learning
of LRL (w/o LRL-Inter), local temporal representation module (w/o Ltr), global temporal representation module (w/o Gtr), and structural encoder (w/o SE), respectively. We show their results in Table 2 and have the following findings: L2TKG significantly outperforms L2TKG (w/o LRL) on all datasets, which confirms that our latent relations learning module effectively discovers and utilizes missing important associations in TKG sequence to assist prediction tasks. L2TKG (w/o LRL-Intra) and L2TKG (w/o LRL-Inter) also achieves better performance than L2TKG (w/o LRL). The improvements verify that both learned inter-time and intra-time latent relations contribute to model performance. Compared with L2TKG (w/o LRL-Intra) and (w/o LRL-Inter), the performance of L2TKG is further improved, which means that two latent relations play different roles in promoting the prediction of the model, and it is necessary to use both latent relations together. L2TKG also obtains significant improvements over L2TKG (w/o Ltr) and L2TKG (w/o Gtr), indicating that both global- and local-temporal information can effectively enhance the performance on the prediction task. The improvement between L2TKG and L2TKG (w/o SE) verifies the importance of capturing the semantic dependencies among co-occurring entities.

heading: 6 Sensitivity Analysis (RQ4)
text: The structural encoder (SE) and latent relation learning (LRL) are two vital modules in our model. This section studies how hyper-parameters, the k value of the sparse operations (Intra-time and Intertime learning), and the layer numbers of LRL and SE affect the performance of L2TKG.

heading: 6.1 Effect of k Values in LRL
text: The values of k1 and k2 determine the number of newly learned intra-time and inter-time latent rela-
tions, respectively. Figure 5 illustrates the performance of model for different values of k1 and k2. When adjusting one ki value, the other ki utilizes the optimal value. A ki value of 0 indicates that our model does not consider the corresponding types of latent relation learning.
From the results, we can find that the performance of L2TKG improves initially as the two k values increase. This finding confirms that the two latent relations can provide more effective information for TKG reasoning. However, as k continues to increase, the trend begins to decline. This decline could be attributed to the introduction of numerous unimportant latent relations that act as noise, thereby interfering with the model. This demonstrates the necessity of employing k-NN sparsification in the LRL module.

heading: 6.2 Effect of LRL Layer Nubmer β
text: The number of layers in LRL decides the degree of utilizing the latent relations. In this part, we conduct our model when the LRL layer number β is in the range of {0, 1, 2, 3, 4}. The results are shown in Figure 6 (yellow line). We can find our method achieves significant improvement between β = 0 and β > 0, which validates the rationality of mining the latent associations in TKG reasoning. When further stacking the LRL layer, the performance of L2TKG begins to deteriorate, which is probably because the LRL suffers from the over-smoothing problem (Li et al., 2018a).

heading: 6.3 Effect of SE Layer Number ω
text: The number of layers in SE determines the degree of modeling semantic dependencies among concurrent facts. We also set the SE layer number ω in the range of {0, 1, 2, 3, 4} and conduct our model. From the results in Figure 6 (blue line), we can find that our model achieves the best performance when ω = 2 and significantly outperforms the value at ω = 0, which demonstrates that utilizing the highorder neighbor information in concurrent entities can enhance the semantic representations of entities at each timestamp. As the number of layers further increases (ω > 2), the model’s performance begins to decline, which may be because the use of higher-order information makes it easy to introduce noise and lead to over-smoothing.

heading: 7 Conclusion
text: In this paper, we have proposed a novel method L2TKG for reasoning over TKG. We first obtain the embedding of each historical entity based on the structural encoder. Then, a well-designed latent relations learning module is proposed to mine and encode the two types of latent relations, obtaining comprehensive entity embeddings. Finally, we extract temporal representations of entities from the outputs of LRL and SE for final prediction. Experimental results on four benchmarks and extensive analysis demonstrate the effectiveness and superiority of L2TKG in TKG reasoning.
Limitations
In this section, we discuss the limitations of our model. Specifically, the selection of k values in the LRL module necessitates human involvement. Various types of data or entities may rely on distinct k values. While the majority of k values within a reasonable range lead to improvements in model performance, identifying the optimal value solely through human involvement poses challenges. Moving forward, we will investigate the automatic optimization of k values to enhance the model’s capacity for acquiring latent relations.

heading: Acknowledgement
text: This work is supported by National Natural Science Foundation of China (62141608, 62206291, U19B2038).

heading: A Dataset
text: We divide ICEWS14, ICEWS18, ICEWS05-15, and GDELT into training, validation, and test sets with a proportion of 80%, 10%, and 10% by timestamps following (Li et al., 2021). The statistics of four TKG datasets are summarized in Table 3.

heading: B Baselines
text: The comparison of static KG reasoning models with our work is presented as follows:
DisMult (Yang et al., 2015) is a model that proposes a simplified bilinear formulation to capture relational semantics.
ComplEx (Trouillon et al., 2016) is a model that converts the embedding into complex vector space to handle symmetric and antisymmetric relations.
R-GCN (Schlichtkrull et al., 2018) is a graph neural network that handles highly multi-relational graph data.
ConvE (Dettmers et al., 2018) is a model that adopts a 2D convolutional neural network to model the interactions between entities and relations.
RotatE (Sun et al., 2019), a model that defines each relation as a rotation from the subject entity to object entity in the complex vector space.
The temporal KG reasoning models compared to our model are:
CyGNet1 (Zhu et al., 2021a) is a model that utilizes recurrence patterns in historical facts to predict future facts.
RE-NET2 (Jin et al., 2020a) is a model that adopts RNN and RGCNs to capture the temporal and structural dependencies from entity sequences.
RE-GCN3 (Li et al., 2021) is a Recurrent Evolution network based on Graph Convolution Network (GCN), which learns the evolutional representations of entities and relations at each timestamp by
1https://github.com/CunchaoZ/CyGNet 2https://github.com/INK-USC/RE-Net 3https://github.com/Lee-zix/RE-GCN
modeling the KG sequence recurrently. It also incorporates the static properties of entities through a static graph module. However, to ensure fairness in comparisons among models, we remove the static properties in RE-GCN, as other models do not utilize additional information.
xERTE4 (Han et al., 2021a) is an explainable model that designs a sub-graph search strategy to identify answer entities.
TITer5 (Sun et al., 2021) is a reinforcement learning-based model, which performs a path search to predict future entities.
TiRCN6 (Li et al., 2022) is a model that utilizes a local recurrent graph encoder network to capture the historical dependency of events at adjacent timestamps. It also uses a global history encoder network to collect repeated historical facts. The static properties are removed to ensure fairness in comparisons among models.
CENET7 (Xu et al., 2023) is a model based on contrastive learning that learns both the historical and non-historical dependencies to distinguish the most potential entities.
C Implementation Deatils
We implement our L2TKG in Pytorch (Paszke et al., 2019) and DGL Library (Wang et al., 2019). We use Adam optimizer (Kingma and Ba, 2015) with learning rate set to 0.001 and l2 regularization λ2 set to 10−5. The embedding size is fixed to 200 for all methods. For the L2TKG hyper-parameters, we apply a grid search on the validation set: the k1 and k2 values are searched in {2, 4, ..., 20}, the SE layer number ω and LRL layer number β in {1, 2, 3, 4}, and the length of local temporal representation m in {1, 2, · · · , 10}.
For ICEWS14, ICEWS05-15, ICEWS18, and GDELT, the optimal k1 values are 8, 10, 6, and 6.
4https://github.com/TemporalKGTeam/xERTE 5https://github.com/JHL-HUST/TITer 6https://github.com/Liyyy2122/TiRGN 7https://github.com/xyjigsaw/CENET
The optimal k2 values are 10, 10, 6, and 8. The optimal LRL layer number β are 2, 2, 1, and 2. The optimal length of local temporal representation m for are 3, 5, 6, and 1, respectively. The optimal SE layer number ω is 2 for all datasets. For the SE, we set the block dimension to 2 × 2 and the dropout rate for each layer to 0.2. For the ConvTransE of the score function, the number of kernels, kernel size, and the dropout rate are set to 50, 2× 3, and 0.2, respectively.
To enhance the efficiency of L2TKG while maintaining performance, we appropriately preprocess historical TKG data when predicting queries of the form (es, r, ?, t+ 1). Specifically, we only use the historical KG sequence in which es has appeared for the learning of latent relations. For example, entity es has appeared at time t1, t2, and t3, where t3 < t + 1. Then we input the representations of entities in {Gt1 ,Gt2 ,Gt3} into the LRL module to mine and exploit important latent relations.
For the compared methods, we use the default hyper-parameters except for dimensions. We run the evaluation five times with different random seeds and report the mean value of each method. All experiments are conducted on NVIDIA Tesla V100 (32G) and Intel Xeon E5-2660.
D Efficiency
To examine the efficiency of our model, we compared L2TKG with RE-GCN, TiRCN, xERTE, and RE-NET in terms of inference time on the test set. As shown in Figure 7, despite the fact that our L2TKG uncovers and leverages numerous significant latent relations from historical entities, its inference speed surpasses that of TiRCN, xERTE, and RE-NET. We attribute this efficiency to the
sparsification operations of LRL (§4.2) and the appropriate processing of data (Appendix C). Moreover, the fundamental components of L2TKG primarily rely on the GNN model, which enables parallel computation, thus ensuring a more optimal balance between performance and efficiency.
ACL 2023 Responsible NLP Checklist

heading: A For every submission:
text: 3 A1. Did you describe the limitations of your work?
Limitation
3 A2. Did you discuss any potential risks of your work? There are no potential risks in our paper.
3 A3. Do the abstract and introduction summarize the paper’s main claims? Abstract and Section 1(Introduction)
7 A4. Have you used AI writing assistants when working on this paper? Left blank.
B 3 Did you use or create scientific artifacts? Section 2,3,4
B1. Did you cite the creators of artifacts you used? No response.
3 B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Section 5
7 B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? The use of existing artifacts in our paper is only for research.
7 B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? The use of existing artifacts in our work is only for research.
7 B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? The documentation of the artifacts is not the focus of our research.
3 B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Section 5.1.1 and Appendix A
C 3 Did you run computational experiments? Section 5, 6, Appendix C and D.
3 C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Yes, Appendix C reports the computing infrastructure used.
The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance.
3 C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Section 6 and Appendix C.
3 C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Appendix C
3 C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Appendix C
D 7 Did you use human annotators (e.g., crowdworkers) or research with human participants? Left blank.
D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? No response.
D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants’ demographic (e.g., country of residence)? No response.
D3. Did you discuss whether and how consent was obtained from people whose data you’re using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? No response.
D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? No response.
D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? No response.

heading: Future Work
text: , 2021a) is a model that utilizes recurrence patterns in historical facts to predict future facts. RE-NET2 (Jin et al. , 2020a) is a model that adopts RNN and RGCNs to capture the temporal and structural dependencies from entity sequences. RE-GCN3 (Li et al. , 2021) is a Recurrent Evolution network based on Graph Convolution Network (GCN), which learns the evolutional representations of entities and relations at each timestamp by
1https://github. com/CunchaoZ/CyGNet 2https://github. com/INK-USC/RE-Net 3https://github. com/Lee-zix/RE-GCN
modeling the KG sequence recurrently. It also incorporates the static properties of entities through a static graph module. However, to ensure fairness in comparisons among models, we remove the static properties in RE-GCN, as other models do not utilize additional information. xERTE4 (Han et al. , 2021a) is an explainable model that designs a sub-graph search strategy to identify answer entities. TITer5 (Sun et al. , 2021) is a reinforcement learning-based model, which performs a path search to predict future entities. TiRCN6 (Li et al. , 2022) is a model that utilizes a local recurrent graph encoder network to capture the historical dependency of events at adjacent timestamps. It also uses a global history encoder network to collect repeated historical facts. The static properties are removed to ensure fairness in comparisons among models. CENET7 (Xu et al. , 2023) is a model based on contrastive learning that learns both the historical and non-historical dependencies to distinguish the most potential entities. C Implementation Deatils
We implement our L2TKG in Pytorch (Paszke et al. , 2019) and DGL Library (Wang et al. , 2019). We use Adam optimizer (Kingma and Ba, 2015) with learning rate set to 0. 001 and l2 regularization λ2 set to 10−5. The embedding size is fixed to 200 for all methods. For the L2TKG hyper-parameters, we apply a grid search on the validation set: the k1 and k2 values are searched in {2, 4,. , 20}, the SE layer number ω and LRL layer number β in {1, 2, 3, 4}, and the length of local temporal representation m in {1, 2, · · · , 10}. For ICEWS14, ICEWS05-15, ICEWS18, and GDELT, the optimal k1 values are 8, 10, 6, and 6. 4https://github. com/TemporalKGTeam/xERTE 5https://github. com/JHL-HUST/TITer 6https://github. com/Liyyy2122/TiRGN 7https://github. com/xyjigsaw/CENET
The optimal k2 values are 10, 10, 6, and 8. The optimal LRL layer number β are 2, 2, 1, and 2. The optimal length of local temporal representation m for are 3, 5, 6, and 1, respectively. The optimal SE layer number ω is 2 for all datasets. For the SE, we set the block dimension to 2 × 2 and the dropout rate for each layer to 0. 2. For the ConvTransE of the score function, the number of kernels, kernel size, and the dropout rate are set to 50, 2× 3, and 0. 2, respectively. To enhance the efficiency of L2TKG while maintaining performance, we appropriately preprocess historical TKG data when predicting queries of the form (es, r, ?, t+ 1). Specifically, we only use the historical KG sequence in which es has appeared for the learning of latent relations. For example, entity es has appeared at time t1, t2, and t3, where t3 < t + 1. Then we input the representations of entities in {Gt1 ,Gt2 ,Gt3} into the LRL module to mine and exploit important latent relations. For the compared methods, we use the default hyper-parameters except for dimensions. We run the evaluation five times with different random seeds and report the mean value of each method. All experiments are conducted on NVIDIA Tesla V100 (32G) and Intel Xeon E5-2660. D Efficiency
To examine the efficiency of our model, we compared L2TKG with RE-GCN, TiRCN, xERTE, and RE-NET in terms of inference time on the test set. As shown in Figure 7, despite the fact that our L2TKG uncovers and leverages numerous significant latent relations from historical entities, its inference speed surpasses that of TiRCN, xERTE, and RE-NET. We attribute this efficiency to the
sparsification operations of LRL (§4. 2) and the appropriate processing of data (Appendix C). Moreover, the fundamental components of L2TKG primarily rely on the GNN model, which enables parallel computation, thus ensuring a more optimal balance between performance and efficiency. ACL 2023 Responsible NLP Checklist