Leveraging LLMs for Predicting Unknown Diagnoses from Clinical Notes
Authors:
Preprint
Abstract
Electronic Health Records (EHRs) often lack explicit links between medications and diagnoses, making clinical decision-making and research more difficult. Even when links exist, diagnosis lists may be incomplete, especially during early patient visits. Discharge summaries tend to provide more complete information, which can help infer accurate diagnoses, especially with the help of large language models (LLMs). This study investigates whether LLMs can predict implicitly mentioned diagnoses from clinical notes and link them to corresponding medications. We address two research questions: (1) Does majority voting across diverse LLM configurations outperform the best single configuration in diagnosis prediction? (2) How sensitive is majority voting accuracy to LLM hyperparameters such as temperature, top-p, and summary length? To evaluate, we created a new dataset of 240 expert-annotated medication-diagnosis pairs from 20 MIMIC-IV notes. Using GPT-3.5 Turbo, we ran 18 prompting configurations across short and long summary lengths, generating 8568 test cases. Results show that majority voting achieved 75 percent accuracy, outperforming the best single configuration at 66 percent. No single hyperparameter setting dominated, but combining deterministic, balanced, and exploratory strategies improved performance. Shorter summaries generally led to higher accuracy.In conclusion, ensemble-style majority voting with diverse LLM configurations improves diagnosis prediction in EHRs and offers a promising method to link medications and diagnoses in clinical texts.Keywords
All Related Versions
This publication has 9 references indexed in Scilit:
- Toward expert-level medical question answering with large language modelsNature Medicine, 2025
- Reasoning with large language models for medical question answeringJournal of the American Medical Informatics Association, 2024
- A critical assessment of using ChatGPT for extracting structured data from clinical notesnpj Digital Medicine, 2024
- DRG-LLaMA : tuning LLaMA model to predict diagnosis-related group for hospitalized patientsnpj Digital Medicine, 2024
- Large language models encode clinical knowledgeNature, 2023
- Conformal Nucleus Sampling2023
- Language Models that Seek for Knowledge: Modular Search & Generation for Dialogue and Prompt Completion2022
- CBOWRA: A Representation Learning Approach for Medication Anomaly Detection2019
- Use of electronic health record data from diverse primary care practices to identify and characterize patients’ prescribed common medicationsHealth Informatics Journal, 2018