We built TempoMed-Bench, a benchmark for evaluating the temporal awareness of LLMs in the medical domain through evolving guideline knowledge.
At a high level, the pipeline:
The main code is organized under:
pubmed_trajectory/prepare/pubmed_trajectory/post-processing/pubmed_trajectory/difference_generation/pubmed_trajectory/evaluation/Several scripts require a utils/config.py (You have to create your own by referring to the example we provide in utils/config_example.py) for Azure/OpenAI credentials.
For reviewers, the simplest way to inspect the provided benchmark outputs is:
bash evaluate_5_option.sh
This uses the checked-in result files and runs the downstream visualization/analysis step.
If you want to rerun the Azure-based 5-option evaluation itself, use:
bash evaluate_5_option_gpt.sh
This requires a local untracked utils/config.py with valid Azure/OpenAI credentials.
The following describes how to replicate our data collection process:
python3 pubmed_trajectory/prepare/pubmed_download.py
You need to download all the subsets, including comm, noncomm, and other. Also you need to download pubmed baseline and updatefiles.
python3 pubmed_trajectory/prepare/pubmed_meta_graph.py
This expects extracted PubMed XML directories such as:
pubmed_baseline_xml_extracted_2026pubmed_updatefiles_xml_extracted_2026and writes pmid_guideline_mapping.json.
python3 pubmed_trajectory/prepare/pubmed_extract.py
This stage is mainly configured for the comm branch by default. If you also use noncomm or other, you may need to repeat or adapt the same process.
python3 pubmed_trajectory/prepare/pubmed_extract_guideline_groups.py
This produces trajectory JSON files such as:
comm_guideline_trajectory_2026_relaxed/...Useful cleanup and augmentation scripts live in pubmed_trajectory/post-processing/, including:
pubmed_augment_trajectory_with_related.pypubmed_apply_resolved_current_pmids.pypubmed_calibrate_year_from_title.pypubmed_filter_nonterminal_trajectories.pypubmed_check_redundant_prior_pmids.pyThis process finalizes the TempoMed-Traj dataset.
python3 pubmed_trajectory/difference_generation/pubmed_construct_guideline_diffs_with_verifier.py
This writes nested outputs under directories such as:
results_2026_relaxed_with_post_processing/<current_pmcid>/...Question generation expects a flat directory of diff JSON files rather than nested per-PMCID outputs.
For reviewers, use the following directory as the canonical flattened input for MCQ generation:
results_2026_relaxed_with_post_processing_flatIf you need to regenerate it from the nested post-processed outputs, run:
python3 pubmed_trajectory/difference_generation/copy_flat_json_files.py \
--source-dir ./results_2026_relaxed_with_post_processing \
--output-dir ./results_2026_relaxed_with_post_processing_flat
After flattening the non-empty recommendation-difference files, you can generate MCQs with:
bash generate_questions_4_option.sh
This wrapper currently runs:
python pubmed_trajectory/evaluation/pubmed_generate_questions_with_NBME.py \
./results_2026_relaxed_with_post_processing_flat \
./questions_2026_relaxed_4_option_augmented.jsonl
The input should be a flat directory containing *_extracted_diffs.json files. The output is a JSONL file of MCQs, where each item includes the question stem, answer choices, the correct answer, and metadata linking the question back to the current and prior guideline pair.
2 commits
Python
98.0%
Jupyter Notebook
1.1%
We built TempoMed-Bench, a benchmark for evaluating the temporal awareness of LLMs in the medical domain through evolving guideline knowledge.
At a high level, the pipeline:
The main code is organized under:
pubmed_trajectory/prepare/pubmed_trajectory/post-processing/pubmed_trajectory/difference_generation/pubmed_trajectory/evaluation/Several scripts require a utils/config.py (You have to create your own by referring to the example we provide in utils/config_example.py) for Azure/OpenAI credentials.
For reviewers, the simplest way to inspect the provided benchmark outputs is:
bash evaluate_5_option.sh
This uses the checked-in result files and runs the downstream visualization/analysis step.
If you want to rerun the Azure-based 5-option evaluation itself, use:
bash evaluate_5_option_gpt.sh
This requires a local untracked utils/config.py with valid Azure/OpenAI credentials.
The following describes how to replicate our data collection process:
python3 pubmed_trajectory/prepare/pubmed_download.py
You need to download all the subsets, including comm, noncomm, and other. Also you need to download pubmed baseline and updatefiles.
python3 pubmed_trajectory/prepare/pubmed_meta_graph.py
This expects extracted PubMed XML directories such as:
pubmed_baseline_xml_extracted_2026pubmed_updatefiles_xml_extracted_2026and writes pmid_guideline_mapping.json.
python3 pubmed_trajectory/prepare/pubmed_extract.py
This stage is mainly configured for the comm branch by default. If you also use noncomm or other, you may need to repeat or adapt the same process.
python3 pubmed_trajectory/prepare/pubmed_extract_guideline_groups.py
This produces trajectory JSON files such as:
comm_guideline_trajectory_2026_relaxed/...Useful cleanup and augmentation scripts live in pubmed_trajectory/post-processing/, including:
pubmed_augment_trajectory_with_related.pypubmed_apply_resolved_current_pmids.pypubmed_calibrate_year_from_title.pypubmed_filter_nonterminal_trajectories.pypubmed_check_redundant_prior_pmids.pyThis process finalizes the TempoMed-Traj dataset.
python3 pubmed_trajectory/difference_generation/pubmed_construct_guideline_diffs_with_verifier.py
This writes nested outputs under directories such as:
results_2026_relaxed_with_post_processing/<current_pmcid>/...Question generation expects a flat directory of diff JSON files rather than nested per-PMCID outputs.
For reviewers, use the following directory as the canonical flattened input for MCQ generation:
results_2026_relaxed_with_post_processing_flatIf you need to regenerate it from the nested post-processed outputs, run:
python3 pubmed_trajectory/difference_generation/copy_flat_json_files.py \
--source-dir ./results_2026_relaxed_with_post_processing \
--output-dir ./results_2026_relaxed_with_post_processing_flat
After flattening the non-empty recommendation-difference files, you can generate MCQs with:
bash generate_questions_4_option.sh
This wrapper currently runs:
python pubmed_trajectory/evaluation/pubmed_generate_questions_with_NBME.py \
./results_2026_relaxed_with_post_processing_flat \
./questions_2026_relaxed_4_option_augmented.jsonl
The input should be a flat directory containing *_extracted_diffs.json files. The output is a JSONL file of MCQs, where each item includes the question stem, answer choices, the correct answer, and metadata linking the question back to the current and prior guideline pair.
2 commits
Python
98.0%
Jupyter Notebook
1.1%