[论文解读] Development and Testing of Retrieval Augmented Generation in Large Language Models -- A Case Study Report
本案例研究开发一个使用35条术前指南的医疗保健LLM-RAG管道,并显示RAG增强的GPT-4.0在准确性方面不劣于人类指令且高于基础LLMs,且响应更快。
Purpose: Large Language Models (LLMs) hold significant promise for medical applications. Retrieval Augmented Generation (RAG) emerges as a promising approach for customizing domain knowledge in LLMs. This case study presents the development and evaluation of an LLM-RAG pipeline tailored for healthcare, focusing specifically on preoperative medicine. Methods: We developed an LLM-RAG model using 35 preoperative guidelines and tested it against human-generated responses, with a total of 1260 responses evaluated. The RAG process involved converting clinical documents into text using Python-based frameworks like LangChain and Llamaindex, and processing these texts into chunks for embedding and retrieval. Vector storage techniques and selected embedding models to optimize data retrieval, using Pinecone for vector storage with a dimensionality of 1536 and cosine similarity for loss metrics. Human-generated answers, provided by junior doctors, were used as a comparison. Results: The LLM-RAG model generated answers within an average of 15-20 seconds, significantly faster than the 10 minutes typically required by humans. Among the basic LLMs, GPT4.0 exhibited the best accuracy of 80.1%. This accuracy was further increased to 91.4% when the model was enhanced with RAG. Compared to the human-generated instructions, which had an accuracy of 86.3%, the performance of the GPT4.0 RAG model demonstrated non-inferiority (p=0.610). Conclusions: In this case study, we demonstrated a LLM-RAG model for healthcare implementation. The pipeline shows the advantages of grounded knowledge, upgradability, and scalability as important aspects of healthcare LLM deployment.
研究动机与目标
- 展示一个以医疗保健为重点的LLM-RAG管道,使用术前指南。
- 评估RAG增强的LLM相对于人类生成的回答的准确性与速度。
- 评估LLM-RAG方法在医疗场景中的有据知识、可升级性和可扩展性。
提出的方法
- 使用LangChain和基于LlamaIndex的管道将临床文档转换为文本。
- 对文本进行分块并使用所选嵌入模型进行嵌入;在Pinecone中以1536维存储向量。
- 通过余弦相似性检索相关分块并用LLM(如GPT-4.0)生成答案。
- 将LLM输出与由初级医生提供的人类生成的回答进行比较(总计1260个回答)。
- 测量响应时间和准确性以评估性能和不劣性。
- 报告对医疗部署的真实地基、可升级性和可扩展性影响。
实验结果
研究问题
- RQ1检索增强生成管道是否能提高LLM在术前医疗指导中的准确性?
- RQ2与人类表现相比,RAG如何影响响应速度?
- RQ3带RAG的GPT-4.0在术前指导中的人类生成指令是否不劣于(统计比较)?
主要发现
- GPT-4.0 基本准确率:80.1%。
- GPT-4.0 以RAG增强的准确率:91.4%。
- 人类生成指令的准确率:86.3%。
- 带RAG的GPT-4.0对人类指令显示不劣性(p=0.610)。
- LLM-RAG提供更快的响应(15–20秒)相比人类(约10分钟)。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。