Evaluating Temporal Factuality in EHR RAG

Zhuoyu Li, Zhaolu LiuML4H 2026 Poster 2026

TL;DR

If you ask a clinical AI for a patient's potassium level before their third hospital admission, it might hand you a real, chart-verified number—from two days after they were discharged. This paper shows that in longitudinal electronic health records (EHRs), standard Retrieval-Augmented Generation (RAG) systems frequently retrieve the right medical concept from the wrong point in time. Even when a privileged filter hands the language model the exact right record, models still fail to answer correctly with the right timestamps nearly two-thirds of the time.

What Problem Does This Paper Address?

In standard RAG evaluations, a model's answer is usually graded as "grounded" if it's supported by some snippet of retrieved text. That works fine for static facts like "What is the capital of France?" But in a longitudinal EHR, the same clinical concept repeats over and over. A patient's potassium rises and falls; medications start, stop, and restart.

Because of this, source grounding is not temporal grounding. A model can cite a completely authentic lab value from the patient's chart and still be clinically wrong—inverting a trend, leaking future information into a past decision, or misstating whether a drug was active. The authors set out to separate finding the right concept from finding the right occurrence, and to measure whether models actually respect the requested time window.

Temporal factuality evaluation overview

Methods

The authors built an occurrence-level evaluation pipeline that tests three distinct stages: retrieval, answering, and time attribution.

  1. Deterministic Ground Truth: Instead of relying on LLM judges, they compute exact answers and identify the exact supporting database rows ("gold events") and timestamps ("gold evidence times") directly from structured EHR tables.
  2. Temporal Attribution Accuracy (TAA): To pass TAA, a model's response must get both the answer right and include every gold evidence timestamp.
  3. Controlled Retrieval Conditions: They compare standard retrievers (BM25, dense BGE-base-en-v1.5, and hybrid) against two diagnostic conditions:
  4. Temporal Filter: Receives privileged metadata (the exact concept, anchor time, and before/after relation) to filter and rank events. This isolates answering and attribution errors after successful retrieval.
  5. Oracle: Skips retrieval entirely and feeds the model only the gold events and required admission boundaries.
  6. Stress Tests: They inject controlled same-concept distractors (up to 11 competing occurrences), create "hard temporal unanswerables" (where the concept exists in the chart, just not in the requested window), and test 1,000 question pairs that differ only in their reference time.

Datasets

The evaluation is built on MIMIC-IV v3.1. From 73,230 eligible adult patients, the authors sampled 5,000 patients (826,075 lab measurements across six common tests—creatinine, glucose, hemoglobin, platelet count, potassium, and sodium—plus 48,674 admission-boundary events).

From this, they generated 12,000 templated questions (2,365 held-out for testing) balanced across six task families:

  • latest-before and first-after an anchor time
  • ordering and interval (whole-hour difference) between two events
  • cross-admission (identifying which admission a prior measurement occurred in)
  • unanswerable (requiring abstention when no valid event exists)

They also added two clinical-state extensions: 2,000 medication administration (eMAR) questions and 2,000 prescription-state (active/inactive) questions.

Key Insights and Ideas

  • Concept recall hides temporal failure: Standard retrievers look great if you only check whether they found any potassium measurement, but they routinely miss the right one—especially for cross-admission questions where the target event happened in an earlier hospital stay.
  • Retrieval isn't the only bottleneck: Even when the privileged temporal filter retrieves the exact gold event 99.6% of the time, language models still stumble. They get tripped up by competing occurrences in the context window, fail to cite all required timestamps, or botch simple interval arithmetic.
  • Wrong-window evidence is a trap: When a question is unanswerable for the requested time window, but the retriever hands the model a real measurement from outside that window, the model almost always takes the bait and outputs the authentic—but temporally invalid—value.

Key Results

  • Retrieval Gap: On held-out occurrence-selection questions, dense retrieval achieves 97.9%–100.0% concept recall, but only 47.7%–64.4% occurrence recall.
  • Answering & Attribution: With the temporal filter achieving 99.6% occurrence recall, the primary model (Llama-3.1-8B-Instruct) answers 55.6% of retrieved questions correctly and reaches just 35.2% TAA. Under Oracle (no distractors), TAA jumps to 88.0%.
  • Model Robustness: This isn't a one-model quirk. Across five tested models (Llama-3.1-8B, Qwen3-4B, Qwen3-8B, MedGemma-1.5-4B, and gpt-oss-20b), TAA given gold retrieval ranges from 33.4% to 41.6%.
  • Distractors & Stress Tests: Increasing same-concept distractors from 0 to 11 drops temporal-filter TAA on cross-admission questions from 41.8% to 11.6%. On hard unanswerables, guaranteeing wrong-window evidence drops correct abstention to 15.4%, with 84.3% of answers citing an invalid value.

Limitations and Future Work

The authors note several limitations: the questions are templated rather than natural clinical prose (meaning they don't test paraphrases or implicit time cues like "baseline"), the data comes from a single institution, and larger dense models (32B–70B) remain untested. Future work will need to test whether these failure modes persist in free-form clinical queries and larger frontier models, and develop retrieval and evaluation pipelines that treat temporal attribution as a first-class requirement.

Summary updated

BibTeX
@inproceedings{li2026evaluating,
  author = {Zhuoyu Li and Zhaolu Liu},
  title = {{Evaluating Temporal Factuality in EHR RAG}},
  booktitle = {ML4H 2026 Poster},
  year = {2026},
  url = {https://openreview.net/forum?id=auRzjjUE1p},
}

Loading related content...

Figure