FlashBack: Efficient Retrieval-Augmented Language Modeling for Fast Inference

Retrieval-Augmented Language Modeling (RALM) by integrating large language models (LLM) with relevant documents from an external corpus is a proven methodology for enabling the LLM to generate information beyond the scope of its pre-training corpus.Previous work by retrieving a set of tokens iteratively with retrieved content prepending to the input poses a high run-time issue, which degrades the inference efficiency of the LLMs because they fail to use the Key-Value (KV) cache efficiently.We propose FLASHBACK, a modular RALM designed to improve the inference efficiency of RALM with the appending context pattern while maintaining decent performance after fine-tuning by Low-Rank Adaption.FLASHBACK appends retrieved documents at the end of the context to efficiently utilize the KV cache.We also introduce the Marking Token as two special prompt tokens for marking the appending context during fine-tuning.Our experiments show that FLASHBACK can improve language modeling performance in the perplexity metric.We proved that the Marking Token is a usable add-on when fine-tuning models on specific context patterns.By bypassing unnecessary recomputation, FLASHBACK achieves fast inference speed with long context input.The inference speed is up to 4 faster than the prepending counterpart on a 7B LLM (Llama 2) in the runtime test.

Authors

Institutions

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.findings-acl.33
Primary Topic
Topic Modeling
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

FlashBack: Efficient Retrieval-Augmented Language Modeling for Fast Inference

Zhijing Wu, Runheng Liu, Zewen Chi, Heyan Huang et al.
Topic Modeling
article

FlashBack: Efficient Retrieval-Augmented Language Modeling for Fast Inference

Zhijing Wu, Runheng Liu, Zewen Chi, Heyan Huang, Xingchen Xiao
article en

Abstract

Retrieval-Augmented Language Modeling (RALM) by integrating large language models (LLM) with relevant documents from an external corpus is a proven methodology for enabling the LLM to generate information beyond the scope of its pre-training corpus.Previous work by retrieving a set of tokens iteratively with retrieved content prepending to the input poses a high run-time issue, which degrades the inference efficiency of the LLMs because they fail to use the Key-Value (KV) cache efficiently.We propose FLASHBACK, a modular RALM designed to improve the inference efficiency of RALM with the appending context pattern while maintaining decent performance after fine-tuning by Low-Rank Adaption.FLASHBACK appends retrieved documents at the end of the context to efficiently utilize the KV cache.We also introduce the Marking Token as two special prompt tokens for marking the appending context during fine-tuning.Our experiments show that FLASHBACK can improve language modeling performance in the perplexity metric.We proved that the Marking Token is a usable add-on when fine-tuning models on specific context patterns.By bypassing unnecessary recomputation, FLASHBACK achieves fast inference speed with long context input.The inference speed is up to 4 faster than the prepending counterpart on a 7B LLM (Llama 2) in the runtime test.

Beijing Institute of Technology (CN)
Quality Education
Openalex Percentile: Top 90%
Topic Modeling
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.

FlashBack: Efficient Retrieval-Augmented Language Modeling for Fast Inference — Zhijing Wu, Runheng Liu, et al. · (2025) | TGRS Research Map | TGRS