mlsanityData to 7 Oct 2026

Context Clues: Evaluating Long Context Models for Clinical Prediction Tasks on EHRs

arXiv 2412.16178 ↗First posted 9 Dec 2024cs.LG cs.AI cs.CEcited by 39

On the map: State-space sequence models (S4, Mamba) → Core SSM architectures for language

Abstract (arXiv)

Foundation Models (FMs) trained on Electronic Health Records (EHRs) have achieved state-of-the-art results on numerous clinical prediction tasks. However, most existing EHR FMs have context windows of <1k tokens. This prevents them from modeling full patient EHRs which can exceed 10k's of events. Recent advancements in subquadratic long-context architectures (e.g., Mamba) offer a promising solution. However, their application to EHR data has not been well-studied. We address this gap by presenting the first systematic evaluation of the effect of context length on modeling EHR data. We find that longer context models improve predictive performance -- our Mamba-based model surpasses the prior state-of-the-art on 9/14 tasks on the EHRSHOT prediction benchmark. For clinical applications, however, model performance alone is insufficient -- robustness to the unique properties of EHR is crucial. Thus, we also evaluate models across three previously underexplored properties of EHR data: (1) the prevalence of "copy-forwarded" diagnoses which creates artificial repetition of tokens within EHR sequences; (2) the irregular time intervals between EHR events which can lead to a wide range of timespans within a context window; and (3) the natural increase in disease complexity over time which makes later tokens in the EHR harder to predict than earlier ones. Stratifying our EHRSHOT results, we find that higher levels of each property correlate negatively with model performance, but that longer context models are more robust to more extreme levels of these properties. Our work highlights the potential for using long-context architectures to model EHR data, and offers a case study for identifying new challenges in modeling sequential data motivated by domains outside of natural language. We release our models and code at: https://github.com/som-shahlab/long_context_clues

Key facts. Cited by 39 papers in the map (data through 7 Oct 2026). Placed in Core SSM architectures for language, one of 10 directions in State-space sequence models (S4, Mamba). Builds on 39 of its 55 references that are in the map. First posted on arXiv 9 Dec 2024.

Builds on

39 of 55 references.

Closest ancestors · 4

Same direction, newest first

  1. 2024Jamba: A Hybrid Transformer-Mamba Language Model28 Mar
  2. 2024RankMamba: Benchmarking Mamba's Document Ranking Performance in the Era of Transformers27 Mar
  3. 2024Simple linear attention language models balance the recall-throughput tradeoff28 Feb
  4. 2021Efficiently Modeling Long Sequences with Structured State Spaces31 Oct

Other references · 35

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2020Scaling Laws for Neural Language Modelscited by 6,411
  5. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  6. 2021On the Opportunities and Risks of Foundation Modelscited by 3,961
  7. 2016Pointer Sentinel Mixture Modelscited by 2,992
  8. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  9. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  10. 2020Efficient Transformers: A Surveycited by 784
  11. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
  12. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
23 more
  1. 2016Recurrent Neural Networks for Multivariate Time Series with Missing Valuescited by 548
  2. 2023Hyena Hierarchy: Towards Larger Convolutional Language Modelscited by 388
  3. 2020Med-BERT: pre-trained contextualized embeddings on large-scale structured electronic health records for disease predictioncited by 368
  4. 2023ClimaX: A foundation model for weather and climatecited by 325
  5. 2023Effective Long-Context Scaling of Foundation Modelscited by 301
  6. 2019BEHRT: Transformer for Electronic Health Recordscited by 258
  7. 2024Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Modelscited by 232
  8. 2023HyenaDNA: Long-Range Genomic Sequence Modeling at Single Nucleotide Resolutioncited by 187
  9. 2022It's Raw! Audio Generation with State-Space Modelscited by 171
  10. 2023EHRSHOT: An EHR Benchmark for Few-Shot Evaluation of Foundation Modelscited by 101
  11. 2020Language Models Are An Effective Patient Representation Learning Technique For Electronic Health Record Datacited by 85
  12. 2021CEHR-BERT: Incorporating temporal information from structured EHR data to improve prediction taskscited by 75
  13. 2023MOTOR: A Time-To-Event Foundation Model For Structured Medical Recordscited by 75
  14. 2024Zero Shot Health Trajectory Prediction Using Transformercited by 74
  15. 2022Integrated multimodal artificial intelligence framework for healthcare applicationscited by 69
  16. 2024State Space Model for New-Generation Network Alternative to Transformers: A Surveycited by 59
  17. 2023Event Stream GPT: A Data Pre-processing and Modeling Library for Generative, Pre-trained Transformers over Continuous-time Sequences of Complex Eventscited by 46
  18. 2024Toto: Time Series Optimized Transformer for Observabilitycited by 44
  19. 2022GenHPF: General Healthcare Predictive Framework with Multi-task Multi-source Learningcited by 35
  20. 2024CEHR-GPT: Generating Electronic Health Records with Chronological Patient Timelinescited by 22
  21. 2024CORE-BEHRT: A Carefully Optimized and Rigorously Evaluated BEHRTcited by 20
  22. 2023General-Purpose Retrieval-Enhanced Medical Prediction Model Using Near-Infinite Historycited by 12
  23. 2022UniHPF : Universal Healthcare Predictive Framework with Zero Domain Knowledgecited by 4

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 15; 2026: 24.

39 papers.

Sort:

