arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2407.01403cs.IRcs.AIcs.CLcs.LG
收藏

利用离群点检测优化检索增强生成上下文

Optimization of Retrieval-Augmented Generation Context with Outlier Detection

NextAI Systems LLC(NextAI系统有限责任公司)

Vitaly Bulgakov

AI总结:

针对 RAG 检索文档引入无关上下文并诱发幻觉的问题,本文提出基于嵌入向量到质心和查询距离的离群点检测方法,以筛选高相关文档,并在 GPT-4o 真值评估中验证其效果。

摘要:

本文聚焦于减小问答系统所需提示上下文规模并提升其质量的方法。试图通过增加检索到的分块文档数量来扩大与查询相关的上下文,可能显著增加处理复杂度,并降低 Large Language Model(LLM,大语言模型)在生成查询响应时的性能。众所周知,为响应查询而从数据库检索到的大量文档可能包含无关信息,这往往会导致最终答案出现幻觉。我们的目标是选择语义最相关的文档,并将被舍弃的文档视为离群点。我们提出并评估了多种识别离群点的方法,其通过构造特征来利用从向量数据库检索得到的嵌入向量到质心向量和查询向量的距离。实验通过比较检索增强后 LLM 响应与使用 OpenAI GPT-4o 模型获得的真实答案之间的相似度来评估这些方法。结果发现,随着问题和答案复杂度的增加,所取得的改进最为显著。

英文摘要:

In this paper, we focus on methods to reduce the size and improve the quality of the prompt context required for question-answering systems. Attempts to increase the number of retrieved chunked documents and thereby enlarge the context related to the query can significantly complicate the processing and decrease the performance of a Large Language Model (LLM) when generating responses to queries. It is well known that a large set of documents retrieved from a database in response to a query may contain irrelevant information, which often leads to hallucinations in the resulting answers. Our goal is to select the most semantically relevant documents, treating the discarded ones as outliers. We propose and evaluate several methods for identifying outliers by creating features that utilize the distances of embedding vectors, retrieved from the vector database, to both the centroid and the query vectors. The methods were evaluated by comparing the similarities of the retrieved LLM responses to ground-truth answers obtained using the OpenAI GPT-4o model. It was found that the greatest improvements were achieved with increasing complexity of the questions and answers.

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

↑