arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.04287cs.CLcs.AI
收藏

CONFLARE:用于检索的保形大语言模型

CONFLARE: CONFormal LArge language model REtrieval

Mayo Clinic Artificial Intelligence Laboratory, Mayo Clinic(梅奥诊所人工智能实验室,梅奥诊所);Orthopedic Surgery Artificial Intelligence Laboratory, Mayo Clinic(梅奥诊所骨科手术人工智能实验室);Tehran University of Medical Sciences(德黑兰医科大学)

Pouria Rouzrokh, Shahriar Faghani, Cooper U. Gamble, Moein Shariatnia, Bradley J. Erickson

AI总结:

本文提出 CONFLARE 四步保形预测框架,通过校准相似度阈值量化 RAG 检索不确定性,并提供 Python 包实现无需人工干预的高置信答案上下文检索。

摘要:

检索增强生成(RAG)框架使大语言模型(LLM)能够从知识库中检索相关信息,并将其纳入上下文以生成回答。这缓解了幻觉问题,并允许在不重新训练 LLM 的情况下更新知识。然而,如果检索未能识别作为回答生成上下文的必要信息,RAG 并不能保证回答有效。此外,如果存在相互矛盾的内容,RAG 回答很可能只反映两种可能回答中的一种。因此,量化检索过程中的不确定性对于确保 RAG 的可信性至关重要。在本报告中,我们提出了一个四步框架,用于应用保形预测来量化 RAG 框架中的检索不确定性。首先,构建一个可由知识库回答的问题校准集。将每个问题的嵌入与文档嵌入进行比较,以识别包含答案的最相关文档块,并记录其相似度分数。在给定用户指定错误率(α)的情况下,随后分析这些相似度分数以确定相似度分数截断阈值。在推理过程中,检索相似度超过该阈值的所有块,以为 LLM 提供上下文,从而确保以(1-α)置信水平在上下文中捕获真实答案。我们提供了一个 Python 软件包,使用户能够仅使用 LLM 且无需人工干预即可实现本文提出的整个工作流程。

英文摘要:

Retrieval-augmented generation (RAG) frameworks enable large language models (LLMs) to retrieve relevant information from a knowledge base and incorporate it into the context for generating responses. This mitigates hallucinations and allows for the updating of knowledge without retraining the LLM. However, RAG does not guarantee valid responses if retrieval fails to identify the necessary information as the context for response generation. Also, if there is contradictory content, the RAG response will likely reflect only one of the two possible responses. Therefore, quantifying uncertainty in the retrieval process is crucial for ensuring RAG trustworthiness. In this report, we introduce a four-step framework for applying conformal prediction to quantify retrieval uncertainty in RAG frameworks. First, a calibration set of questions answerable from the knowledge base is constructed. Each question's embedding is compared against document embeddings to identify the most relevant document chunks containing the answer and record their similarity scores. Given a user-specified error rate (α), these similarity scores are then analyzed to determine a similarity score cutoff threshold. During inference, all chunks with similarity exceeding this threshold are retrieved to provide context to the LLM, ensuring the true answer is captured in the context with a (1-α) confidence level. We provide a Python package that enables users to implement the entire workflow proposed in our work, only using LLMs and without human intervention.

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

↑