By area:

  1. 2025MedHELM: Holistic Evaluation of Large Language Models for Medical Taskscited by 60
  2. 2025TIMER: Temporal Instruction Modeling and Evaluation for Longitudinal Clinical Recordscited by 33
  3. 2025Clinical ModernBERT: An efficient and long context encoder for biomedical textcited by 26
  4. 2025Beyond Sensor Data: Foundation Models of Behavioral Data from Wearables Improve Health Predictionscited by 18
  5. 2025Foundation models for electronic health records: representation dynamics and transferabilitycited by 11
  6. 2025A Collection of Innovations in Medical AI for patient records in 2024cited by 7
  7. 2026Tokenization Tradeoffs in Structured EHR Foundation Modelscited by 6
  8. 2025MedCoT-RAG: Causal Chain-of-Thought RAG for Medical Question Answeringcited by 5
  9. 2026One Loss to Rule Them All: Marked Time-to-Event for Structured EHR Foundation Modelscited by 5
  10. 2025CEHR-XGPT: A Scalable Multi-Task Foundation Model for Electronic Health Recordscited by 4
  11. 2025Quantifying surprise in clinical care: Detecting highly informative events in electronic health records with foundation modelscited by 3
  12. 2025EHR2Path: Comprehensive Pathway-Level Modeling of Longitudinal Patient Trajectories from Multimodal Electronic Health Recordscited by 2
27 more
  1. 2025Traj-CoA: Patient Trajectory Modeling via Chain-of-Agents for Lung Cancer Risk Predictioncited by 2
  2. 2025Count-Based Approaches Remain Strong: A Benchmark Against Transformer and LLM Pipelines on Structured EHRcited by 2
  3. 2026Efficient Generative Prediction for EHR Foundation Models: The SCOPE and REACH Estimatorscited by 2
  4. 2026Learning Clinical Representations Under Systematic Distribution Shiftcited by 2
  5. 2026Discriminative Representation Learning for Clinical Predictioncited by 2
  6. 2026Retrieval-aligned Tabular Foundation Models Enable Robust Clinical Risk Prediction in Electronic Health Records Under Real-world Constraintscited by 2
  7. 2025Integrating Genomics into Multimodal EHR Foundation Modelscited by 1
  8. 2026Learning Longitudinal Health Representations from EHR and Wearable Datacited by 1
  9. 2026Uncertainty-Aware Foundation Models for Clinical Datacited by 1
  10. 2026TrajOnco: a multi-agent framework for temporal reasoning over longitudinal EHR for multi-cancer early detectioncited by 1
  11. 2026Handling and Interpreting Missing Modalities in Patient Clinical Trajectories via Autoregressive Sequence Modelingcited by 1
  12. 2026Agentifying Patient Dynamics within LLMs through Interacting with Clinical World Modelcited by 1
  13. 2025Stable Prediction of Adverse Events in Medical Time-Series Datacited by 0
  14. 2025Trajectory-guided discharge stratification for heart failure using short-context electronic health record sequence modelingcited by 0
  15. 2026A pipeline for enabling path-specific causal fairness in observational health datacited by 0
  16. 2026Dense Feature Learning via Linear Structure Preservation in Medical Datacited by 0
  17. 2026Risk Horizons: Structured Hypothesis Spaces for Longitudinal Clinical Predictioncited by 0
  18. 2026Vital Trace: Protocol-Constrained Patient-State Reasoning for Longitudinal Clinical Trajectoriescited by 0
  19. 2026Event Fields: Learning Latent Event Structure for Waveform Foundation Modelscited by 0
  20. 2026WISTERIA: Learning Clinical Representations from Noisy Supervision via Multi-View Consistency in Electronic Health Recordscited by 0
  21. 2026EHR-RAGp: Retrieval-Augmented Prototype-Guided Foundation Model for Electronic Health Recordscited by 0
  22. 2026COTCAgent: Preventive Consultation via Probabilistic Chain-of-Thought Completioncited by 0
  23. 2026AURORA: Contextual Orthogonalization for Geometric Representation Learning in Healthcare Foundation Modelscited by 0
  24. 2026How Should Transformers Encode Numeric Values in Electronic Health Records?cited by 0
  25. 2026MorphologyFM: A Foundation Model for Morphology-Aware Representation Learning from ECG and Pulse Oximetry Waveformscited by 0
  26. 2026Federated generative event models for tokenized electronic health recordscited by 0
  27. 2026Foresight-England: Development of a National-Scale Generative AI Model of Electronic Health Records for Medical Event Prediction across the COVID-19 Pandemiccited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2024EHRMamba: Towards Generalizable and Scalable Foundation Models for Electronic Health Records
  2. 2026EHR-RAG: Bridging Long-Horizon Structured Electronic Health Records and Large Language Models via Enhanced Retrieval-Augmented Generation
  3. 2025Evaluating Retrieval-Augmented Generation vs. Long-Context Input for Clinical Reasoning over EHRs
  4. 2025Building the EHR Foundation Model via Next Event Prediction
  5. 2026LLM4EHR: Aligning Clinical Time Series with Medical Event Sequences via Large Language Models
  6. 2026ChatHealthAI: Aligning Electronic Health Record Representations with Large Language Models for Grounded Clinical Reasoning
  7. 2025EHRStruct: A Comprehensive Benchmark Framework for Evaluating Large Language Models on Structured Electronic Health Record Tasks
  8. 2025Large Language Models with Temporal Reasoning for Longitudinal Clinical Summarization and Prediction