Improving Time Sensitivity for Question Answering over Temporal Knowledge Graphs (2022)

Abstract: Question answering over temporal knowledge graphs (KGs) efficiently uses facts contained in a temporal KG, which records entity relations and when they occur in time, to answer natural language questions (e.g., “Who was the president of the US before Obama?”). These questions often involve three time-related challenges that previous work fail to adequately address: 1) questions often do not specify exact timestamps of interest (e.g., “Obama” instead of 2000); 2) subtle lexical differences in time relations (e.g., “before” vs “after”); 3) off-the-shelf temporal KG embeddings that previous work builds on ignore the temporal order of timestamps, which is crucial for answering temporal-order related questions. In this paper, we propose a time-sensitive question answering (TSQA) framework to tackle these problems. TSQA features a timestamp estimation module to infer the unwritten timestamp from the question. We also employ a time-sensitive KG encoder to inject ordering information into the temporal KG embeddings that TSQA is based on. With the help of techniques to reduce the search space for potential answers, TSQA significantly outperforms the previous state of the art on a new benchmark for question answering over temporal KGs, especially achieving a 32% (absolute) error reduction on complex questions that require multiple steps of reasoning over facts in the temporal KG.

## introduction temporal knowledge graphs (kgs) record the relations between entities and the timestamp or time period when such relation hold, e.g., in the form of a quadruple: (franklin d. roosevelt, position held, president of usa, @xcite ). this makes them a perfect source of knowledge to answer questions that involve knowledge of when certain events occurred as well as how they are related temporally (see figure 1 answering (qa) over non-temporal kgs that is mainly concerned with relational inference, a core challenge in temporal kgqa is correctly identifying the time of reference mentioned explicitly or implicitly in the question, and locating relevant facts by jointly reasoning over relations and timestamps. inspired by work on relational kgqa @xcite , where knowledge graph embeddings @xcite @xcite @xcite ) learned independently of question answering are used as input to kgqa models, previous work @xcite employs temporal kg embeddings to attack the problem of temporal kgqa. despite its relative success on simple temporal questions that directly queries facts in the kg with one out of the four facts left as the answer (e.g., "when was franklin d. roosevelt the president of usa?" or "what position did franklin d. @xcite , this approach still struggles to handle questions that require multiple steps of relationaltemporal reasoning (e.g., the example in figure 1 ). we identify three main challenges that hinder further progress on temporal kgqa. firstly, complex temporal questions often require inferring the correct point of reference in time, which is not considered by previous work. for instance, to correctly answer the question in figure 1 , it is crucial that we first identify that world war ii took place between 1939 and 1945, and look for entities with the desired relation with president of usa in the time interval specified by these times. secondly, unlike entity relations, which are usually expressed in natural language with a handful of content words that correspond well with their recorded relations in kgs (e.g., "what position did ... hold ..." vs the "position held" relation), temporal relations often involve just one or two prepositions (e.g., "before" or "during") and are expressed only implicitly in temporal kgs (e.g., nowhere is it clearly stated that 1931 is earlier than, or before, 1934, by a gap of 3 years). as a result, a small lexical change can drastically alter the temporal relation expressed by the question, and therefore the answer set. thirdly, previous work on temporal kgqa build on temporal kg embeddings, where each timestamp is assigned a randomly initialized vector representation that is jointly optimized with entity and relation representations to reconstruct quadruples in the kg from embeddings. while sound as a standalone method for encoding knowledge in temporal kgs, this approach does not guarantee that the learned timestamp representations can recover implicit temporal relations like temporal orders or distance, which are crucial for temporal kgqa. in this paper, we propose a time-sensitive question answering framework (tsqa) to address these challenges. we first equip the temporal kgqa model with a time estimation module that infers the unstated timestamps from questions as the first step of reasoning, and feed the result into relational inference as a reference timestamp. even without explicit training data for this module, the explicit factorization of the problem yields significant improvement over previous work on complex questions that require reasoning over multiple temporal quadruples. to improve the sensitivity of our question encoder to time relation words, we also propose auxiliary contrastive losses that contrast the answer prediction and time estimation for questions that differ only by the time relation word (e.g., "before" vs "after"). by leveraging the mutual ex-clusiveness of answers and the prior knowledge regarding potential time estimates from different time relation words, we observe further improvements in model performance on complex questions. next, to learn temporal kg embeddings with prior knowledge of temporal order and distance built in, we introduce an auxiliary loss of time-order classification between each pair of timestamp embeddings. as a result, the knowledge in the temporal kg can be distilled into the entity, relation, and timestamp embeddings where the timestamp embeddings can naturally recover order and distance information between the underlying timestamps, thus improving the performance of temporal kgqa where such information is crucial. finally, we enhance tsqa with kg-based approaches to narrow the search space to speed up model training and inference, as well as reduce the number of false positives in model prediction. as a result, tsqa outperforms the previous state of the art on the cronques-tions benchmark @xcite by a large margin. to summarize, our contributions in this paper are: a) we propose a time-sensitive question answering framework (tsqa) that performs time estimation for complex temporal answers; b) we present contrastive losses that improve model sensitivity to time relation words in the question; c) we propose a time-sensitive temporal kg embedding approach that benefits temporal kgqa; d) with the help of kg-based pruning technique, our tsqa model outperforms the previous state of the art by a large margin. another direction is the temporal question answering over knowledge bases (kb) @xcite , which retrieves time information from the kb. tempquestions @xcite is a kgqa dataset specifically aimed at temporal qa. based on this dataset, @xcite design a method that decomposes and rewrites each question into nontemporal sub-question and temporal sub-question. here the kg used in tempquestions is based on a subset of freebase which is not a temporal kg. later @xcite proposes a first end-to-end system (exaqt) for answering complex temporal questions, which takes advantage of the question-relevant compact subgraphs within the kg, and relational graph convolutional networks @xcite for predicting the answers. all previous datasets only include a limited number of temporal questions. recently, a much larger temporal kgqa dataset cronques-tions @xcite is released, which includes both the temporal questions and the temporal kg with time annotation for all edges. based on this dataset, the cronkgqa model @xcite is presented that exploits recent advances in temporal kg embeddings and achieves performance superior to all baselines. ## method in this section, we first give the problem definition of temporal question answering over temporal knowledge graph. then, we introduce the framework to solve this problem, which integrates time sensitivity into kg embedding and answer inference. finally, we describe the key modules of our proposed system in details. ## experiments in this section, we conduct experiments to assess the effectiveness of our proposed method tsqa for tkg-qa. our experimental results show that our approach obtains significant improvements over the baseline models. ## conclusion in this paper, we propose a time-sensitive question answering framework (tsqa) over temporal knowledge graphs (kgs). to facilitate the reasoning over temporal and relational facts over multiple facts, we propose a time estimation component to infer the unstated timestamp in the question. to further improve the model's sensitivity to time relation words in the question and facilitate temporal reasoning, we enhance the model with a temporal kg encoder that produces kg embeddings that can recover the implicit temporal order and distance between different timestamps, and with contrastive losses that compare temporally exclusive questions. with the help of answer search space pruning from entity neighboring sub-graphs, our tsqa model significantly improves the performance on complex temporal questions that require reasoning over multiple pieces of facts, and outperforms the previous state of the art by a large margin.