arXiv:2409.15699cs.CL2024-09被引 12

用压缩嵌入提升RAG效率,兼顾成本与回答质量。

Lighter And Better: Towards Flexible Context Adaptation For Retrieval Augmented Generation

  • 检索内容先压缩成小嵌入再输入模型,降低计算开销。
  • 通过优化压缩嵌入提升下游问答表现,效果优于原生LLM。
  • 支持多种压缩比,灵活保留关键信息,适合资源受限场景。

现有检索增强生成(RAG)系统在成本和效果上面临挑战:需对长文本检索上下文编码,带来巨大计算负担;直接使用通用大语言模型常导致答案不佳,而任务微调又会损害模型泛化能力。为此,本文提出FlexRAG(灵活上下文适配的RAG)方法,将检索到的上下文压缩为紧凑嵌入后再交由大模型处理,同时优化这些压缩嵌入以提升下游RAG性能。其核心优势在于灵活性,可支持多种压缩比率,并选择性保留重要信息。在多个问答数据集上的实验证明,FlexRAG在显著降低运行成本的同时,实现了更优的生成质量,是一种高效且灵活的RAG解决方案。

原文摘要 · Abstract (English)

The existing Retrieval-Augmented Generation (RAG) systems face significant challenges in terms of cost and effectiveness. On one hand, they need to encode the lengthy retrieved contexts before responding to the input tasks, which imposes substantial computational overhead. On the other hand, directly using generic Large Language Models (LLMs) often leads to sub-optimal answers, while task-specific fine-tuning may compromise the LLMs' general capabilities. To address these challenges, we introduce a novel approach called FlexRAG (Flexible Context Adaptation for RAG). In this approach, the retrieved contexts are compressed into compact embeddings before being encoded by the LLMs. Simultaneously, these compressed embeddings are optimized to enhance downstream RAG performance. A key feature of FlexRAG is its flexibility, which enables effective support for diverse compression ratios and selective preservation of important contexts. Thanks to these technical designs, FlexRAG achieves superior generation quality while significantly reducing running costs. Comprehensive experiments on various question-answering datasets validate our approach as a cost-effective and flexible solution for RAG systems.

RAG上下文压缩大模型优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。