[论文解读] xRAG: Extreme Context Compression for Retrieval-augmented Generation with One Token
xRAG 提出了一种新颖的检索增强生成框架,通过模态桥梁将密集检索嵌入直接融合到语言模型的表征空间中,将文档上下文压缩为单个标记,从而在六个知识密集型任务中实现平均10%以上的性能提升,同时将FLOPs降低3.53倍,并在多个基准测试中达到与未压缩模型相当的性能,且仅有模态桥梁为可训练组件。
This paper introduces xRAG, an innovative context compression method tailored for retrieval-augmented generation. xRAG reinterprets document embeddings in dense retrieval--traditionally used solely for retrieval--as features from the retrieval modality. By employing a modality fusion methodology, xRAG seamlessly integrates these embeddings into the language model representation space, effectively eliminating the need for their textual counterparts and achieving an extreme compression rate. In xRAG, the only trainable component is the modality bridge, while both the retriever and the language model remain frozen. This design choice allows for the reuse of offline-constructed document embeddings and preserves the plug-and-play nature of retrieval augmentation. Experimental results demonstrate that xRAG achieves an average improvement of over 10% across six knowledge-intensive tasks, adaptable to various language model backbones, ranging from a dense 7B model to an 8x7B Mixture of Experts configuration. xRAG not only significantly outperforms previous context compression methods but also matches the performance of uncompressed models on several datasets, while reducing overall FLOPs by a factor of 3.53. Our work pioneers new directions in retrieval-augmented generation from the perspective of multimodality fusion, and we hope it lays the foundation for future efficient and scalable retrieval-augmented systems
研究动机与目标
- 为解决因完整文档检索导致的推理成本高和上下文长度限制问题,提升检索增强生成(RAG)的效率。
- 通过将密集检索嵌入重新解释为模态输入,探索RAG的新范式,类似于视觉-语言融合的机制。
- 在不牺牲性能的前提下实现极端上下文压缩,从而支持高效、可扩展且即插即用的RAG系统。
- 通过保持检索器和语言模型冻结,仅依赖可训练的模态桥梁,从而保留RAG的即插即用特性。
提出的方法
- xRAG 将密集检索嵌入重新解释为模态信号,将其类比于多模态模型中的视觉特征。
- 引入模态桥梁,将文档嵌入融合到语言模型的隐藏表征空间中,使模型能够在不直接看到原始文本的情况下关注检索信号。
- 该方法消除了提示中对文本形式文档上下文的需求,将所有检索信息压缩为单个 [X] 标记。
- 仅对模态桥梁进行微调;检索器和语言模型保持冻结,从而可复用预计算的嵌入并保持即插即用的兼容性。
- 训练过程结合了指令微调,涵盖多种数据类型——阅读理解、开放域问答和摘要生成——并辅以自蒸馏和语言建模目标。
- 该框架支持多种大型语言模型主干网络,包括参数量为7B的密集模型和8×7B的专家混合(Mixture-of-Experts)模型,且性能提升一致。
![Figure 1 : xRAG enables efficient retrieval augmentation by adding one document token [X] .](https://ar5iv.labs.arxiv.org/html/2405.13792/assets/x1.png)
实验结果
研究问题
- RQ1能否将密集检索嵌入视为模态输入,以实现在RAG中的极端上下文压缩?
- RQ2嵌入与语言模型之间的模态融合如何影响知识密集型任务中的性能与效率?
- RQ3当仅微调模态桥梁时,冻结的大型语言模型和检索器是否仍能保持高性能?
- RQ4哪些训练策略和数据组合能最大化压缩后RAG设置下的鲁棒性与性能?
- RQ5与标准RAG相比,xRAG在文档具有误导性时如何应对检索失败?
主要发现
- xRAG 在六个知识密集型任务(包括NQ、TriviaQA和HotpotQA)中实现了平均超过10%的性能提升。
- 在Mistral-7b模型上,xRAG 达到44.58%的平均得分,对检索失败的鲁棒性达82.3%,在鲁棒性方面优于标准RAG。
- 对于Mixtral-8x7b模型,xRAG 实现51.45%的平均得分,在多个数据集上与未压缩模型性能相当。
- 与标准RAG相比,该方法将总FLOPs降低了3.53倍,显著提升了推理效率。
- 在微调过程中使用自蒸馏比语言建模损失更为关键,能有效提升系统对检索错误的鲁棒性。
- 即使仅在摘要数据上进行训练,xRAG 在问答任务上仍表现出良好的泛化能力,表明性能提升源于上下文利用能力的增强,而非特定任务知识。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。