AToP: An Explainability Framework for Transformer-Based EHR Predictions Using Attribution-Guided Temporal Pattern Mining

Objective: To develop and evaluate AToP (Attribution to Temporal Patterns), a post-hoc explainability framework that converts per-token Integrated Gradients (IG) from a Transformer into structured temporal pattern narratives. Materials and Methods: AToP was applied to a single-stream Transformer trained on MIMIC-IV v3.1 (218,196 patients; 12.6% unplanned 30-day readmission). It mines frequent episodes from salient-token subsequences in the training cohort, aggregates attribution among patients whose records contain each token or pattern, and collapses near-duplicates by patient overlap. Validation used masking, reversed-order analysis, token-level faithfulness tests, and KernelSHAP comparison. Results: The Transformer achieved AUROC 0.77 and PR-AUC 0.34. Population-weighted attribution emphasized high-prevalence codes with small per-patient impact. Carrier-conditional attribution, the mean among patients with the token, surfaced rare high-attribution psychiatric markers including psychosis, self-harm overdose, suicidal ideation (SI), and severe major depressive disorder (MDD). Pattern-level attribution identified within-visit co-occurrences and cross-visit trajectories not captured by token rankings. Risk-increasing patterns included psychiatric sequences ({MDD, SI} → SI) and oncologic progressions (cancer anemia → ascites). Obstetric and chest pain evaluation patterns were associated with lower predicted readmission. Discussion: The framework provides two complementary views of model predictions: carrier-conditional aggregation highlights rare, highly attributed clinical features, while temporal pattern analysis identifies within-visit combinations and cross-visit trajectories missed by token-level rankings. Masking and visit-order reversal provided evidence of correspondence with model behavior, but pattern attributions do not represent unique effects or establish clinical validity. Conclusion: AToP turns a Transformer's attributions into visit-anchored temporal pattern narratives, showing which events, in which order, contribute to its readmission predictions.

Authors

Institutions

Publication Details

Journal
medRxiv
Published
2026-11-12
DOI
https://doi.org/10.64898/2026.11.10.26367753
Primary Topic
Explainable Artificial Intelligence (XAI)
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

AToP: An Explainability Framework for Transformer-Based EHR Predictions Using Attribution-Guided Temporal Pattern Mining

Anas Belouali, Hadi H.K. Kharrazi
medRxiv
Explainable Artificial Intelligence (XAI)
preprint

AToP: An Explainability Framework for Transformer-Based EHR Predictions Using Attribution-Guided Temporal Pattern Mining

Anas Belouali, Hadi H.K. Kharrazi
preprint en

Abstract

Objective: To develop and evaluate AToP (Attribution to Temporal Patterns), a post-hoc explainability framework that converts per-token Integrated Gradients (IG) from a Transformer into structured temporal pattern narratives. Materials and Methods: AToP was applied to a single-stream Transformer trained on MIMIC-IV v3.1 (218,196 patients; 12.6% unplanned 30-day readmission). It mines frequent episodes from salient-token subsequences in the training cohort, aggregates attribution among patients whose records contain each token or pattern, and collapses near-duplicates by patient overlap. Validation used masking, reversed-order analysis, token-level faithfulness tests, and KernelSHAP comparison. Results: The Transformer achieved AUROC 0.77 and PR-AUC 0.34. Population-weighted attribution emphasized high-prevalence codes with small per-patient impact. Carrier-conditional attribution, the mean among patients with the token, surfaced rare high-attribution psychiatric markers including psychosis, self-harm overdose, suicidal ideation (SI), and severe major depressive disorder (MDD). Pattern-level attribution identified within-visit co-occurrences and cross-visit trajectories not captured by token rankings. Risk-increasing patterns included psychiatric sequences ({MDD, SI} → SI) and oncologic progressions (cancer anemia → ascites). Obstetric and chest pain evaluation patterns were associated with lower predicted readmission. Discussion: The framework provides two complementary views of model predictions: carrier-conditional aggregation highlights rare, highly attributed clinical features, while temporal pattern analysis identifies within-visit combinations and cross-visit trajectories missed by token-level rankings. Masking and visit-order reversal provided evidence of correspondence with model behavior, but pattern attributions do not represent unique effects or establish clinical validity. Conclusion: AToP turns a Transformer's attributions into visit-anchored temporal pattern narratives, showing which events, in which order, contribute to its readmission predictions.

medRxiv
Johns Hopkins University (US)
Good health and well-being
Explainable Artificial Intelligence (XAI)
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon