[Paper Review] MedGPT: Medical Concept Prediction from Clinical Narratives
MedGPT is a transformer-based model that forecasts future medical disorders from unstructured clinical narratives by first structuring free-text EHRs using MedCAT for named entity recognition and linking, then applying causal language modeling to predict sequential medical concepts. It achieves superior performance over LSTM baselines (precision: 0.640 vs. 0.633 at top-5) and demonstrates clinical reasoning through attention interpretability and multiple-choice question-answering tasks.
The data available in Electronic Health Records (EHRs) provides the opportunity to transform care, and the best way to provide better care for one patient is through learning from the data available on all other patients. Temporal modelling of a patient's medical history, which takes into account the sequence of past events, can be used to predict future events such as a diagnosis of a new disorder or complication of a previous or existing disorder. While most prediction approaches use mostly the structured data in EHRs or a subset of single-domain predictions and outcomes, we present MedGPT a novel transformer-based pipeline that uses Named Entity Recognition and Linking tools (i.e. MedCAT) to structure and organize the free text portion of EHRs and anticipate a range of future medical events (initially disorders). Since a large portion of EHR data is in text form, such an approach benefits from a granular and detailed view of a patient while introducing modest additional noise. MedGPT effectively deals with the noise and the added granularity, and achieves a precision of 0.344, 0.552 and 0.640 (vs LSTM 0.329, 0.538 and 0.633) when predicting the top 1, 3 and 5 candidate future disorders on real world hospital data from King's College Hospital, London, UK ( extasciitilde600k patients). We also show that our model captures medical knowledge by testing it on an experimental medical multiple choice question answering task, and by examining the attentional focus of the model using gradient-based saliency methods.
Motivation & Objective
- To develop a general-purpose model that forecasts future medical events from unstructured clinical narratives in EHRs.
- To overcome limitations of existing models that rely solely on structured EHR data or narrow prediction scopes.
- To enable temporal modeling of patient histories by transforming free-text clinical notes into standardized, sequential medical concepts.
- To evaluate whether the model captures medical knowledge through differential diagnosis reasoning and attention interpretability.
- To provide explainable predictions using gradient-based saliency methods to highlight clinically relevant tokens in patient timelines.
Proposed method
- Utilizes MedCAT to perform Named Entity Recognition and Linking (NER+L) on unstructured EHR text, mapping clinical terms to a standardized medical ontology.
- Constructs a sequential representation of patient history by ordering medical concepts chronologically based on temporal metadata.
- Employs a GPT-2-based causal language modeling (CLM) architecture to predict the next medical concept in the sequence, enabling autoregressive forecasting.
- Trains the model end-to-end on the target task of future disorder prediction without pre-training on masked language modeling.
- Applies gradient-based saliency methods to interpret attention weights and identify the most influential tokens in the patient timeline for each prediction.
- Evaluates model performance on real-world EHR data from King’s College Hospital (~600k patients) using precision at top-1, top-3, and top-5 predictions.
Experimental results
Research questions
- RQ1Can a transformer-based model effectively forecast future medical disorders from unstructured clinical narratives without relying on structured EHR data?
- RQ2How does MedGPT’s performance compare to LSTM-based baselines in predicting future disorders across top-1, top-3, and top-5 candidate rankings?
- RQ3To what extent does MedGPT demonstrate clinical reasoning by correctly selecting rare or contextually dependent diagnoses in multiple-choice scenarios?
- RQ4Can gradient-based saliency methods identify clinically relevant tokens (e.g., symptoms, comorbidities) that inform the model’s predictions?
- RQ5Does MedGPT capture relational medical knowledge, such as associations between disorders and complications, through its attention mechanisms?
Key findings
- MedGPT achieves a precision of 0.640 in predicting the top-5 future disorders on real-world EHR data, outperforming the LSTM baseline (0.633).
- The model achieves precision of 0.344, 0.552, and 0.640 at top-1, top-3, and top-5 ranks, respectively, demonstrating strong performance across multiple evaluation thresholds.
- In a multiple-choice diagnostic task, MedGPT correctly identified the most likely diagnosis in 4/4 test cases, including complex scenarios with distractors and indirect inferences.
- Gradient-based saliency analysis revealed that clinically relevant tokens such as 'ketoacidosis', 'ulcer of foot', and 'age 49' were highly salient for predicting diabetes-related complications.
- The model demonstrated robustness to distractors, correctly identifying rare diagnoses like congenital cystic kidney disease and drug-induced Parkinsonism despite misleading or common comorbidities.
- Attention maps showed that MedGPT focuses on temporally relevant and clinically meaningful events, indicating effective capture of medical knowledge and temporal reasoning.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.