Datasets:
You need to agree to share your Hugging Face information to access this dataset
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
By requesting access you agree: (1) not to tune or select models on the TEST split; (2) to cite the TempMedBench paper in any work that uses the data; (3) to respect the third-party terms in NOTICE (SNOMED CT, LOINC, RxNorm, UMLS sources); (4) that the data is synthetic and contains no real patients, so it supports no clinical use.
Log in or Sign Up to review the conditions and access this dataset content.
TempMedBench 1.0
A benchmark for temporal reasoning over patient timelines: given a question about when something happened in one patient's record, retrieve the passages that support the correct answer rather than passages that mention the same concept at another time. TempMedBench 1.0 is internal version 4 (v4).
Access
This dataset is gated: log in to Hugging Face and accept the terms above to download the files. No UMLS string is
distributed (see NOTICE). There is no DOI yet.
Source
All patients are synthetic, generated with Synthea. There are no real patients and no real clinical records.
Construction
Structured clinical truth is frozen first. Questions, gold event sets, witness sets and distractors are derived from it, then passages are rendered from the frozen events. Realization and retrieval never change truth. v4 uses competition-only selection: a non-DURATION question keeps only valid temporal competitors as distractors.
The passages come from 19,664 synthetic visit notes, one per patient and recorded date. Code writes each note header with its date and visit type; a local LLM (Qwen3.5-27B) writes the body from the note's structured facts and tags each sentence with its facts. Automated checks require each supplied fact exactly once and screen for other indexed concepts, time expressions and unsupported numbers; after three rejected attempts a deterministic template replaces the body (8.1% of the 18,085 notes with facts). Notes are split at sentence boundaries into 21,458 passages; each event maps to exactly one passage, whose date is the note date at its original granularity (day, month or year).
Splits
Question counts, by the split field of artifacts/questions.jsonl (computed by the builder):
| split | questions |
|---|---|
| dev | 684 |
| test | 1,044 |
| train | 2,772 |
| total | 4,500 |
Each patient belongs to exactly one split (artifacts/splits.jsonl). TEST gold is included in this release and
is to be used under the terms below.
Contents
artifacts/questions.jsonl: questions with predicate, outcome, gold event ids and witness sets.artifacts/selected_distractors.jsonl,artifacts/distractors.jsonl: distractors.tiered/question_difficulty_tiered.jsonl: distance tier per question (non-DURATION questions only). The paper calls the tiers Near, Intermediate and Far; the files label themHard,MediumandEasy(Hard = Near, Medium = Intermediate, Easy = Far). A tier is the distance in days between the query region and the closest distractor, not an observed difficulty.question_surface/: anchored question text (relative anchor phrase).synonym_regeneration/: the synonym question surface is NOT distributed: it replaces concept and anchor names with UMLS synonyms, and the UMLS licence (section 3) forbids redistributing subsets of its sources. The folder holdsexpected_sha256.json(SHA-256 of the full kept table and of the synonym surface) andregenerate_synonyms.py. With a UMLS licence, runtempmedbench-regenerate-synonyms <this release folder>(code repository;UMLS_API_KEYin the environment) to rebuild both files and verify them against those hashes.corpus_vn/vn_passages.jsonl: the passages (passage_id,patient_id,doc_idof the note, note datedct,text, and theevent_idsthe passage realizes).synonyms/synonym_table_kept.json: for each kept concept, the UMLS CUI, source abbreviation and fetch route, andspans(per question, the character span(s) of the concept name in the anchored surface text); no synonym strings. A concept no question uses has emptyspans. A SNOMED CT concept is keyed by its concept identifier; a label that is not SNOMED CT (RxNorm, LOINC, encounter class) keeps TempMedBench's lower-case label as its key.artifacts/events_canonical.jsonl,artifacts/patients.jsonl: events and patients the scorer needs. SNOMED CT fields of the events and questions are described under "SNOMED CT fields".sample_runs/dev_bm25_anchored_VN.trec.gz: a BM25 ranking of the DEV questions (anchored surface, top 10) for the quickstart below. DEV only; no TEST ranking is shipped.MANIFEST.sha256: SHA-256 of every other file; each equals its source file byte for byte.
The dated question surface is not released. It is an ablation that the code regenerates.
What a system may read
A system under evaluation reads only the question text (question_surface in question_surface/question_surface.jsonl)
and the passages of the question's patient (text and the note date dct in corpus_vn/). Everything
else is gold or oracle information for scoring: in artifacts/questions.jsonl the predicate (concept, reference time,
window), the result (outcome, witness sets), gold_event_ids and anchor_event_ids; the distractors; the tiers; the
canonical events and the event_ids of each passage. A ranking that uses the structured reference time, as the paper's
DCT_ONLY baseline does, is an oracle and must be reported as one.
SNOMED CT fields
Concept identifiers, Fully Specified Names (FSN) and US English Preferred Terms (PT) are those of the SNOMED International Global Patient Set (GPS), International Edition 20260101, copied exactly, capitalisation and semantic tag included. The builder checks every structured field against the GPS and refuses to build on any difference.
- Events (
artifacts/events_canonical.jsonl), for conditions, procedures and care plans:snomed_code,snomed_fsn,snomed_pt. Whenrelated_conditionis set,related_condition_snomed_code,related_condition_snomed_fsnandrelated_condition_snomed_ptgive its concept;related_conditionitself is the GPS FSN or PT exactly.normalized_labelis not released. label, decided per event by rule: if the label is a pure SNOMED CT term (procedures) it is the GPS FSN or PT exactly, and a differing Synthea wording is replaced by the FSN. If it is composite (a condition... onsetor... resolved, a care plan... care plan startedor... care plan ended) it is TempMedBench's own descriptive text, not SNOMED CT content: its SNOMED CT content is given bysnomed_code,snomed_fsnandsnomed_pt. Events whose concept is RxNorm, LOINC or an encounter class carry their own label and no SNOMED CT field.- Questions (
artifacts/questions.jsonl): for a SNOMED CT conceptpredicate.conceptis the concept identifier andconcept_snomed_code,concept_snomed_fsn,concept_snomed_ptgive the GPS terms. A concept that is not SNOMED CT keeps its lower-case TempMedBench label inpredicate.concept. - Every question also carries
anchor_event_ids: a list with theevent_idof its anchor event (the first record of the anchor concept on the reference day, an id inartifacts/events_canonical.jsonl),nullfor DURATION. The scorer reads it to compute AnchorSuccess@10 and EvidenceComplete@10. - Where Synthea's shipped wording differs from the current GPS, structured fields carry only the current GPS term.
Code 456191000124101 is not in the GPS: it ships as a code only, with no term in any structured field, and the
labelof its events keeps only the pipeline's own words (care plan started,care plan ended). - Passages (
corpus_vn/) and question text (question_surface/) are free text generated by TempMedBench. They may be lower-cased or reworded and are not GPS content; the unmodified GPS term for a concept is always available through its concept identifier in the event and question records. - The kept-synonym table is keyed by concept identifier (see Contents). No list of lower-cased or normalised terms is distributed.
Quickstart
Score the sample run on DEV from this folder alone; no repository checkout and no UMLS licence are needed.
Install the scorer (Python 3.10 or newer). TODO: replace the placeholder with the release tag once it exists.
pip install "git+https://github.com/aldebaran-care/temp-med-bench@<TODO-release-tag>" # or: uv tool install "git+https://github.com/aldebaran-care/temp-med-bench@<TODO-release-tag>"The scorer needs only numpy, pandas, pydantic, python-dotenv, pyyaml, rank-bm25, tqdm, typer and openpyxl. To skip the heavy
sentence-transformers(torch) that the package also declares, runpip install --no-deps <the URL above>and install those nine packages yourself.Download this dataset folder (after access is granted). TODO: add the public Hugging Face link and DOI once they exist.
huggingface-cli download aldebaran-research/temp-med-bench --repo-type dataset --local-dir TempMedBench-1.0Score the sample run, with the folder as
--root:cd TempMedBench-1.0 tempmedbench-score sample_runs/dev_bm25_anchored_VN.trec.gz --split dev --surface anchored --corpus VN --root .Expected first lines (544 DEV questions; the full report also lists tiers, families and the group A metrics):
VN/BM25 split=dev surface=anchored corpus=VN run_depth=top_10 questions=544 PTDA@10 0.4896 [0.4568, 0.5228] PTDA full depth n/a WitnessSuccess@10 0.6673 [0.6268, 0.7059] AnchorSuccess@10 0.6250 [0.5846, 0.6654] EvidenceComplete@10 0.4228 [0.3805, 0.4651]
The scorer checks every file against MANIFEST.sha256 first and refuses an edited folder. This folder carries
anchor_event_ids (see "SNOMED CT fields"), so AnchorSuccess@10 and EvidenceComplete@10 are computed from the
folder itself, like every other metric. A run file may be plain or gzip; for your own system write
qid Q0 passage_id rank score tag lines for every DEV question, ranking every passage of the question's patient to
get the primary measure (see Metrics); a top-10 run gets the @10 measures only.
What is shipped is the anchored benchmark (--surface anchored). The synonym condition is not shipped: it needs a UMLS
licence and regeneration with tempmedbench-regenerate-synonyms (see synonym_regeneration/). The dated surface is an
ablation that the code regenerates.
Metrics
PTDA (Pairwise Temporal Discrimination Accuracy) measures whether a complete set of evidence for the answer is ranked
ahead of events about the same concept at the wrong time. The primary measure is full-ranking PTDA on pure
distractors (metrics.ptda_pure_full, reported for a run that ranks every passage of the patient): a distractor is
pure when it shares no passage with any witness event, and PTDA of a question is the fraction of its pure distractors
ranked after the first complete witness set. It is macro-averaged over the scored questions (every non-DURATION
question except the ABSENCE_ONLY ones, whose negative answer no passage can show, and the few with no pure
distractor) and has an exact random baseline, which the report prints (0.471 on TEST).
PTDA@10 is a different measure with the same name: it cuts the run at rank 10 and scores each certified distractor 1
if the witness comes first or only the witness is retrieved, 0 if the distractor comes first or only the distractor is
retrieved, and 0.5 if neither is retrieved or both sit in the same passage; 0.5 is a convention for pairs without an
ordering signal, not a chance level. Companions: PTDA at full depth,
WitnessSuccess@10 (a complete witness in the top 10), AnchorSuccess@10, EvidenceComplete@10 (the anchor passage and a
complete witness in the top 10), DistractorRate@10, RankMargin and per-tier PTDA, with bootstrap 95% intervals.
DURATION questions have no distractors and are scored with standard IR metrics only (nDCG@10, Recall@10, Success@10,
MRR). Score a TREC run file (qid Q0 passage_id rank score tag) with the tempmedbench-score command from the code
repository.
Scoring with this folder only
Point --root at this folder; it holds every input the scorer reads (questions, tiers, difficulty, distractors,
events, and the passages), so no repository data is needed:
tempmedbench-score run.trec --split dev --surface anchored --corpus VN --root <this folder>
DEV and TRAIN need nothing else. --split test also runs
without a record when --root is this folder and every file matches MANIFEST.sha256 (an edited bundle is
refused); the TEST terms below apply on
your honour: score a finished system once and never tune on TEST. The repository's committed pre-run record
(--test-authorized) is for the authors' own data root only.
Baselines
TEST, one pre-declared pass. Full-ranking PTDA on pure distractors, point value [95% bootstrap CI], over the 832 TEST questions with a pure distractor; exact random baseline 0.471 (anchored). Generated from the committed score files. DCT_ONLY is an oracle that reads the structured reference time (on the dated surface it reads the date from the text). The dated surface is an ablation and is not released. Retrieval coverage, fine-tuned encoders and the declared paired comparisons (permutation test, Holm within group) are in the paper. Two leakage gates FAIL (see Limitations), so read these numbers with that caveat.
| system | anchored | dated | synonym |
|---|---|---|---|
| surface_rule | 0.472 [0.445, 0.500] | 0.807 [0.783, 0.830] | 0.472 [0.444, 0.500] |
| reasoning_rule | 0.695 [0.668, 0.722] | 0.807 [0.783, 0.830] | 0.590 [0.562, 0.618] |
| BM25 | 0.523 [0.494, 0.552] | 0.577 [0.547, 0.606] | 0.524 [0.495, 0.552] |
| CONTRIEVER | 0.507 [0.479, 0.537] | 0.672 [0.646, 0.699] | 0.504 [0.475, 0.533] |
| TSM | 0.523 [0.493, 0.552] | 0.658 [0.631, 0.686] | 0.518 [0.490, 0.548] |
| MEDCPT | 0.500 [0.470, 0.530] | 0.429 [0.401, 0.458] | 0.501 [0.472, 0.532] |
| GTE_MODERNBERT | 0.508 [0.479, 0.538] | 0.657 [0.628, 0.684] | 0.510 [0.481, 0.539] |
| DCT_ONLY | 0.887 [0.868, 0.905] | 0.887 [0.868, 0.905] | 0.887 [0.868, 0.905] |
Intended use
Evaluating retrievers and temporal-reasoning rules on synthetic patient timelines, and studying how retrievers confuse the right concept at the wrong time. Not for clinical decision support. Not evidence about performance on real patients.
Terms of use
- No tuning, model selection or hyperparameter search on TEST.
- Cite the TempMedBench paper. TODO: add the BibTeX entry once the paper has a record.
- Respect
NOTICE.
Limitations
- Distribution shift: competition-only selection favours concepts that recur in a patient's record. v3 remains the reference for the unfiltered population.
- DURATION questions have no distractors by design and are scored with standard IR metrics only. (Some files and
reports label them
no_competition; in v4 that label covers exactly the DURATION questions.) - Leakage gates (post-hoc E6 diagnostics, evaluated once on TEST in the v4 pass; no data was changed; see
docs/benchmark/audits/2026-10-14-e6-leakage-gates-v4.mdanddocs/benchmark/audits/2026-10-14-v4-test-pass.mdin the code repository). Families that FAIL, per surface and split:template_name-only, anchored surface: TRAIN DURATION; DEV DURATION; TEST DURATION.template_name-only, synonym surface: TRAIN DURATION; DEV DURATION; TEST DURATION.question-artifact, anchored surface: TRAIN FIRST_AFTER; DEV ACTIVE_AT, DURATION, EVENT_AT, FIRST_AFTER; TEST EVENT_AT.question-artifact, synonym surface: TRAIN DURING; DEV DURATION, EVENT_AT; TEST EVENT_AT.patient_id-in-text: PASS.majority-outcome: TRAIN PASS, DEV PASS, TEST POOLED-ONLY (POOLED-ONLY: not recomputed on that split; the pooled construction audit covers it).out_of_record_arithmetic: TRAIN PASS, DEV PASS, TEST POOLED-ONLY (POOLED-ONLY: not recomputed on that split; the pooled construction audit covers it).
- The synonym surface is not in the release: without a UMLS licence it cannot be rebuilt, so synonym-surface results cannot be reproduced by everyone. Its synonyms passed author screening and an LLM audit; they are not human validated.
- The visit notes are written by an LLM and pass automated checks only; no clinician has checked that the prose is clinically faithful.
- Synthetic data: Synthea timelines are simpler and more regular than real records.
Versions and corrections
Each release is frozen under a version tag, and MANIFEST.sha256 gives the SHA-256 of every file. A file is never
changed in place: an error is corrected in a new version published beside the old one, which stays available, with a
changelog entry naming the files and results it changes. Report errors to the corresponding author of the paper or in
the discussion tab of this dataset page. Results should name the version they use. TempMedBench 1.0 is the version the
paper evaluates.
Licences
Data authored for TempMedBench: CC BY 4.0 (LICENSE in this folder, which covers data only). Code: Apache-2.0
(LICENSE in the code repository, not in this folder). Third-party content is carved out of that grant: the SNOMED CT notice follows, and the LOINC notice and the
RxNorm/NLM acknowledgement are in NOTICE.
This dataset contains SNOMED CT concept identifiers, fully specified names and preferred terms taken from the SNOMED International Global Patient Set (GPS), © 2026 International Health Terminology Standards Development Organisation, trading as SNOMED International. SNOMED CT® was originally created by the College of American Pathologists. The GPS is licensed under the Creative Commons Attribution-NoDerivatives 4.0 International Public License (https://creativecommons.org/licenses/by-nd/4.0/) and is available from https://www.snomed.org/gps. SNOMED International does not endorse this dataset.
- Downloads last month
- 67