Finch: 프롬프트 기반 키-값 캐시 압축
Finch: Prompt-guided Key-Value Cache Compression
July 31, 2024
저자: Giulio Corallo, Paolo Papotti
cs.AI
초록
최근 검색 강화 생성(Retrieval-Augmented Generation) 및 챗봇과 같은 대형 언어 모델 애플리케이션의 등장으로 더 긴 입력 컨텍스트를 처리해야 할 필요성이 증가하고 있습니다. 그러나 이러한 요구 사항은 본질적인 한계로 인해 방해를 받고 있습니다. 구조적으로, 모델은 훈련 중에 정의된 컨텍스트 윈도우에 의해 제약을 받습니다. 또한, 방대한 텍스트를 처리하려면 상당한 양의 GPU 메모리가 필요합니다. 우리는 이러한 문제를 해결하기 위해 사전 훈련된 self-attention 모델 가중치를 활용하여 입력 컨텍스트를 압축하는 새로운 접근 방식인 Finch를 제안합니다. 주어진 프롬프트와 긴 텍스트에 대해, Finch는 프롬프트를 조건으로 하여 텍스트의 청크들 중에서 가장 관련성이 높은 키(Key, K)와 값(Value, V) 쌍을 반복적으로 식별합니다. 이러한 쌍들만이 KV 캐시에 저장되며, 이는 컨텍스트 윈도우에 의해 제한된 공간 내에서 결국 긴 텍스트의 압축된 버전을 포함하게 됩니다. 우리의 제안은 모델이 파인튜닝 없이도 높은 압축률(최대 93배)로 대규모 입력을 소비할 수 있도록 하면서도 의미적 무결성을 유지할 수 있게 합니다.
English
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.Summary
AI-Generated Summary