Leveraging large language models for generating responses to patient messages-a subjective analysis
- PMID: 38497958
- PMCID: PMC11105129
- DOI: 10.1093/jamia/ocae052
Leveraging large language models for generating responses to patient messages-a subjective analysis
Abstract
Objective: This study aimed to develop and assess the performance of fine-tuned large language models for generating responses to patient messages sent via an electronic health record patient portal.
Materials and methods: Utilizing a dataset of messages and responses extracted from the patient portal at a large academic medical center, we developed a model (CLAIR-Short) based on a pre-trained large language model (LLaMA-65B). In addition, we used the OpenAI API to update physician responses from an open-source dataset into a format with informative paragraphs that offered patient education while emphasizing empathy and professionalism. By combining with this dataset, we further fine-tuned our model (CLAIR-Long). To evaluate fine-tuned models, we used 10 representative patient portal questions in primary care to generate responses. We asked primary care physicians to review generated responses from our models and ChatGPT and rated them for empathy, responsiveness, accuracy, and usefulness.
Results: The dataset consisted of 499 794 pairs of patient messages and corresponding responses from the patient portal, with 5000 patient messages and ChatGPT-updated responses from an online platform. Four primary care physicians participated in the survey. CLAIR-Short exhibited the ability to generate concise responses similar to provider's responses. CLAIR-Long responses provided increased patient educational content compared to CLAIR-Short and were rated similarly to ChatGPT's responses, receiving positive evaluations for responsiveness, empathy, and accuracy, while receiving a neutral rating for usefulness.
Conclusion: This subjective analysis suggests that leveraging large language models to generate responses to patient messages demonstrates significant potential in facilitating communication between patients and healthcare providers.
Keywords: artificial intelligence; clinical decision support; large language model; patient portal; primary care.
© The Author(s) 2024. Published by Oxford University Press on behalf of the American Medical Informatics Association.
Conflict of interest statement
The authors do not have conflicts of interest related to this study.
Figures






Update of
-
Leveraging Large Language Models for Generating Responses to Patient Messages.medRxiv [Preprint]. 2023 Jul 16:2023.07.14.23292669. doi: 10.1101/2023.07.14.23292669. medRxiv. 2023. Update in: J Am Med Inform Assoc. 2024 May 20;31(6):1367-1379. doi: 10.1093/jamia/ocae052. PMID: 37503263 Free PMC article. Updated. Preprint.
Similar articles
-
Leveraging Large Language Models for Generating Responses to Patient Messages.medRxiv [Preprint]. 2023 Jul 16:2023.07.14.23292669. doi: 10.1101/2023.07.14.23292669. medRxiv. 2023. Update in: J Am Med Inform Assoc. 2024 May 20;31(6):1367-1379. doi: 10.1093/jamia/ocae052. PMID: 37503263 Free PMC article. Updated. Preprint.
-
Comparing the quality of ChatGPT- and physician-generated responses to patients' dermatology questions in the electronic medical record.Clin Exp Dermatol. 2024 Jun 25;49(7):715-718. doi: 10.1093/ced/llad456. Clin Exp Dermatol. 2024. PMID: 38180108
-
Large Language Model-Based Responses to Patients' In-Basket Messages.JAMA Netw Open. 2024 Jul 1;7(7):e2422399. doi: 10.1001/jamanetworkopen.2024.22399. JAMA Netw Open. 2024. PMID: 39012633 Free PMC article.
-
A scoping review of empathy recognition in text using natural language processing.J Am Med Inform Assoc. 2024 Feb 16;31(3):762-775. doi: 10.1093/jamia/ocad229. J Am Med Inform Assoc. 2024. PMID: 38092686 Free PMC article.
-
Advancing Medical Practice with Artificial Intelligence: ChatGPT in Healthcare.Isr Med Assoc J. 2024 Feb;26(2):80-85. Isr Med Assoc J. 2024. PMID: 38420977 Review.
Cited by
-
What can artificial intelligence do for EUS?Endosc Ultrasound. 2025 Jan-Feb;14(1):1-3. doi: 10.1097/eus.0000000000000102. Epub 2025 Feb 27. Endosc Ultrasound. 2025. PMID: 40151598 Free PMC article. No abstract available.
-
Large language models for structured reporting in radiology: past, present, and future.Eur Radiol. 2025 May;35(5):2589-2602. doi: 10.1007/s00330-024-11107-6. Epub 2024 Oct 23. Eur Radiol. 2025. PMID: 39438330 Free PMC article. Review.
-
ChatGPT's advice is perceived as better than that of professional advice columnists.Front Psychol. 2023 Nov 21;14:1281255. doi: 10.3389/fpsyg.2023.1281255. eCollection 2023. Front Psychol. 2023. PMID: 38078232 Free PMC article.
-
Evaluating the Prevalence of Burnout Among Health Care Professionals Related to Electronic Health Record Use: Systematic Review and Meta-Analysis.JMIR Med Inform. 2024 Jun 12;12:e54811. doi: 10.2196/54811. JMIR Med Inform. 2024. PMID: 38865188 Free PMC article. Review.
-
Generative artificial intelligence in graduate medical education.Front Med (Lausanne). 2025 Jan 10;11:1525604. doi: 10.3389/fmed.2024.1525604. eCollection 2024. Front Med (Lausanne). 2025. PMID: 39867924 Free PMC article. Review.