analiza aiqbench
FlashBack addresses a critical bottleneck in Retrieval-Augmented Language Models (RALM) by optimizing KV cache utilization through context appending rather than prepending, achieving up to four times faster inference speeds on 7B LLMs. This modular approach maintains generation quality while significantly reducing computational costs via Low-Rank Adaption fine-tuning and specialized marking tokens. The research offers a practical pathway for deploying RALM systems in latency-sensitive applications without sacrificing accuracy.
FlashBack: Efficient Retrieval-Augmented Language Modeling for Fast Inference
arXiv:2405.04065v5 Announce Type: replace Abstract: Retrieval-Augmented Language Modeling (RALM) by integrating large language models (LLM) with relevant documents from an external corpus is a proven method for enabling the LLM to generate information beyond the scope of its pre-training corpus. Previous work utilizing retrieved content by simply prepending it to the input poses a high runtime issue, which degrades the inference efficiency of the LLMs because they fail to use the Key-Value (KV) cache efficiently. In this paper, we propose FlashBack, a modular RALM designed to improve the inference efficiency of RALM with appending context pattern while maintaining decent performance after fine-tuning by Low-Rank Adaption. FlashBack appends retrieved documents at the end of the context for efficiently utilizing the KV cache instead of prepending them. And we introduce Marking Token as two special prompt tokens for marking the boundary of the appending context during fine-tuning. Our experiments on testing generation quality show that FlashBack can remain decent generation quality in perplexity. And the inference speed of FlashBack is up to $4\times$ faster than the prepending counterpart on a 7B LLM (Llama 2) in the runtime test. Via bypassing unnecessary re-computation, it demonstrates an advancement by achieving significantly faster inference speed, and this heightened efficiency will substantially reduce inferential cost.
Abstract:Retrieval-Augmented Language Modeling (RALM) by integrating large language models (LLM) with relevant documents from an external corpus is a proven method for enabling the LLM to generate information beyond the scope of its pre-training corpus. Previous work utilizing retrieved content by simply prepending it to the input poses a high runtime issue, which degrades the inference efficiency of the LLMs because they fail to use the Key-Value (KV) cache efficiently. In this paper, we propose FlashBack, a modular RALM designed to improve the inference efficiency of RALM with appending context pattern while maintaining decent performance after fine-tuning by Low-Rank Adaption. FlashBack appends retrieved documents at the end of the context for efficiently utilizing the KV cache instead of prepending them. And we introduce Marking Token as two special prompt tokens for marking the boundary of the appending context during fine-tuning. Our experiments on testing generation quality show that FlashBack can remain decent generation quality in perplexity. And the inference speed of FlashBack is up to $4\times$ faster than the prepending counterpart on a 7B LLM (Llama 2) in the runtime test. Via bypassing unnecessary re-computation, it demonstrates an advancement by achieving significantly faster inference speed, and this heightened efficiency will substantially reduce inferential cost.
Computation and Language (cs.CL)
arXiv:2405.04065 [cs.CL]
(or arXiv:2405.04065v5 [cs.CL] for this version)
https://doi.org/10.48550/arXiv.2405.04065 Focus to learn more arXiv-issued DOI via DataCite
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.
Text integral sub licența deschisă a publicației · 297 cuvinte
Subiecte conexe

Natural language security queries at Orca Security using Amazon Bedrock
AWS · 13 oct. 2026

Mastering Agentic Techniques: AI Agent Customization
NVIDIA · 20 mai 2026
Amazon is investing in the Lean Focused Research Organization
Amazon Science · 26 iul. 2026

Reducing medical claims review time with AI on AWS: The EXL Medical IDP solution
AWS · 21 sept. 2026