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

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 (<u>Flex</u>ible Context Adaptation for <u>RAG</u>). 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).

Authors

Institutions

Publication Details

Published
2025-02-26
DOI
https://doi.org/10.1145/3701551.3703580
Citations
3
Primary Topic
Multimodal Machine Learning Applications
Type
article
Field-Weighted Citation Impact
3.83
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Senzhang Wang, Chaozhuo Li, Shitao Xiao, Ninglu Shao et al.
3 citations
Multimodal Machine Learning Applications
3.83
article

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

Senzhang Wang, Chaozhuo Li, Shitao Xiao, Ninglu Shao, Defu Lian, Chen Zhang, Zheng Liu, Chenyuan Wu
article en
3 citations

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 (<u>Flex</u>ible Context Adaptation for <u>RAG</u>). 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).

University of Science and Technology of China (CN), Central South University (CN), Beijing University of Posts and Telecommunications (CN), Hong Kong Polytechnic University (HK), Beijing Academy of Artificial Intelligence (CN), Renmin University of China (CN)
Openalex Percentile: Top 8%
Multimodal Machine Learning Applications
3.83
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.