Temporal Relation Extraction in Clinical Texts: A Span-based Graph Transformer Approach

Rochana Chaturvedi, Peyman Baghershahi, Sourav Medya, Barbara Di Eugenio · DOI

TL;DR

Reconstructing a chronological timeline of clinical events from unstructured Electronic Health Records (EHRs) is notoriously difficult due to long documents and complex medical narratives. This paper introduces GRAPHTREX, an end-to-end framework that combines span-based language modeling with Heterogeneous Graph Transformers (HGT) to capture both local and long-range temporal relations. By introducing global landmark nodes to bridge distant clinical events, GRAPHTREX achieves a new state-of-the-art on the i2b2 2012 corpus, showing an 8.9% improvement on challenging long-range relations.

What Problem Does This Paper Address?

Clinical notes contain critical patient timelines—such as the progression of symptoms, diagnoses, and treatments—but extracting this chronological order automatically faces major hurdles. This task, known as Temporal Relation Extraction (TREX), is difficult for three main reasons:

  1. Complex Domain Language: Medical text is filled with specialized vocabulary, non-standard abbreviations, and ambiguous phrasing.
  2. Context-Length Limitations: Standard transformer-based language models suffer from strict context-length limits (typically 512 tokens). This forces models to chunk documents, causing them to miss long-range dependencies (e.g., connecting an initial symptom mentioned at admission to a procedure performed days later).
  3. Cascading Errors: Traditional pipeline methods extract entities first and classify relations second, meaning errors in the first step ruin the performance of the second.

The authors aim to solve document-level, end-to-end TREX by jointly modeling entities and their temporal connections across entire clinical narratives.

Methods

The GRAPHTREX framework operates in three main stages:

  1. Domain-aware Span Representations (SPANTREX): Using BioMedBERT (pre-trained on biomedical text), the model enumerates all text spans up to a length of 7 tokens to jointly predict clinical entities (e.g., PROBLEM, TREATMENT) and initial temporal relations (Before, After, Overlap). A sliding window approach with custom masking handles long documents without losing local context.
  2. Heterogeneous Graph Construction: To overcome the context-length limits of text transformers, GRAPHTREX builds a document-level graph. Nodes represent predicted entities, local context between nearby spans, and sequential WINDOW nodes (which act as global landmarks for chunks of text). High-confidence temporal relations predicted by the span model form the initial edges.
  3. Heterogeneous Graph Transformer (HGT): An HGT module performs message-passing across this graph. The WINDOW nodes act as structural highways, allowing information to propagate across long distances. This structural awareness helps the model infer implicit, transitive temporal relations (e.g., if event A happened before event B, and B happened before C, then A happened before C).
Figure 3: GRAPHTREX Architecture. (I) The dashed boundary represents SPANTREX that produces the initial temporal graph. (II) A confidence threshold (τ) filters uncertain edges (TLinks). (III) The edges are iteratively refined with the HGT component. (IV) The final node representations from the graph are combined with weighted residual of original span embeddings. (V) The relation decoder predicts the final temporal relations based on the HGT-enhanced representation. This way GRAPHTREX infers additional local and global relations (blue arrow).

Datasets

  • i2b2 2012 Temporal Relations Challenge corpus: The primary benchmark, consisting of 310 English discharge summaries rich in cross-sentence temporal annotations.
  • E3C (European Clinical Case Corpus): A smaller, more sparsely annotated dataset of English clinical cases used to evaluate the model's generalizability outside of standard U.S. hospital datasets.

Key Insights and Ideas

  • Graphs as Length-Invariant Highways: While text transformers scale quadratically with document length, graph structures allow long-range dependencies to be resolved in just a few message-passing hops. This makes the relation-extraction step invariant to document length.
  • The Danger of Naive Graphs: Simply connecting entity nodes in a graph can lead to overfitting local neighborhoods or over-smoothing node representations. Introducing sequential "WINDOW" nodes as global landmarks provides a structured, regularized path to pass information across distant parts of a document.
  • Joint Training is Crucial: Training the entity and relation decoders simultaneously with shared representations prevents the error propagation typical of pipeline systems and allows the model to learn domain-specific distributional constraints.

Key Results

  • New State-of-the-Art: GRAPHTREX achieved a Tempeval $F_1$ score of 68.81% on the i2b2 2012 end-to-end task, outperforming the previous best baseline by an absolute 5.45%.
Main Results on i2b2 2012
  • Long-Range Domination: The biggest win came from distant relations. For entity pairs separated by multiple text windows ($d_r > 1$), GRAPHTREX achieved an 8.9% performance lift over the text-only SPANTREX baseline, proving the efficacy of the graph landmark approach.
  • Strong Generalizability: On the challenging E3C corpus, GRAPHTREX established a strong baseline, improving temporal link extraction $F_1$ to 23.48% compared to SPERT's 13.63%.

Limitations and Future Work

  • Data Scarcity: Clinical datasets with fine-grained temporal annotations remain rare due to strict privacy (PHI) regulations and high expert annotation costs.
  • Lack of Medical Commonsense: The model occasionally makes logical errors that violate basic medical reality, such as predicting a patient's discharge occurred before their admission. Infusing real-world medical knowledge graphs or LLM-driven commonsense reasoning is a key future direction.
  • Knowledge Integration Scalability: While the authors introduced a knowledge-infused variant (BioMedBERT-UMLS) that set a new SOTA for time expression extraction, scaling this external knowledge integration directly into the graph-based relation extraction pipeline remains a non-trivial challenge.

Summary updated

BibTeX
@inproceedings{chaturvedi2025temporal,
  author = {Rochana Chaturvedi and Peyman Baghershahi and Sourav Medya and Barbara Di Eugenio},
  title = {{Temporal Relation Extraction in Clinical Texts: A Span-based Graph Transformer Approach}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure