arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.15699cs.CL
收藏

更轻且更好:迈向检索增强生成的灵活上下文适配

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

University of Science and Technology of China(中国科学技术大学);Gaoling School of AI, Renmin University of China(中国人民大学高瓴人工智能学院);Beijing Academy of Artificial Intelligence(北京人工智能研究院);Beijing University of Posts and Telecommunications(北京邮电大学)

Zheng Liu, Chenyuan Wu, Ninglu Shao, Shitao Xiao, Chaozhuo Li, Defu Lian

AI总结:

本文提出FlexRAG方法,通过将检索上下文压缩为紧凑嵌入向量并优化其以提升下游性能,在支持多种压缩比和选择性保留重要上下文的同时,显著降低了RAG系统的计算成本并提升了生成质量。

摘要:

现有的检索增强生成(RAG)系统在成本和有效性方面面临重大挑战。一方面,它们需要在响应输入任务之前对冗长的检索上下文进行编码,这带来了大量的计算开销。另一方面,直接使用通用大型语言模型(LLM)通常会导致次优答案,而针对特定任务的微调可能会损害LLM的通用能力。为了应对这些挑战,我们引入了一种名为FlexRAG(面向RAG的灵活上下文适配)的新方法。在该方法中,检索到的上下文在被LLM编码之前,会被压缩为紧凑的嵌入向量。同时,这些压缩嵌入向量经过优化以提升下游RAG性能。FlexRAG的一个关键特征是其灵活性,能够有效支持多种压缩比例并选择性地保留重要上下文。得益于这些技术设计,FlexRAG在显著降低运行成本的同时实现了卓越的生成质量。在各种问答数据集上的全面实验验证了我们的方法是RAG系统的一种高性价比且灵活的解决方案。

英文摘要:

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.

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

↑