TreeKV: Smooth Key-Value Cache Compression with Tree Structures
Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 8086-8094.
https://doi.org/10.24963/ijcai.2025/899
Keywords
- Natural Language Processing: NLP: Language generation
- Machine Learning: ML: Deep learning architectures
- Natural Language Processing: NLP: Language models
Abstract
Efficient key-value (KV) cache compression is critical for scaling transformer-based Large Language Models (LLMs) in long sequences and resource-limited settings. Existing methods evict tokens based on their positions or importance, but position-based strategies can miss crucial information outside predefined regions, while those relying on global importance scores resulting in strong regional biases, limiting the KV cache's overall context retention and potentially impairing the performance of LLMs on complex tasks. Our wavelet analysis reveals that as tokens approach the end of sequence, their contributions to generation gradually increase and tends to diverge more from neighboring tokens, indicating a smooth transition with increasing complexity and variability from distant to nearby context. Motivated by this observation, we propose TreeKV, an intuitive, training-free method that employs a tree structure for smooth cache compression. TreeKV maintains a fixed cache size, allowing LLMs to deliver high-quality output in long text scenarios and is applicable during both the generation and prefilling stages. TreeKV consistently surpasses all baseline models in language modeling tasks on PG19 and OpenWebText2, allowing LLMs trained with short context window to generalize to longer window with a 16x cache reduction. On the Longbench benchmark, TreeKV achieves the best performance with only 6% of the budget at optimal efficiency.
@inproceedings{ijcai2025p899,
title = {TreeKV: Smooth Key-Value Cache Compression with Tree Structures},
author = {He, Ziwei and Yuan, Jian and Bai, Haoli and Leng, Jingwen and Jiang, Bo},
booktitle = {Proceedings of the Thirty-Fourth International Joint Conference on
Artificial Intelligence, {IJCAI-25}},
publisher = {International Joint Conferences on Artificial Intelligence Organization},
editor = {James Kwok},
pages = {8086--8094},
year = {2025},
month = {8},
note = {Main Track},
doi = {10.24963/ijcai.2025/899},
url = {https://doi.org/10.24963/ijcai.2025/899},
}
TY - CPAPER TI - TreeKV: Smooth Key-Value Cache Compression with Tree Structures AU - He, Ziwei AU - Yuan, Jian AU - Bai, Haoli AU - Leng, Jingwen AU - Jiang, Bo T2 - Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence, IJCAI-25 PB - International Joint Conferences on Artificial Intelligence Organization PY - 2025 SP - 8086 EP - 8094 DO - 10.24963/ijcai.2025/899 UR - https://doi.org/10.24963/ijcai.2025/899 ER -Copied
Machine-readable versions of this paper, for tools and AI agents: