Fusing Temporal Graphs into Transformers for Time-Sensitive Question Answering

Xin Su, Phillip Howard, Nagib Hakim, Steven Bethard

Introduction

Large Language Models (LLMs) have demonstrated an impressive capacity for fact retrieval and linguistic reasoning. However, their performance often falters when faced with "time-sensitive" queries—questions where the validity of a fact is contingent upon a specific temporal window. For instance, determining a historical figure's role in a specific year requires synthesizing disparate chronological markers scattered throughout a document. This paper explores a novel approach to bridge this gap by integrating structured temporal graphs directly into the Transformer architecture.

The Challenge of Temporal Reasoning

Temporal reasoning requires a model to construct a mental timeline from unstructured text. In long-form documents, relevant dates and events are rarely contiguous. Current Transformer models struggle to perform this synthesis implicitly. While prior attempts to solve this involved complex modifications to attention mechanisms or specialized temporal dependency parsers, these solutions often lack scalability and require significant architectural changes.

Methodology: From Text to Temporal Graphs

The researchers propose a two-step pipeline designed to enhance the temporal awareness of models like LongT5.

1. Graph Construction

The process begins with Information Extraction (IE). Using tools such as CAEVO for event detection and SUTime for temporal expressions, the system identifies entities within the text. These entities are then organized into a directed graph where nodes represent events or timestamps, and edges denote temporal relations such as BEFORE, AFTER, INCLUDES, or OVERLAP. To ensure the graph is robust, transitivity rules are applied (e.g., if Event A precedes Event B, and Event B precedes Event C, then Event A precedes Event C), effectively filling gaps between the question's timeframe and the document's narrative.

2. Graph Fusion Strategies

The study compares two primary methods for integrating this graph data into the Transformer:

  • GNN-based Fusion: This approach utilizes a Relational Graph Convolutional Network (RelGraphConv) to encode the graph structure. These embeddings are then merged into the Transformer's internal representations.
  • Explicit Edge Representation (ERR): A simpler, more direct method where temporal relations are injected into the input text using XML-like tags. For example, a sentence might be transformed into: ...Congress <before>created</before> the Continental Army on <before>June 14, 1775</before>...

Experimental Evaluation

The models were benchmarked against two rigorous datasets:

  • TimeQA: This dataset includes "Easy" splits (explicit mentions) and "Hard" splits (requiring multi-hop reasoning). It also features human-paraphrased variants to evaluate model robustness against linguistic variation.
  • SituatedQA: This benchmark pairs questions with temporal annotations that alter the correct answer based on the time context (e.g., identifying a CEO in 2010 versus 2023).

Key Insights and Results

The most significant finding was the overwhelming success of the Explicit Edge Representation (ERR) method. Despite its simplicity, ERR consistently outperformed the more complex GNN-based fusion.

Superiority of Text-Tagging

By embedding temporal relations directly into the text, the model leverages its existing self-attention mechanism to "anchor" events to specific points in time. This approach proved more effective than GNNs, which often struggled to relate explicit temporal expressions in the context to the question’s specific timeline.

State-of-the-Art Performance

The LongT5 + ERR configuration established new benchmarks, achieving an Exact Match (EM) score of 54.0 on TimeQA Hard and 29.0 on SituatedQA. This represents a substantial improvement over previous models like DocTime and TSM. Notably, on the TimeQA Hard split, ERR provided a 4.1-point boost over the baseline LongT5.

Enhancing Large Language Models

Because ERR only modifies the input string, it is inherently "plug-and-play." The researchers demonstrated that adding ERR tags to prompts for GPT-3.5 and GPT-4 improved performance via in-context learning. For ChatGPT, the EM score on TimeQA Hard rose from 25.0 to 30.4, suggesting that even the most advanced models benefit from structured temporal scaffolding.

Limitations and Future Directions

While effective, the system is currently limited by the accuracy of the underlying IE tools (CAEVO and SUTime). Errors in initial event or date extraction propagate through the graph. Furthermore, the model still faces challenges with complex numerical reasoning, such as calculating relative dates (e.g., "three years after the treaty").

Future research may extend this "input-fusion" technique beyond temporal data. Similar methodologies could be applied to spatial reasoning or entity-relation graphs, potentially providing a universal framework for enhancing long-document comprehension in Transformers.

Summary updated

BibTeX
@inproceedings{su2023fusing,
  author = {Xin Su and Phillip Howard and Nagib Hakim and Steven Bethard},
  title = {{Fusing Temporal Graphs into Transformers for Time-Sensitive Question Answering}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.67},
}
Figure