Towards Multi-Relational Multi-Hop Reasoning over Dense Temporal Knowledge Graphs (2024)

Abstract: Temporal knowledge graph reasoning has emerged as a crucial task for answering timedependent questions within a knowledge graph (KG). Despite tremendous progress, the present research is impeded by the sparsity of a temporal KG and an over-reliance on simple singlerelational reasoning patterns. To overcome these challenges, we introduce MulQuestions, a new temporal KG reasoning benchmark featuring over 200k entities and 960k questions designed to facilitate complex, multi-relational and multi-hop reasoning. Additionally, we propose a new model adept at conducting patternaware and time-sensitive reasoning across temporal KGs. The model’s efficacy is confirmed through rigorous evaluations, showcasing its effectiveness in sparse data conditions and adeptness at handling questions with long reasoning chains. We have made our benchmark and model publicly accessible at https://github.com/Zihe2003/Mul2Questions.

heading: 1 Introduction
text: Temporal knowledge graph reasoning involves the task of answering questions related to timedependent facts within a knowledge graph (KG) (García-Durán et al., 2018; Jia et al., 2021; Saxena et al., 2021; Lan et al., 2022; Chen et al., 2023). For example, given two facts with time duration: (Barack Obama, position, President of US, 2009- 2017) and (George W. Bush, position, President of US, 2001-2009), for a time-related question “Who was the president of the United States before Barack Obama?”, a model for this task should infer that the answer is “George W. Bush”. Recent benchmarks such as (Saxena et al., 2021) and MultiTQ (Chen et al., 2023) have greatly improved this task and expanded its applicability.
Despite notable progress, the current study on temporal knowledge graph reasoning faces challenges of the sparsity of KGs and oversimplified
*Equal Contribution
reasoning patterns. The CronQuestions benchmark (Saxena et al., 2021), for example, uses templates with only five temporal relations to generate questions — this produces a sparse reasoning graph after filtering the original KGs and can significantly ease the reasoning. Furthermore, it is worth noting that a substantial proportion (84.5%) of the questions in previous benchmarks (Saxena et al., 2021; Chen et al., 2023) involve only single-relational reasoning patterns, as shown in the top of Figure 1. In such cases, the reasoning is simplified because only one relation is involved, and the answer is sure to have the same relation shared with the two entities that appear in the questions. There remains a lack of evaluations on complex multi-relational and multi-hop reasoning patterns, as depicted in the bottom of Figure 1.
This work focuses on multi-relational multi-hop reasoning in a densely connected temporal knowledge graph. As our first contribution, we developed
14367
a new benchmark named Mul2Questions, which contains over 200k entities spanning a temporal KG that is a strongly connected graph created using a breadth-first graph-expanding strategy. Moreover, the benchmark also includes an extensive collection of temporal questions (over 960k) that require complex multi-relational multi-hop reasoning patterns, as illustrated in Figure 1 (bottom), by incorporating 135 distinct temporal relations. Table 1 shows a statistical comparison between our benchmark and others, which highlights the much higher semantic complexity of our benchmark’s questions (as defined in Eq. (1)) — this indicates a heightened challenge in both finding candidate entities and deducing correct answers.
In addition to the data contribution, we present a new model for temporal knowledge graph reasoning that incorporates pattern-aware and timesensitive joint reasoning methods. Through rigorous evaluations, we show that our methods outperforms existing methods by a substantial margin (+9 points) in overall accuracy. Furthermore, it performs well in data-scarce situations and addressing questions with long reasoning chains.
In summary, our contributions are three-fold:
• We present Mul2Questions, a new benchmark for temporal knowledge graph reasoning, focusing particularly on multi-relational multihop reasoning patterns. We also study its potential extension to multilingual scenarios.
• We introduce a new method with patternaware and time-sensitive mechanism for reasoning over temporal KGs; it demonstrates outstanding ability in addressing diversified reasoning patterns.
• We release both the benchmark and model to the public to facilitate further exploration.

heading: 2 Related Work

