Guardado en:
Detalles Bibliográficos
Autores principales: Chan, Brian J, Chen, Chao-Ting, Cheng, Jui-Hung, Huang, Hen-Hsen
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:https://arxiv.org/abs/2412.15605
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866915166069719040
author Chan, Brian J
Chen, Chao-Ting
Cheng, Jui-Hung
Huang, Hen-Hsen
author_facet Chan, Brian J
Chen, Chao-Ting
Cheng, Jui-Hung
Huang, Hen-Hsen
contents Retrieval-augmented generation (RAG) has gained traction as a powerful approach for enhancing language models by integrating external knowledge sources. However, RAG introduces challenges such as retrieval latency, potential errors in document selection, and increased system complexity. With the advent of large language models (LLMs) featuring significantly extended context windows, this paper proposes an alternative paradigm, cache-augmented generation (CAG) that bypasses real-time retrieval. Our method involves preloading all relevant resources, especially when the documents or knowledge for retrieval are of a limited and manageable size, into the LLM's extended context and caching its runtime parameters. During inference, the model utilizes these preloaded parameters to answer queries without additional retrieval steps. Comparative analyses reveal that CAG eliminates retrieval latency and minimizes retrieval errors while maintaining context relevance. Performance evaluations across multiple benchmarks highlight scenarios where long-context LLMs either outperform or complement traditional RAG pipelines. These findings suggest that, for certain applications, particularly those with a constrained knowledge base, CAG provide a streamlined and efficient alternative to RAG, achieving comparable or superior results with reduced complexity.
format Preprint
id arxiv_https___arxiv_org_abs_2412_15605
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Don't Do RAG: When Cache-Augmented Generation is All You Need for Knowledge Tasks
Chan, Brian J
Chen, Chao-Ting
Cheng, Jui-Hung
Huang, Hen-Hsen
Computation and Language
Retrieval-augmented generation (RAG) has gained traction as a powerful approach for enhancing language models by integrating external knowledge sources. However, RAG introduces challenges such as retrieval latency, potential errors in document selection, and increased system complexity. With the advent of large language models (LLMs) featuring significantly extended context windows, this paper proposes an alternative paradigm, cache-augmented generation (CAG) that bypasses real-time retrieval. Our method involves preloading all relevant resources, especially when the documents or knowledge for retrieval are of a limited and manageable size, into the LLM's extended context and caching its runtime parameters. During inference, the model utilizes these preloaded parameters to answer queries without additional retrieval steps. Comparative analyses reveal that CAG eliminates retrieval latency and minimizes retrieval errors while maintaining context relevance. Performance evaluations across multiple benchmarks highlight scenarios where long-context LLMs either outperform or complement traditional RAG pipelines. These findings suggest that, for certain applications, particularly those with a constrained knowledge base, CAG provide a streamlined and efficient alternative to RAG, achieving comparable or superior results with reduced complexity.
title Don't Do RAG: When Cache-Augmented Generation is All You Need for Knowledge Tasks
topic Computation and Language
url https://arxiv.org/abs/2412.15605