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

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Liu, Zheng, Wu, Chenyuan, Shao, Ninglu, Xiao, Shitao, Li, Chaozhuo, Lian, Defu
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866910617994002432
author Liu, Zheng
Wu, Chenyuan
Shao, Ninglu
Xiao, Shitao
Li, Chaozhuo
Lian, Defu
author_facet Liu, Zheng
Wu, Chenyuan
Shao, Ninglu
Xiao, Shitao
Li, Chaozhuo
Lian, Defu
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2409_15699
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Lighter And Better: Towards Flexible Context Adaptation For Retrieval Augmented Generation
Liu, Zheng
Wu, Chenyuan
Shao, Ninglu
Xiao, Shitao
Li, Chaozhuo
Lian, Defu
Computation and Language
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.
title Lighter And Better: Towards Flexible Context Adaptation For Retrieval Augmented Generation
topic Computation and Language
url https://arxiv.org/abs/2409.15699