heading: 2.1 Temporal KG Reasoning Resources
text: Temporal KGs are multi-relational graphs with each edge (i.e., relation) marked with time duration information (Dasgupta et al., 2018; GarcíaDurán et al., 2018; Jain et al., 2020). Among the datasets facilitating reasoning over temporal KGs, TempQuestions (Jia et al., 2018b), derived from FreeBase (Bollacker et al., 2008), offers 1,271 questions, and SYGMA (Neelam et al., 2021) utilizes Wikidata to enhance reasoning capabilities for
TempQuestions. However, these datasets provide only around a thousand questions, falling short for developing advanced neural models. On the larger scale, TimeQuestions (Jia et al., 2021) gathers 16k time-centric questions from eight KGs, and CronQuestions (Saxena et al., 2021) delivers an extensive dataset with 328k facts and 410k questions from Wikidata. Additionally, MultiTQ (Chen et al., 2023) introduces a dynamic semantic KG from ICEWS05-15 (García-Durán et al., 2018), broadening the scope with rich semantic information. Nonetheless, most benchmarks focus on single-relational reasoning within sparse KGs. By contrast, our approach emphasizes complex multirelational and multi-hop reasoning over densely populated temporal KGs.

heading: 2.2 Temporal KG Reasoning Approaches
text: The exploration of effective reasoning methods over temporal KGs is still in its early stages, with two predominant approaches emerging: semantic parsing-based and embedding-based methods. Semantic parsing-based methods, such as those employed by TEQUILA (Jia et al., 2018a), EXAQT (Jia et al., 2021), and TwiRGCN (Sharma et al., 2023), begin by segmenting the questions into temporal and non-temporal components and then apply temporal constraints to refine the pool of potential answers to find the correct one. Despite their effectiveness, these methods are constrained by the need for manually crafted rules for problem decomposition, limiting their effectiveness in tackling complex queries. In contrast, recent advancements in embedding-based approaches leverage neural networks to capture temporal dynamics and adopt semantic similarity for answer prediction. Specifically, CronKGQA (Saxena et al., 2021) introduces a dynamic, learnable framework for temporal reasoning, avoiding hand-crafted rules. TSQA (Shang
et al., 2022) enhances the interaction between time and entities using contrastive learning techniques and time position coding. TempoQR (Mavromatis et al., 2022) integrates time range information and employs entity embeddings for richer question representations. MultiQA (Chen et al., 2023) proposes a new model for particularly multi-granularity inference and establishes a new standard for temporal reasoning tasks. However, limited by the oversimplified reasoning patterns in previous benchmarks, these methods may have difficulties for addressing complex patterns. This paper addresses the challenges by designing a pattern-aware and timesensitive mechanism to enhance learning.
3 The Mul2Questions Benchmark
Our Mul2Questions benchmark targets multirelational multi-hop reasoning particularly, and we divide the construction process by temporal KG construction (§ 3.1) and temporal question construction (§ 3.2) as visualized in Figure 2.

heading: 3.1 Construction of the Temporal KG
text: We use Wikidata (Vrandečić and Krötzsch, 2014) to build the temporal KG, following previous works (Saxena et al., 2021). Instead of simply filtering out Wikidata to obtain the KG, we employ a breadthfirst approach to expand an empty KG gradually. This method guarantees a densely connected KG that includes crucial entities/facts and avoids discontinuities in the graph.
To start, we compile an empty KG and build a seed entity set containing individuals listed as the “TIME 100 Persons” by the Times magazine1. The underlying assumption for choosing this set is that
1https://en.wikipedia.org/wiki/Time_100
prominent persons may get involved in the world’s important events and, therefore, have a more extensive network of connections in Wikidata. Next, we iterate each entity in the seed set and add entities that have a temporal connection with it in the seed set. Additionally, the relevant facts are added to the temporal KG. We repeat the above process and check each newly added entity until convergence. Finally, we add the important world events, such as (World War II, occurs, 1939-1945), into the temporal KG following Saxena et al. (2021).
Finally, a dense temporal KG consisting of 229k facts, 292 distinct types of temporal relations, and over 200k entities was produced, with Figure 3 visualizing the detailed process. To qualitatively evaluate the constructed KG, we measure its semantic complexity SCKG , defined as the average number of relation types associated with each entity (Chen et al., 2023). The results reveal that our temporal KG has a high SCKG of 1.97, 49% greater than that of CronQuestions, which is generated by merely filtering the Wikidata set.

