自适应压缩检索文档,提升RAG推理效率与准确率。
AdaComp: Extractive Context Compression with Adaptive Predictor for Retrieval-Augmented Large Language Models
- 根据查询复杂度和检索质量动态确定最优文档压缩比例
- 在三个问答数据集上降低推理成本,性能接近未压缩模型
- 适合追求高效推理的RAG系统部署场景
包含噪声的检索文档会干扰RAG系统发现答案线索,并导致推理过程缓慢且成本高昂。因此,上下文压缩对于提升其准确性和效率至关重要。现有方法采用抽取式或生成式模型保留最相关的句子,或基于信息瓶颈理论保留足够信息,但可能面临过度压缩或计算开销大的问题。我们观察到,检索器通常将相关文档排在前列,但回答特定查询所需的文档数量因查询复杂度和检索质量而异:多跳问题等复杂查询需要更多文档,而低质量检索则需依赖更多文档以生成准确结果。因此,确定最少所需文档数(压缩率)仍是RAG的挑战。本文提出AdaComp,一种低成本的抽取式上下文压缩方法,可基于查询复杂度和检索质量自适应地确定压缩率。具体而言,我们首先标注每个查询所需的最小top-k文档作为压缩率,并构建查询-文档-压缩率三元组数据集,用于训练压缩率预测器。在三个问答数据集和一个对话式多文档QA数据集上的实验表明,AdaComp显著降低推理成本,同时保持性能几乎与未压缩模型相当,实现了效率与性能的平衡。
原文摘要 · Abstract (English)
Retrieved documents containing noise will hinder RAG from detecting answer clues and make the inference process slow and expensive. Therefore, context compression is necessary to enhance its accuracy and efficiency. Existing context compression methods use extractive or generative models to retain the most query-relevant sentences or apply the information bottleneck theory to preserve sufficient information. However, these methods may face issues such as over-compression or high computational costs. We observe that the retriever often ranks relevant documents at the top, but the exact number of documents needed to answer the query is uncertain due to the impact of query complexity and retrieval quality: complex queries like multi-hop questions may require retaining more documents than simpler queries, and a low-quality retrieval may need to rely on more documents to generate accurate outputs. Therefore, determining the minimum number of required documents (compression rate) is still a challenge for RAG. In this paper, we introduce AdaComp, a low-cost extractive context compression method that adaptively determines the compression rate based on both query complexity and retrieval quality. Specifically, we first annotate the minimum top-k documents necessary for the RAG system to answer the current query as the compression rate and then construct triplets of the query, retrieved documents, and its compression rate. Then, we use this triplet dataset to train a compression-rate predictor. Experiments on three QA datasets and one conversational Multi-doc QA dataset show that AdaComp significantly reduces inference costs while maintaining performance nearly identical to uncompressed models, achieving a balance between efficiency and performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。