SCOPE: Optimizing Key-Value Cache Compression in Long-context Generation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wu, Jialong, Wang, Zhenglin, Zhang, Linhai, Lai, Yilong, He, Yulan, Zhou, Deyu
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909634049081344
author Wu, Jialong
Wang, Zhenglin
Zhang, Linhai
Lai, Yilong
He, Yulan
Zhou, Deyu
author_facet Wu, Jialong
Wang, Zhenglin
Zhang, Linhai
Lai, Yilong
He, Yulan
Zhou, Deyu
contents Key-Value (KV) cache has become a bottleneck of LLMs for long-context generation. Despite the numerous efforts in this area, the optimization for the decoding phase is generally ignored. However, we believe such optimization is crucial, especially for long-output generation tasks based on the following two observations: (i) Excessive compression during the prefill phase, which requires specific full context impairs the comprehension of the reasoning task; (ii) Deviation of heavy hitters occurs in the reasoning tasks with long outputs. Therefore, SCOPE, a simple yet efficient framework that separately performs KV cache optimization during the prefill and decoding phases, is introduced. Specifically, the KV cache during the prefill phase is preserved to maintain the essential information, while a novel strategy based on sliding is proposed to select essential heavy hitters for the decoding phase. Memory usage and memory transfer are further optimized using adaptive and discontinuous strategies. Extensive experiments on LongGenBench show the effectiveness and generalization of SCOPE and its compatibility as a plug-in to other prefill-only KV compression methods.
format Preprint
id arxiv_https___arxiv_org_abs_2412_13649
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle SCOPE: Optimizing Key-Value Cache Compression in Long-context Generation
Wu, Jialong
Wang, Zhenglin
Zhang, Linhai
Lai, Yilong
He, Yulan
Zhou, Deyu
Computation and Language
Key-Value (KV) cache has become a bottleneck of LLMs for long-context generation. Despite the numerous efforts in this area, the optimization for the decoding phase is generally ignored. However, we believe such optimization is crucial, especially for long-output generation tasks based on the following two observations: (i) Excessive compression during the prefill phase, which requires specific full context impairs the comprehension of the reasoning task; (ii) Deviation of heavy hitters occurs in the reasoning tasks with long outputs. Therefore, SCOPE, a simple yet efficient framework that separately performs KV cache optimization during the prefill and decoding phases, is introduced. Specifically, the KV cache during the prefill phase is preserved to maintain the essential information, while a novel strategy based on sliding is proposed to select essential heavy hitters for the decoding phase. Memory usage and memory transfer are further optimized using adaptive and discontinuous strategies. Extensive experiments on LongGenBench show the effectiveness and generalization of SCOPE and its compatibility as a plug-in to other prefill-only KV compression methods.
title SCOPE: Optimizing Key-Value Cache Compression in Long-context Generation
topic Computation and Language
url https://arxiv.org/abs/2412.13649