Finch: Prompt-guided Key-Value Cache Compression

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Corallo, Giulio, Papotti, Paolo
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866909285949112320
author Corallo, Giulio
Papotti, Paolo
author_facet Corallo, Giulio
Papotti, Paolo
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2408_00167
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Finch: Prompt-guided Key-Value Cache Compression
Corallo, Giulio
Papotti, Paolo
Artificial Intelligence
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.
title Finch: Prompt-guided Key-Value Cache Compression
topic Artificial Intelligence
url https://arxiv.org/abs/2408.00167