Despite the impressive capabilities of large language models (LLMs) across diverse applications, they still suffer from trustworthiness issues, such as hallucinations and misalignments. Retrieval-augmented language models (RAG) have been proposed to enhance the credibility of generations by grounding external knowledge, but the theoretical understandings of their generation risks remains unexplored. In this paper, we answer: 1) whether RAG can indeed lead to low generation risks, 2) how to provide provable guarantees on the generation risks of RAG and vanilla LLMs, and 3) what sufficient conditions enable RAG models to reduce generation risks. We propose C-RAG, the first framework to certify generation risks for RAG models. Specifically, we provide conformal risk analysis for RAG models and certify an upper confidence bound of generation risks, which we refer to as conformal generation risk. We also provide theoretical guarantees on conformal generation risks for general bounded risk functions under test distribution shifts. We prove that RAG achieves a lower conformal generation risk than that of a single LLM when the quality of the retrieval model and transformer is non-trivial. Our intensive empirical results demonstrate the soundness and tightness of our conformal generation risk guarantees across four widely-used NLP datasets on four state-of-the-art retrieval models.
翻译:尽管大型语言模型(LLM)在多样化应用中展现出卓越能力,但其仍存在可信度问题,例如幻觉与错位。检索增强语言模型(RAG)通过引入外部知识来增强生成内容的可信度,然而其生成风险的理论理解尚未得到探索。本文旨在回答三个问题:1)RAG是否确实能降低生成风险;2)如何为RAG及原始LLM的生成风险提供可证明的保证;3)哪些充分条件能使RAG模型降低生成风险。我们提出首个用于认证RAG模型生成风险的框架C-RAG。具体而言,我们为RAG模型提供符合性风险分析,并认证生成风险的上置信界,即符合性生成风险。同时,我们在测试分布偏移条件下为一般有界风险函数提供符合性生成风险的理论保证。我们证明,当检索模型与transformer的质量达到一定阈值时,RAG能实现比单一LLM更低的符合性生成风险。我们在四个广泛使用的NLP数据集上,基于四种前沿检索模型开展的密集实验表明,我们的符合性生成风险保证具有严密性与紧致性。