heading: 3.2 Construction of Temporal Questions
text: We build a large question set with multi-relational multi-hop reasoning patterns for Mul2Questions by first recognizing time-compatible fact pairs and then converting them into question-answer pairs using templates.
Time-Compatible Fact Pairs. Let f1 = <s1, r1, o1, t1> be a fact instance in the temporal KG. We define a time-compatible fact with f1 as another fact instance f2 with an overlapped duration time. By definition, f2 can be either a standard fact represented by f2 = <s2, r2, o2, t2> or a world event f2 = <e2, t2> as introduced by (Saxena et al., 2021). We then consider the overlapping patterns of f1 and f2 to generate question-answer pairs.
Templates for Question Generation. We define three overlapping patterns for question generation: 1) Subject-Join: f2 is a standard fact, and the subject s1 of f1 is involved in f2. In this case, we set the answer to o1 and generate a contextualized question based on the semantics of f1 and f2. 2) Object-Join: similar to subject-join type, but the object o1 of f1 is involved in f2. In this case, we set the answer to s1 and generate a contextualized question. 3) Time-Join: in this case, f2 is a world event, and we can set the answer to either s1 or o1 and generate a contextual question. Figure 2 gives an example of Subject-Join type, and we set the answer to the object “Mauricio Pochettino” and a generated question is “Who was the coach of Paris SG F.C. when Lionel Messi joined the club?”. Table 2 shows more examples.
The above describes 2-hop reasoning patterns, but by adding more compatible facts, we can get a longer reasoning chain. For example, when finding another fact f3 = <Lionel Messi, award received, Ballon d’Or, 2019, 2019>, we can construct a threehop question, “Who was the coach of Paris SG F.C. when <the player winning Ballon d’Or at 2019> joined the club?” However, considering this of-
ten gets long and verbose questions, we only use the ten most common 3-hop patterns. In total, we find 586 unique patterns (including ten 3-hop patterns) involving 135 different temporal relations, much larger than previous methods. Then, we employ seven experts to contextualize each pattern and extend them by a generative language model of GPT-4 (OpenAI, 2023), using few-shot prompting techniques (Brown et al., 2020). Finally, we get 6,274 contextualization templates. By propagating each template using compatible fact instances, we finally ended up with 960k questions. We refer to Appendix A for more examples of contextualized templates that we use to generate questions.
Semantic Complexity of Questions. Similar to the definition of semantic complexity of a KG, we define semantic complexity of questions(SCQ) as the average of the number of relation types involved in each question:
SCQ = 1 |Q| ∑
qi∈Q N
rtype qi (1)
where Q is the question set and N rtypeqi is the number of relation types involved in qi. Consequently, we get a SCQ = 2.35, which is much higher than that of CronQuestions (SCQ = 1.21) and MultiTQ (SCQ = 1.00), where the most of questions involving only single-relational reasoning. Obviously, the larger SCQ, the more relations the question involves and the harder reasoning.

heading: 4 Our Temporal Reasoning Model
text: We propose a new model featuring discerning different reasoning patterns over a temporal KG. As shown in Figure 4, our model consists of three essential parts: 1) reasoning subgraph extraction, 2) reasoning pattern characterization, and 3) patternaware joint reasoning.

heading: 4.1 Reasoning Subgraph Extraction
text: Given a question q, we first extract a subgraph to facilitate reasoning. We begin by identifying a key entity/relation set from q using an extra trained entity/relation recognizer2. Then, we create a subgraph that includes all facts connected to the entities, and we designate a fact instance that is closest to the entity set as the “central fact”. Specifically, the “close” here is indeed a measurement of the overlapping of a fact and the entity/relation set. We then arrange the facts in chronological order, which is used to help decide a region where the answer is more likely to exist.

