While large language models (LLMs) have achieved state-of-the-art performance on a wide range of medical question answering (QA) tasks, they still face challenges with hallucinations and outdated knowledge. Retrieval-augmented generation (RAG) is a promising solution and has been widely adopted. However, a RAG system can involve multiple flexible components, and there is a lack of best practices regarding the optimal RAG setting for various medical purposes. To systematically evaluate such systems, we propose the Medical Information Retrieval-Augmented Generation Evaluation (MIRAGE), a first-of-its-kind benchmark including 7,663 questions from five medical QA datasets. Using MIRAGE, we conducted large-scale experiments with over 1.8 trillion prompt tokens on 41 combinations of different corpora, retrievers, and backbone LLMs through the MedRAG toolkit introduced in this work. Overall, MedRAG improves the accuracy of six different LLMs by up to 18% over chain-of-thought prompting, elevating the performance of GPT-3.5 and Mixtral to GPT-4-level. Our results show that the combination of various medical corpora and retrievers achieves the best performance. In addition, we discovered a log-linear scaling property and the "lost-in-the-middle" effects in medical RAG. We believe our comprehensive evaluations can serve as practical guidelines for implementing RAG systems for medicine.
翻译:尽管大型语言模型(LLMs)在广泛的医学问答任务中已取得最先进性能,但仍面临幻觉和知识过时等挑战。检索增强生成(RAG)是一种有前景且已被广泛采用的解决方案。然而,RAG系统可能包含多个灵活组件,且目前缺乏针对不同医学用途最优RAG设置的最佳实践。为系统评估此类系统,我们提出了医学信息检索增强生成评估基准(MIRAGE),这是首个包含来自五个医学问答数据集共7,663个问题的基准测试。利用MIRAGE,我们通过本文引入的MedRAG工具包,在41种语料库、检索器和骨干LLMs的不同组合上,进行了超过1.8万亿个提示词元的大规模实验。总体而言,MedRAG将六种不同LLMs的准确率相较于思维链提示提升了高达18%,使GPT-3.5和Mixtral的性能达到GPT-4级别。我们的结果表明,多种医学语料库与检索器的组合实现了最佳性能。此外,我们发现了医学RAG中的对数线性缩放特性及"中间丢失"效应。我们相信,本项全面评估可为医学领域RAG系统的实现提供实用指南。