arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.07483cs.AIcs.CL
收藏

T-RAG:来自LLM实战的经验教训

T-RAG: Lessons from the LLM Trenches

Qatar Computing Research Institute(卡塔尔计算研究所);Hamad Bin Khalifa University(哈马德·本·哈利法大学)

Masoomali Fatehkia, Ji Kim Lucas, Sanjay Chawla

AI总结:

本文提出T-RAG系统,将RAG与微调开源LLM结合,并利用树结构表示组织实体层级以增强上下文,在私有文档问答中优于简单RAG或微调方法。

摘要:

大型语言模型(LLM)已展现出卓越的语言能力,推动着人们将其集成到广泛领域的各类应用中。一个重要的应用领域是针对私有企业文档的问答,其主要考量包括数据安全(这要求应用能够本地部署)、有限的计算资源,以及需要一个能够正确响应查询的稳健应用。检索增强生成(RAG)已成为构建基于LLM应用的最突出框架。虽然构建一个RAG相对直接,但使其成为一个稳健可靠的应用需要大量定制化工作以及对应用领域相对深入的了解。我们分享了构建和部署一个面向私有组织文档问答的LLM应用的经验。我们的应用将RAG与一个经过微调的开源LLM结合使用。此外,我们的系统——我们称之为Tree-RAG(T-RAG)——使用树结构来表示组织内部的实体层级。该结构用于生成文本描述,以便在响应用户针对组织层级内实体的查询时增强上下文。我们的评估(包括一项“大海捞针”测试)表明,这种组合比简单的RAG或微调实现表现更好。最后,我们分享了一些基于构建面向实际使用的LLM应用的经验教训。

英文摘要:

Large Language Models (LLM) have shown remarkable language capabilities fueling attempts to integrate them into applications across a wide range of domains. An important application area is question answering over private enterprise documents where the main considerations are data security, which necessitates applications that can be deployed on-prem, limited computational resources and the need for a robust application that correctly responds to queries. Retrieval-Augmented Generation (RAG) has emerged as the most prominent framework for building LLM-based applications. While building a RAG is relatively straightforward, making it robust and a reliable application requires extensive customization and relatively deep knowledge of the application domain. We share our experiences building and deploying an LLM application for question answering over private organizational documents. Our application combines the use of RAG with a finetuned open-source LLM. Additionally, our system, which we call Tree-RAG (T-RAG), uses a tree structure to represent entity hierarchies within the organization. This is used to generate a textual description to augment the context when responding to user queries pertaining to entities within the organization's hierarchy. Our evaluations, including a Needle in a Haystack test, show that this combination performs better than a simple RAG or finetuning implementation. Finally, we share some lessons learned based on our experiences building an LLM application for real-world use.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