Feng Ruibin, Brennan Kelly A, Azizi Zahra, Goyal Jatin, Deb Brototo, Chang Hui Ju, Ganesan Prasanth, Clopton Paul, Pedron Maxime, Ruipérez-Campillo Samuel, Desai Yaanik B, De Larochellière Hugo, Baykaner Tina, Perez Marco V, Rodrigo Miguel, Rogers Albert J, Narayan Sanjiv M
Department of Medicine, Stanford University, CA (R.F., K.A.B., Z.A., J.G., B.D., H.J.C., P.G., P.C., M. Pedron, S.R.-C., Y.B.D., H.D.L., T.B., M. V. P, M.R., A.J.R., S.M.N.).
School of Information, University of California, Berkeley, CA (B.D., S.M.N.).
Circ Arrhythm Electrophysiol. 2025 Jan;18(1):e013023. doi: 10.1161/CIRCEP.124.013023. Epub 2024 Dec 16.
Large language models (LLMs) such as Chat Generative Pre-trained Transformer (ChatGPT) excel at interpreting unstructured data from public sources, yet are limited when responding to queries on private repositories, such as electronic health records (EHRs). We hypothesized that prompt engineering could enhance the accuracy of LLMs for interpreting EHR data without requiring domain knowledge, thus expanding their utility for patients and personalized diagnostics.
We designed and systematically tested prompt engineering techniques to improve the ability of LLMs to interpret EHRs for nuanced diagnostic questions, referenced to a panel of medical experts. In 490 full-text EHR notes from 125 patients with prior life-threatening heart rhythm disorders, we asked GPT-4-turbo to identify recurrent arrhythmias distinct from prior events and tested 220 563 queries. To provide context, results were compared with rule-based natural language processing and Bidirectional Encoder Representations from Transformer-based language models. Experiments were repeated for 2 additional LLMs.
In an independent hold-out set of 389 notes, GPT-4-turbo had a balanced accuracy of 64.3%±4.7% out-of-the-box at baseline. This increased when asking GPT-4-turbo to provide a rationale for its answers, a structured data output, and in-context exemplars, to a balanced accuracy of 91.4%±3.8% (<0.05). This surpassed the traditional logic-based natural language processing and BERT-based models (<0.05). Results were consistent for GPT-3.5-turbo and Jurassic-2 LLMs.
The use of prompt engineering strategies enables LLMs to identify clinical end points from EHRs with an accuracy that surpassed natural language processing and approximated experts, yet without the need for expert knowledge. These approaches could be applied to LLM queries for other domains, to facilitate automated analysis of nuanced data sets with high accuracy by nonexperts.
诸如聊天生成预训练变换器(ChatGPT)之类的大语言模型(LLMs)在解释来自公共来源的非结构化数据方面表现出色,但在回答有关私人存储库(如电子健康记录(EHRs))的查询时存在局限性。我们假设,提示工程可以提高大语言模型解释电子健康记录数据的准确性,而无需领域知识,从而扩大其对患者和个性化诊断的效用。
我们设计并系统测试了提示工程技术,以提高大语言模型解释电子健康记录以回答细微诊断问题的能力,并参考了一组医学专家的意见。在来自125名既往有危及生命的心律失常患者的490份全文电子健康记录笔记中,我们要求GPT-4-turbo识别与既往事件不同的复发性心律失常,并测试了220563个查询。为了提供背景信息,将结果与基于规则的自然语言处理和基于变换器的双向编码器表示语言模型进行了比较。对另外两个大语言模型重复进行了实验。
在一个独立的包含389份笔记的保留集中,GPT-4-turbo在基线时开箱即用的平衡准确率为64.3%±4.7%。当要求GPT-4-turbo为其答案提供理由、结构化数据输出和上下文示例时,这一准确率提高到了91.4%±3.8%(<0.05)。这超过了传统的基于逻辑的自然语言处理和基于BERT的模型(<0.05)。GPT-3.5-turbo和Jurassic-2大语言模型的结果一致。
使用提示工程策略使大语言模型能够从电子健康记录中识别临床终点,其准确性超过自然语言处理且接近专家水平,但无需专家知识。这些方法可应用于其他领域的大语言模型查询,以促进非专家对细微数据集进行高精度的自动分析。