The advent of Large Language Models (LLMs) is promising and LLMs have been applied to numerous fields. However, it is not trivial to implement LLMs in the medical field, due to the high standards for precision and accuracy. Currently, the diagnosis of medical ailments must be done by hand, as it is costly to build a sufficiently broad LLM that can diagnose a wide range of diseases. Here, we explore the use of vector databases and embedding models as a means of encoding and classifying text with medical text data without the need to train a new model altogether. We used various LLMs to generate the medical data, then encoded the data with a text embedding model and stored it in a vector database. We hypothesized that higher embedding dimensions coupled with descriptive data in the vector database would lead to better classifications and designed a robustness test to test our hypothesis. By using vector databases and text embedding models to classify a clinician's notes on a patient presenting with a certain ailment, we showed that these tools can be successful at classifying medical text data. We found that a higher embedding dimension did indeed yield better results, however, querying with simple data in the database was optimal for performance. We have shown in this study the applicability of text embedding models and vector databases on a small scale, and our work lays the groundwork for applying these tools on a larger scale.
翻译:大型语言模型(LLM)的出现前景广阔,并已应用于众多领域。然而,由于医学领域对精确性和准确性要求极高,在该领域部署LLM并非易事。目前,医学诊断仍需人工完成,因为构建一个能够诊断广泛疾病的、具备足够广度的LLM成本高昂。本文探索了利用向量数据库和嵌入模型对医学文本数据进行编码和分类的方法,从而无需完全训练新模型。我们使用多种LLM生成医学数据,随后通过文本嵌入模型对数据进行编码并存储于向量数据库中。我们假设更高的嵌入维度结合向量数据库中的描述性数据将带来更好的分类效果,并设计了鲁棒性测试以验证该假设。通过使用向量数据库和文本嵌入模型对临床医生针对特定病症患者的记录进行分类,我们证明了这些工具能够成功处理医学文本数据的分类任务。研究发现,更高的嵌入维度确实能产生更好的结果,但使用数据库中的简单数据进行查询可获得最优性能。本研究在小规模范围内展示了文本嵌入模型与向量数据库的适用性,为这些工具的大规模应用奠定了基础。