EHRMamba: Towards Generalizable and Scalable Foundation Models for Electronic Health Records

Adibvafa Fallahpour, Mahshid Alinoori, Wenqian Ye, Xu Cao, Arash Afkanpour, Amrit Krishnan
Proceedings of the 4th Machine Learning for Health Symposium, PMLR 259:291-307, 2025.

Abstract

Transformers have significantly advanced the modeling of Electronic Health Records (EHR), yet their deployment in real-world healthcare is limited by several key challenges. Firstly, the quadratic computational cost and insufficient context length of these models hinder hospitals’ ability in processing the extensive medical histories typical in EHR data. Additionally, existing models employ separate finetuning for each clinical task, complicating maintenance in healthcare environments. Moreover, these models focus exclusively on either clinical prediction or EHR forecasting, lacking proficiency in both tasks. To overcome these limitations, we introduce EhrMamba, a robust foundation model built on the Mamba architecture. EhrMamba can process sequences up to 300% times longer than previous models due to its linear computational cost. We also introduce a novel approach to Multitask Prompted Finetuning (MPF) for EHR data, which enables EhrMamba to simultaneously learn multiple clinical tasks in a single finetuning phase, significantly enhancing deployment and cross-task generalization. Furthermore, our model leverages the HL7 FHIR data standard to simplify integration into existing hospital systems. Alongside EhrMamba, we open-source Odyssey, a toolkit designed to support the development and deployment of EHR foundation models, with an emphasis on data standardization and interpretability. Our evaluations on the MIMIC-IV dataset demonstrate that EhrMamba advances state-of-the-art performance across 6 major clinical tasks and excels in EHR forecasting, marking a significant leap forward in the field.

Cite this Paper


BibTeX
@InProceedings{pmlr-v259-fallahpour25a, title = {EHRMamba: Towards Generalizable and Scalable Foundation Models for Electronic Health Records}, author = {Fallahpour, Adibvafa and Alinoori, Mahshid and Ye, Wenqian and Cao, Xu and Afkanpour, Arash and Krishnan, Amrit}, booktitle = {Proceedings of the 4th Machine Learning for Health Symposium}, pages = {291--307}, year = {2025}, editor = {Hegselmann, Stefan and Zhou, Helen and Healey, Elizabeth and Chang, Trenton and Ellington, Caleb and Mhasawade, Vishwali and Tonekaboni, Sana and Argaw, Peniel and Zhang, Haoran}, volume = {259}, series = {Proceedings of Machine Learning Research}, month = {15--16 Dec}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v259/main/assets/fallahpour25a/fallahpour25a.pdf}, url = {https://proceedings.mlr.press/v259/fallahpour25a.html}, abstract = {Transformers have significantly advanced the modeling of Electronic Health Records (EHR), yet their deployment in real-world healthcare is limited by several key challenges. Firstly, the quadratic computational cost and insufficient context length of these models hinder hospitals’ ability in processing the extensive medical histories typical in EHR data. Additionally, existing models employ separate finetuning for each clinical task, complicating maintenance in healthcare environments. Moreover, these models focus exclusively on either clinical prediction or EHR forecasting, lacking proficiency in both tasks. To overcome these limitations, we introduce EhrMamba, a robust foundation model built on the Mamba architecture. EhrMamba can process sequences up to 300% times longer than previous models due to its linear computational cost. We also introduce a novel approach to Multitask Prompted Finetuning (MPF) for EHR data, which enables EhrMamba to simultaneously learn multiple clinical tasks in a single finetuning phase, significantly enhancing deployment and cross-task generalization. Furthermore, our model leverages the HL7 FHIR data standard to simplify integration into existing hospital systems. Alongside EhrMamba, we open-source Odyssey, a toolkit designed to support the development and deployment of EHR foundation models, with an emphasis on data standardization and interpretability. Our evaluations on the MIMIC-IV dataset demonstrate that EhrMamba advances state-of-the-art performance across 6 major clinical tasks and excels in EHR forecasting, marking a significant leap forward in the field.} }
Endnote
%0 Conference Paper %T EHRMamba: Towards Generalizable and Scalable Foundation Models for Electronic Health Records %A Adibvafa Fallahpour %A Mahshid Alinoori %A Wenqian Ye %A Xu Cao %A Arash Afkanpour %A Amrit Krishnan %B Proceedings of the 4th Machine Learning for Health Symposium %C Proceedings of Machine Learning Research %D 2025 %E Stefan Hegselmann %E Helen Zhou %E Elizabeth Healey %E Trenton Chang %E Caleb Ellington %E Vishwali Mhasawade %E Sana Tonekaboni %E Peniel Argaw %E Haoran Zhang %F pmlr-v259-fallahpour25a %I PMLR %P 291--307 %U https://proceedings.mlr.press/v259/fallahpour25a.html %V 259 %X Transformers have significantly advanced the modeling of Electronic Health Records (EHR), yet their deployment in real-world healthcare is limited by several key challenges. Firstly, the quadratic computational cost and insufficient context length of these models hinder hospitals’ ability in processing the extensive medical histories typical in EHR data. Additionally, existing models employ separate finetuning for each clinical task, complicating maintenance in healthcare environments. Moreover, these models focus exclusively on either clinical prediction or EHR forecasting, lacking proficiency in both tasks. To overcome these limitations, we introduce EhrMamba, a robust foundation model built on the Mamba architecture. EhrMamba can process sequences up to 300% times longer than previous models due to its linear computational cost. We also introduce a novel approach to Multitask Prompted Finetuning (MPF) for EHR data, which enables EhrMamba to simultaneously learn multiple clinical tasks in a single finetuning phase, significantly enhancing deployment and cross-task generalization. Furthermore, our model leverages the HL7 FHIR data standard to simplify integration into existing hospital systems. Alongside EhrMamba, we open-source Odyssey, a toolkit designed to support the development and deployment of EHR foundation models, with an emphasis on data standardization and interpretability. Our evaluations on the MIMIC-IV dataset demonstrate that EhrMamba advances state-of-the-art performance across 6 major clinical tasks and excels in EHR forecasting, marking a significant leap forward in the field.
APA
Fallahpour, A., Alinoori, M., Ye, W., Cao, X., Afkanpour, A. & Krishnan, A.. (2025). EHRMamba: Towards Generalizable and Scalable Foundation Models for Electronic Health Records. Proceedings of the 4th Machine Learning for Health Symposium, in Proceedings of Machine Learning Research 259:291-307 Available from https://proceedings.mlr.press/v259/fallahpour25a.html.

Related Material