Large Language Models (LLMs) use key-value (KV) cache to reduce redundant computation in autoregressive generation. However, the KV cache size increases linearly during generation, leading to excessive memory usage, especially for long texts. Most KV cache compression methods evict the unimportant KV pairs to maintain a fixed cache size, which leads to the permanent loss of tokens during generation. However, singular value decomposition shows that \textit{values} do not exhibit a strong low-rank property as \textit{keys} do, suggesting that information is distributed more evenly across \textit{values}, in contrast to its more redundant distribution within \textit{keys}. Therefore, methods that evict both \textit{keys} and \textit{values} risk losing crucial information and compromise context integrity, ultimately degrading the output quality. To address this problem, we propose WeightedKV, a novel, training-free approach that discards the \textit{keys} of less important tokens, while merging their \textit{values} into neighboring tokens via a convex combination weighted by their average attention scores. In this way, the retained \textit{keys} serve as anchors that guide the generation process, while the merged \textit{values} provide a rich contextual backdrop. We assess our method on four widely used language modeling datasets, demonstrating superior performance compared to all baseline methods, particularly with a lower budget ratio.
ZSMerge: Zero-Shot KV Cache Compression for Memory-Efficient Long-Context LLMs
Information Hub, The Hong Kong University of Science and Technology (Guangzhou)(香港科学与技术大学信息中心);School of Data Science, The Chinese University of Hong Kong, Shenzhen(香港中文大学(深圳)数据科学学院)
SpindleKV: A Novel KV Cache Reduction Method Balancing Both Shallow and Deep Layers
School of Artificial Intelligence, Wuhan University(武汉大学人工智能学院);School of Computer Science, Wuhan University(武汉大学计算机学院);Xiaomi, Beijing, China(小米(北京,中国));School of Information Management, Wuhan University(武汉大学信息管理学院)
Homogeneous Keys, Heterogeneous Values: Exploiting Local KV Cache Asymmetry for Long-Context LLMs
MoE Key Laboratory of Interdisciplinary Research of Computation and Economics(交叉计算与经济学 interdisciplinary 研究联合实验室);Shanghai University of Finance and Economics(上海财经大学)
KVSlimmer: Theoretical Insights and Practical Optimizations for Asymmetric KV Merging
School of Information and Communication Engineering, Hainan University, Haikou, China(信息与通信工程学院,海南大学,海口,中国);School of Cyberspace Security, Hainan University, Haikou, China(网络安全学院,海南大学,海口,中国);MAC Lab, Department of Artificial Intelligence, School of Informatics, Xiamen University, Xiamen, China(人工智能系信息学院MAC实验室,厦门大学,厦门,中国);School of Computer Science and Technology, Hainan University, Haikou, China(计算机科学与技术学院,海南大学,海口,中国)