heading: 4.2 Reasoning Pattern Characterization
text: We motivate our reasoning pattern characterization module by noting that different patterns exist for reasoning. For example, for the multi-relational multi-hop reasoning question, it is more likely that the target fact/entity has a duration overlapping with the “central fact” involved in the question. By contrast, for the single-relational reasoning question, we should focus on the fact adjacent to the “central fact” with the same relation for finding the answer. While for the first/last question (i.e., “Who is the first president of the US?”), we should focus on the fact locating the earliest in the chronological timeline. With the above insights, we build a reasoning pattern characterization module to discern
2We use a BERT based recognizer, achieving 92%/85% in F1 for entity/relation recognition in the questions.
different reasoning patterns to enable reasoning. We categorize the reasoning patterns into three aspects: 1) The answer type label, which is a label from [entity, time]. 2) The question type label, which is a label from [before/after, first/last, multihop] following definitions of (Chen et al., 2023). 3) The timeline distance, which is a scalar value showing the distance from the answer entity to the “central fact”. Note that all these patterns are known during training, and we build three prediction models to learn their representations.
Specifically, given q, we use a BERT encoder to covert it as a continuous representation h ∈ Rd:
h = BERT(q) (2)
where d denotes the dimension of representation. Then, we build two classification models to predict the answer and question type labels. For example, to predict the answer type label, we first transform h into ha ∈ Rd:
ha = Wah (3)
where Wa ∈ Rd×d is a parameter, and then use a binary classifier to map it into an answer type label. The question type label classification is similar but compute hq ∈ Rd with another parameter Wq ∈ Rd×d and a multi-class classifier. For the timeline distance, we compute a scalar number based on the representations of h and the central fact:
sq = Wt(h⊕ BERT(f)) (4)
where Wt ∈ R1×2d, f stands for the “central fact”, and ⊕ denotes a concatenation operator. The classification and regression models are trained based on cross-entropy and MSE loss, respectively.

heading: 4.3 Pattern-Aware Joint Reasoning
text: We perform a pattern-aware joint reasoning to locate the answer. Specifically, for an entity e in the subgraph, its representation is built by:
he = se→f ∗ (htemp ⊕ ha ⊕ hq) (5)
where htemp ∈ Rdt is the temporal representation of the entity learned from the temporal KG, following (Saxena et al., 2021), and se→f is the timeline matching score of the entity, computed by:
se→f = N (|Dis(e, f)− sq|; 0, 1) (6)
where N (; 0, 1) denotes a standard Gaussian distribution, and |Dis(e, f) − sq| is a measurement for whether the true distance of e and f (Dis(e, f)) matches the predicted timeline distance (sq).
Finally, we perform a softmax calculation to locate the answer. For example, the probability of e being the answer is computed by:
Pr(e|q) = exp(Wphe)∑ e′∈G Wphe′
(7)
where Wp ∈ R1×dt+2d denotes a prediction parameter and e′ ranges over each entity in the subgraph. For training, we train all parameters by minimizing a cross-entropy loss function:
L = − ∑
(q,a)∈D logPr(a|q) (8)
where (q, a) ranges over each training instance in the training set D. We use Adam (Kingma and Ba, 2014) algorithm for parameter optimization.

heading: 5 Experimental Evaluations

heading: 5.1 Datasets and Setups
text: We evaluate our approach using our Mul2Questions benchmark and CronQuestions to allow for different reasoning patterns. For our benchmark, we conduct a split of 8/1/1 for the train/dev/test split, and for CronQuestions, we use the standard settings. As for evaluations, we report results regarding Hit@1 and Hit@10. As for implements, we use BERTbase as the basic answer/question type classifier and a linear regression model to predict
the timeline matching score. For the final optimization, we set the batch size to 20, chosen from 5, 10, 20, 40, and the learning rate as 1e-5, chosen from a set {1e-4, 2e-5, 1e-5} on the dev set by the overall Hits@1 metrics. Our models are implemented by PyTorch and trained using NVIDIA Tesla V100 GPUs. We have released the code at https://github.com/Zihe2003/Mul2Questions to enable further exploration.

