Skip to main navigation Skip to search Skip to main content

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

  • Chenyuan Wu
  • , Ninglu Shao
  • , Zheng Liu
  • , Shitao Xiao
  • , Chaozhuo Li
  • , Chen Zhang
  • , Senzhang Wang
  • , Defu Lian

Research output: Chapter in book / Conference proceedingConference article published in proceeding or bookAcademic researchpeer-review

Abstract

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. With these designs, FlexRAG achieves superior generation quality while significantly reducing running costs. The experiments across multiple QA datasets validate our approach as a cost-effective and flexible solution for RAG systems (codebase: https://github.com/wcyno23/FlexRAG).

Original languageEnglish
Title of host publicationWSDM 2025 - Proceedings of the 18th ACM International Conference on Web Search and Data Mining
PublisherAssociation for Computing Machinery, Inc
Pages271-280
Number of pages10
ISBN (Electronic)9798400713293
DOIs
Publication statusPublished - 10 Mar 2025
Event18th ACM International Conference on Web Search and Data Mining, WSDM 2025 - Hannover, Germany
Duration: 10 Mar 202514 Mar 2025

Publication series

NameWSDM 2025 - Proceedings of the 18th ACM International Conference on Web Search and Data Mining

Conference

Conference18th ACM International Conference on Web Search and Data Mining, WSDM 2025
Country/TerritoryGermany
CityHannover
Period10/03/2514/03/25

Keywords

  • Large Language Models
  • Retrieval Augmented Generation

ASJC Scopus subject areas

  • Computer Networks and Communications
  • Computer Science Applications
  • Software

Fingerprint

Dive into the research topics of 'Lighter And Better: Towards Flexible Context Adaptation For Retrieval Augmented Generation'. Together they form a unique fingerprint.

Cite this