Abstract
Long text classification is challenging for Large Language Models (LLMs) due to token limits and high computational costs. This study explores whether a Retrieval Augmented Generation (RAG) approach using only the most relevant text segments can match the performance of processing entire clinical notes with large context LLMs. We begin by splitting clinical documents into smaller chunks, converting them into vector embeddings, and storing these in a FAISS index. We then retrieve the top 4,000 words most pertinent to the classification query and feed these consolidated segments into an LLM. We evaluated three LLMs (GPT4o, LLaMA, and Mistral) on a surgical complication identification task. Metrics such as AUC ROC, precision, recall, and F1 showed no statistically significant differences between the RAG based approach and whole-text processing (p > 0.05p > 0.05). These findings indicate that RAG can significantly reduce token usage without sacrificing classification accuracy, providing a scalable and cost effective solution for analyzing lengthy clinical documents.
Abstract (translated)
长文本分类对于大型语言模型(LLMs)来说是一个挑战,原因在于令牌限制和高昂的计算成本。这项研究探讨了一种使用检索增强生成(RAG)方法仅利用最相关的文本片段是否能够与全量临床记录的大上下文LLMs处理相媲美。我们首先将临床文档分割成更小的部分,将其转换为向量嵌入,并存储在FAISS索引中。然后,我们将从索引中检索出4000个最相关词汇的段落,并将其输入到LLM模型进行处理。我们在三种不同的LLMs(GPT-4、LLaMA和Mistral)上对一个外科并发症识别任务进行了评估。在AUC ROC、精确度、召回率以及F1分数等指标下,基于RAG的方法与全量文本处理之间没有统计显著差异(p > 0.05)。这些结果表明,RAG可以在不牺牲分类准确性的情况下大幅减少令牌使用,并提供了一种可扩展且成本效益高的解决方案来分析较长的临床文档。
URL
https://arxiv.org/abs/2505.20320