heading: 5.2 Baseline Methods
text: We use previous state-of-the-art temporal knowledge graph reasoning models as baselines, including 1) BERT-Based Models, which use representations constructed by BERT (Devlin et al., 2019) and RoBERTa (Liu et al., 2019) as entity representations for prediction. 2) EmbedKGQA (Saxena et al., 2020), which uses representations designed for static KGs to perform reasoning. To address temporal questions, it ignores timestamps during training and employs random time embeddings. 3) CronKGQA (Saxena et al., 2021), which extends EmbedKGQA by incorporating temporal KG embeddings, serving as a standard baseline for evaluation temporal KG reasoning. 4) TempoQR (Mavromatis et al., 2022), which proposes an embedding representation for question answers using timeassisted constraints, inspiring further research into time-sensitive question answering . 5) MultiQA (Chen et al., 2023), which introduces an innovative approach by incorporating a multi-granularity technique that leverages time-assisted constraints. We refer to our approach as PATKGQA to signify that it is Pattern-Aware.

heading: 5.3 Quantitative Results
text: Table 3 shows the performance of different models on our Mul2Questions benchmark. Accordingly to the results, our method outperforms baseline models by a significant margin (+9.5% in Hit@1 and +9.7% in Hit@10), demonstrating its usefulness. We also observe that temporal embedding methods outperform static representation methods such as BERT and RoBERTa, emphasizing the importance of introducing temporal embeddings. When comparing different types of questions, we can see that the Time-Join question is easier than the other two. This is expected since the Time-Join pattern often contains a world event, which we can easily determine the timing, and use it as a proxy to locate another fact. In contrast, Subject-Join and ObjectJoin need us to consider sharing patterns as well as
distinct temporal relations, which could make the reasoning more challenge.
Table 4 shows the results of the CRONQuestions benchmark, which has a different reasoning structure than ours. As a result, our methods performs well, indicating that it is effectiveness in addressing different reasoning patterns. Particularly, the improvement stems primarily from addressing complex questions. To demonstrate its effectiveness, consider a question having a (first/last) pattern in the CRONQuestions benchmark: “When did Messi play their first game?”. We show that our approach produces a negative timeline matching score, signaling that the answer should appear early in the timeline, which aids in locating the correct entity.

heading: 6 Discussion
text: Ablation Study. We perform an ablation study to validate the effect of each component in Table 5. In
particular, we first employ the TempoQR (Mavromatis et al., 2022) architecture as the base model, and then augment it with each component respectively, including subgraph extraction, question and answer type presentations, and the augmentation of timeline matching score, to visualize the impacts. The results show that each component aids learning, with the timeline matching score being the most effective one and leading to the largest improvement. This observation highlights the importance for modeling temporal relations of facts dynamically in the reasoning process, which has often been missed by earlier research.
Towards Reasoning over Longer Chains. Then, we investigate the ability of different models to handle longer reasoning chains. Specifically, We generated and sampled 10k 2-hop, 3-hop, and 4- hop questions3 (same examples are shown in Table 6) respectively and utilize a model for answer prediction. The results in Table 7 indicate that our method performs well when handling longer reasoning chains. The reason for this is that in questions with longer reasoning chain, the answer often has an in-direct connection to entities appearing in the question, which is difficult to handle in prior methods that do not recognize the reasoning pattern. In contrast, our approach utilizes answer/question type representations and timing matching score mechanisms to assist in locating the answer.
Results in Data-Scarce Scenarios. We examine the the ability of our approach for learning in scenarios with limited data, and the results are illustrated in Figure 5. Compared to earlier methods, our methodology exhibits better performance in situations where data is limited, where the underlying reason might be that the answer/question type representations and timeline matching score offer
3Note that we only included a small number of 3-hop questions and no 4-hop questions in our benchmark because the majority of them are verbose and impractical
more informative guidance for locating the answer.
Comparison to Large Language Models. Our method is evaluated against large language models (LLMs) in Table 8, namely the open-source LLM LLama 2 13B (Touvron et al., 2023) and the closed-source LLM GPT-4 (OpenAI, 2023). We use two settings: zero-shot (ZERO), where a LLM based model directly predicts an answer without relying on extra clues, and RAG, which incorporates the subgraph into the prompt to enhance reasoning. Following prior RAG studies on KBQA (Kim et al., 2023; Jiang et al., 2023), our approach first retrieving a subgraph and then organizing them in chronological order. We finally construct a prompt like “Given the facts: [facts], Please answer [question]” and query an LLM for the answer. Acocording to the results, LLM-based models do perform well at this task; even in a zero-shot setting, they are accurate about 30% of the time, and their performance is much better when a reasoning sub-graph is added. One reason for the good performance of LLM is that the questions in the benchmark are all fact-based questions that an LLM can master at the pre-training stage, while we note there is still room for addressing more difficult multi-hop reasoning patterns.
Multilingual Extension. In addition, we explore the feasibility of applying our benchmark construction approach to other languages. Table 9 shows a comparison of the corpus size in French and Chinese, demonstrating its practicality. However, in
comparison to English, the performance of our model in French and Chinese are marginally reduced, which may due to a less compact KG.

