Retrieval Augmented Generation or Long-Context LLMs? A Comprehensive Study and Hybrid Approach

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Li, Zhuowan, Li, Cheng, Zhang, Mingyang, Mei, Qiaozhu, Bendersky, Michael
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866929548055019520
author Li, Zhuowan
Li, Cheng
Zhang, Mingyang
Mei, Qiaozhu
Bendersky, Michael
author_facet Li, Zhuowan
Li, Cheng
Zhang, Mingyang
Mei, Qiaozhu
Bendersky, Michael
contents Retrieval Augmented Generation (RAG) has been a powerful tool for Large Language Models (LLMs) to efficiently process overly lengthy contexts. However, recent LLMs like Gemini-1.5 and GPT-4 show exceptional capabilities to understand long contexts directly. We conduct a comprehensive comparison between RAG and long-context (LC) LLMs, aiming to leverage the strengths of both. We benchmark RAG and LC across various public datasets using three latest LLMs. Results reveal that when resourced sufficiently, LC consistently outperforms RAG in terms of average performance. However, RAG's significantly lower cost remains a distinct advantage. Based on this observation, we propose Self-Route, a simple yet effective method that routes queries to RAG or LC based on model self-reflection. Self-Route significantly reduces the computation cost while maintaining a comparable performance to LC. Our findings provide a guideline for long-context applications of LLMs using RAG and LC.
format Preprint
id arxiv_https___arxiv_org_abs_2407_16833
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Retrieval Augmented Generation or Long-Context LLMs? A Comprehensive Study and Hybrid Approach
Li, Zhuowan
Li, Cheng
Zhang, Mingyang
Mei, Qiaozhu
Bendersky, Michael
Computation and Language
Artificial Intelligence
Machine Learning
Retrieval Augmented Generation (RAG) has been a powerful tool for Large Language Models (LLMs) to efficiently process overly lengthy contexts. However, recent LLMs like Gemini-1.5 and GPT-4 show exceptional capabilities to understand long contexts directly. We conduct a comprehensive comparison between RAG and long-context (LC) LLMs, aiming to leverage the strengths of both. We benchmark RAG and LC across various public datasets using three latest LLMs. Results reveal that when resourced sufficiently, LC consistently outperforms RAG in terms of average performance. However, RAG's significantly lower cost remains a distinct advantage. Based on this observation, we propose Self-Route, a simple yet effective method that routes queries to RAG or LC based on model self-reflection. Self-Route significantly reduces the computation cost while maintaining a comparable performance to LC. Our findings provide a guideline for long-context applications of LLMs using RAG and LC.
title Retrieval Augmented Generation or Long-Context LLMs? A Comprehensive Study and Hybrid Approach
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2407.16833