[论文解读] CONFLARE: CONFormal LArge language model REtrieval
CONFLARE 提出了一种基于置信预测的框架,用于量化检索增强生成(RAG)系统中检索过程的不确定性,确保以用户指定的置信水平(1−α)包含正确答案。通过使用校准集确定相似度得分阈值,该方法动态检索所有高于该阈值的相关文本块,从而在不依赖人工标注或微调的前提下,保证真实答案被完整覆盖,同时保持统计可靠性。
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.
研究动机与目标
- 解决 RAG 框架检索阶段缺乏不确定性量化的问题,该问题可能导致遗漏正确答案或引入错误答案。
- 提供一种事后、与框架无关的方法,确保在用户指定的误差率(α)内覆盖真实答案。
- 仅使用大语言模型自动完成整个工作流,无需人工干预,从而提升在医疗和高风险 AI 应用中的可扩展性和可信度。
- 通过确保大语言模型以统计置信度接收所有相关上下文,降低幻觉和矛盾回答的风险。
- 使 RAG 系统能够在医学等关键领域中可靠部署,因为这些领域对基于证据的准确性要求极高。
提出的方法
- 使用大语言模型从知识库中生成已知答案的问题,通过嵌入向量识别相关文档块,构建校准数据集。
- 计算每个问题嵌入与所有文档块嵌入之间的相似度得分,形成检索得分的分布。
- 在校准集上应用置信预测,以用户定义的误差率 α 确定相似度得分的截断阈值,确保真实答案以 (1−α) 的置信度被包含在检索到的上下文中。
- 在推理阶段,检索所有与问题相似度超过计算出的阈值的文档块,从而保证正确答案的覆盖。
- 使用标准 RAG 提示工程将检索到的文档块整合到大语言模型提示中,保持下游生成流程不变。
- 提供一个 Python 包和示例笔记本,仅使用大语言模型实现端到端的全工作流自动化,无需人工标注。
实验结果
研究问题
- RQ1置信预测能否有效应用于量化 RAG 框架检索阶段的不确定性?
- RQ2所提出的方法是否能保证以用户指定的置信水平将真实答案包含在检索到的上下文中?
- RQ3该方法在不同误差率(α)和嵌入模型质量下表现如何?
- RQ4整个工作流能否仅使用大语言模型实现自动化,而无需人工标注或干预?
- RQ5在上下文窗口大小和下游大语言模型推理方面,置信增强检索的实际限制是什么?
主要发现
- 只要校准数据能代表推理查询,置信增强检索方法就能保证以 (1−α) 的置信度将真实答案包含在检索到的上下文中。
- 较低的误差率(如 1%)会导致更保守的检索,召回率更高,但可能超过下游大语言模型的上下文窗口限制。
- 该方法与框架无关,可应用于任何 RAG 流水线,无需修改大语言模型或检索架构。
- 整个工作流(包括问题生成、嵌入计算、阈值校准和检索)均可仅使用大语言模型实现自动化,实现无需人工标注的端到端部署。
- 该方法通过确保大语言模型接收到所有相关信息,降低了幻觉风险,但生成阶段的不确定性仍是独立挑战。
- 若校准数据缺乏代表性、嵌入模型质量差,或检索到的文档块集合超过大语言模型的上下文窗口,该方法的可靠性将受损。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。