heading: 7 Conclusion
text: In this research, we investigate multi-relational multi-hop reasoning over a dense temporal knowledge graph. We introduce Mul2Questions, a new benchmark that includes over 200k entities and 960k questions with multi-relational multi-hop patterns. In addition, we present a new model capable of performing pattern-aware and time-sensitive joint reasoning over temporal KGs. The effectiveness has been verified by extensive evaluations. In the future, we would examine its applicability in a broader range of domains/scenarios.

heading: Acknowledgements
text: This work has been supported by the Fundamental Research Funds for the Central Universities 2023JBMC058, the National Nature Science Foundation of China (No.62106016), the opening project of Beijing Key Laboratory of Internet Culture and Digital Dissemination Research, and the Key Lab of Internet Natural Language Processing of Sichuan Provincial Education Department (No. INLP202305).
The authors would like to thank the anonymous reviewers for their valuable suggestions.
Limitations
One limitation is that, like many benchmarks, our benchmark’s questions are completely factual and can be easily addressed using modern large language models (LLMs) trained on texts with world knowledge. To comprehensively test temporal reasoning, we may employ more specific questions that do not contain real-world knowledge. Second, the questions are generated using customized templates. However, handcrafted templates are typically based on the exporter’s personal knowledge and experience, which may add subjective biases. Furthermore, the KG employed in the study is based on a single domain, Wikidata, and we hope to expand it to other domains in the future.

heading: A Appendix
text: In our study, we provided detailed instructions to participants listed below:
Annotation Instructions Understanding Patterns: Begin by familiarizing yourself with the unique patterns. Each pattern represents a reasoning structure within the knowledge graph.
Template Structure:
• Craft clear, concise question templates that can be filled with specific entities or attributes.
• Ensure the template directly relates to the pattern it’s designed for.
Creativity and Variety:
• Use creative wording to cover the breadth of possible scenarios within a pattern.
• Include a variety of question types, e.g., "What is the...?", "Who was the...?", "When did...?".
Clarity and Simplicity:
• Ensure questions are straightforward and understandable.
• Avoid complex or confusing phrasing.
Inclusivity:
• Use inclusive and respectful language.
• Avoid bias or potentially offensive language.
Review and Edit:
• Review questions for grammatical accuracy and clarity.
• Edit to ensure adherence to the pattern.
Submission: Submit the created templates according to the provided guidelines, ensuring they are well-organized and labeled according to the corresponding pattern.
Compensation: Annotators will receive fair compensation, determined by task complexity and their demographic location.
Consent and Data Usage: By participating, you consent to the use of your contributions in our projects, with the possibility of inclusion in research publications.
Ethics and Approval: This project has ethics review board approval, adhering to standards for privacy, consent, and risk management.
Support: For questions or clarification, contact the project coordinators.
We recruited annotators through our institutions, employing seven individuals to create question templates for 586 unique patterns. Each annotator received fair compensation (about 100$ on the average), determined by the task’s complexity and their outputs. We obtained informed consent from all participants, clearly explaining data usage and their rights. Additionally, our data collection protocol was approved by an ethics review board from our institution, affirming our adherence to ethical standards in privacy, consent, and risk management. For better exploration, we give several of the most common question templates in Table 10.

heading: Future Work
text: Furthermore, the KG employed in the study is based on a single domain, Wikidata, and we hope to expand it to other domains in the future