TensorX
返回文献探索

Paper · arXiv 2408.00167

Finch: Prompt-guided Key-Value Cache Compression

Giulio Corallo, Paolo Papotti

17 upvotesJuly 31, 2024arXiv 预印本
AI 摘要

Finch enables large input processing in models by compressing context via pre-trained self-attention weights, maintaining semantic integrity without fine-tuning.

self-attentionKey (K)Value (V)KV cachecontext windowcompression

Abstract

Recent large language model applications, such as Retrieval-Augmented Generation and chatbots, have led to an increased need to process longer input contexts. However, this requirement is hampered by inherent limitations. Architecturally, models are constrained by a context window defined during training. Additionally, processing extensive texts requires substantial GPU memory. We propose a novel approach, Finch, to compress the input context by leveraging the pre-trained model weights of the self-attention. Given a prompt and a long text, Finch iteratively identifies the most relevant Key (K) and Value (V) pairs over chunks of the text conditioned on the prompt. Only such pairs are stored in the KV cache, which, within the space constrained by the context window, ultimately contains a compressed version of the long text. Our proposal enables models to consume large inputs even with high compression (up to 93x) while preserving semantic integrity without the need for fine-tuning.

北京市昌平区探索星信息技术及软件开发工作室

京ICP备2026059466号
Finch: Prompt-guided Key-Value Cache Compression | TensorX