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.
Finch: Prompt-guided key-value cache compression
EMNLP 2024, Conference on Empirical Methods in Natural Language Processing, 12-16 November 2024, Miami, Florida, USA / Also in TACL (Transactions of the Association for Computational Linguistics), Vol.12, 2024
Type:
Journal
City:
Miami
Date:
2024-11-12
Department:
Data Science
Eurecom Ref:
7968
Copyright:
Copyright ACL. Personal use of this material is permitted. The definitive version of this paper was published in EMNLP 2024, Conference on Empirical Methods in Natural Language Processing, 12-16 November 2024, Miami, Florida, USA / Also in TACL (Transactions of the Association for Computational Linguistics), Vol.12, 2024 and is available at : https://doi.org/10.1162/tacl_a_00716
See also:
PERMALINK : https://www.eurecom.fr/publication/7968