FINCH: Prompt-guided Key-Value Cache Compression for Large Language Models

Giulio Corallo, Paolo Papotti


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.
Anthology ID:
2024.tacl-1.83
Volume:
Transactions of the Association for Computational Linguistics, Volume 12
Month:
Year:
2024
Address:
Cambridge, MA
Venue:
TACL
SIG:
Publisher:
MIT Press
Note:
Pages:
1517–1532
Language:
URL:
https://aclanthology.org/2024.tacl-1.83/
DOI:
10.1162/tacl_a_00716
Bibkey:
Cite (ACL):
Giulio Corallo and Paolo Papotti. 2024. FINCH: Prompt-guided Key-Value Cache Compression for Large Language Models. Transactions of the Association for Computational Linguistics, 12:1517–1532.
Cite (Informal):
FINCH: Prompt-guided Key-Value Cache Compression for Large Language Models (Corallo & Papotti, TACL 2024)
Copy Citation:
PDF:
https://aclanthology.org/2024.tacl-1.83.pdf