Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

InfiniGen: Efficient Generative Inference of Large Language Models with Dynamic KV Cache Management

About

Transformer-based large language models (LLMs) demonstrate impressive performance across various natural language processing tasks. Serving LLM inference for generating long contents, however, poses a challenge due to the enormous memory footprint of the transient state, known as the key-value (KV) cache, which scales with the sequence length and batch size. In this paper, we present InfiniGen, a novel KV cache management framework tailored for long-text generation, which synergistically works with modern offloading-based inference systems. InfiniGen leverages the key insight that a few important tokens that are essential for computing the subsequent attention layer in the Transformer can be speculated by performing a minimal rehearsal with the inputs of the current layer and part of the query weight and key cache of the subsequent layer. This allows us to prefetch only the essential KV cache entries (without fetching them all), thereby mitigating the fetch overhead from the host memory in offloading-based LLM serving systems. Our evaluation on several representative LLMs shows that InfiniGen improves the overall performance of a modern offloading-based system by up to 3.00x compared to prior KV cache management methods while offering substantially better model accuracy.

Wonbeom Lee, Jungi Lee, Junghwan Seo, Jaewoong Sim• 2024

Related benchmarks

TaskDatasetResultRank
Long-context Language UnderstandingLongBench--
292
Multi-choice Question AnsweringLongBench v2
Overall Accuracy32.31
41
Long-context UnderstandingRULER 32k
Accuracy92.19
26
Long-context UnderstandingRULER 64k
Accuracy89.74
25
Long-form generationLongGenBench
CR76.68
24
Long ReasoningMATH500
Pass@k Rate74
24
Long ReasoningAIME 24
Pass@k76.67
24
Long ReasoningGPQA
Pass@k58
24
Long-context Language UnderstandingRULER 16k context length
Average Score92.78
16
Long-context Language UnderstandingRULER 128k
Accuracy85.26
10
Showing 10 of 11 rows

Other info

Follow for update