SparK: Query-Aware Unstructured Sparsity with Recoverable KV Cache Channel Pruning

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Liao, Huanxuan, Xu, Yixing, He, Shizhu, Li, Guanchen, Yin, Xuanwu, Li, Dong, Barsoum, Emad, Zhao, Jun, Liu, Kang
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866912703181750272
author Liao, Huanxuan
Xu, Yixing
He, Shizhu
Li, Guanchen
Yin, Xuanwu
Li, Dong
Barsoum, Emad
Zhao, Jun
Liu, Kang
author_facet Liao, Huanxuan
Xu, Yixing
He, Shizhu
Li, Guanchen
Yin, Xuanwu
Li, Dong
Barsoum, Emad
Zhao, Jun
Liu, Kang
contents Long-context inference in large language models (LLMs) is increasingly constrained by the KV cache bottleneck: memory usage grows linearly with sequence length, while attention computation scales quadratically. Existing approaches address this issue by compressing the KV cache along the temporal axis through strategies such as token eviction or merging to reduce memory and computational overhead. However, these methods often neglect fine-grained importance variations across feature dimensions (i.e., the channel axis), thereby limiting their ability to effectively balance efficiency and model accuracy. In reality, we observe that channel saliency varies dramatically across both queries and positions: certain feature channels carry near-zero information for a given query, while others spike in relevance. To address this oversight, we propose SPARK, a training-free plug-and-play method that applies unstructured sparsity by pruning KV at the channel level, while dynamically restoring the pruned entries during attention score computation. Notably, our approach is orthogonal to existing KV compression and quantization techniques, making it compatible for integration with them to achieve further acceleration. By reducing channel-level redundancy, SPARK enables processing of longer sequences within the same memory budget. For sequences of equal length, SPARK not only preserves or improves model accuracy but also reduces KV cache storage by over 30% compared to eviction-based methods. Furthermore, even with an aggressive pruning ratio of 80%, SPARK maintains performance with less degradation than 5% compared to the baseline eviction method, demonstrating its robustness and effectiveness. Our code will be available at https://github.com/Xnhyacinth/SparK.
format Preprint
id arxiv_https___arxiv_org_abs_2508_15212
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle SparK: Query-Aware Unstructured Sparsity with Recoverable KV Cache Channel Pruning
Liao, Huanxuan
Xu, Yixing
He, Shizhu
Li, Guanchen
Yin, Xuanwu
Li, Dong
Barsoum, Emad
Zhao, Jun
Liu, Kang
Computation and Language
Artificial Intelligence
Machine Learning
Long-context inference in large language models (LLMs) is increasingly constrained by the KV cache bottleneck: memory usage grows linearly with sequence length, while attention computation scales quadratically. Existing approaches address this issue by compressing the KV cache along the temporal axis through strategies such as token eviction or merging to reduce memory and computational overhead. However, these methods often neglect fine-grained importance variations across feature dimensions (i.e., the channel axis), thereby limiting their ability to effectively balance efficiency and model accuracy. In reality, we observe that channel saliency varies dramatically across both queries and positions: certain feature channels carry near-zero information for a given query, while others spike in relevance. To address this oversight, we propose SPARK, a training-free plug-and-play method that applies unstructured sparsity by pruning KV at the channel level, while dynamically restoring the pruned entries during attention score computation. Notably, our approach is orthogonal to existing KV compression and quantization techniques, making it compatible for integration with them to achieve further acceleration. By reducing channel-level redundancy, SPARK enables processing of longer sequences within the same memory budget. For sequences of equal length, SPARK not only preserves or improves model accuracy but also reduces KV cache storage by over 30% compared to eviction-based methods. Furthermore, even with an aggressive pruning ratio of 80%, SPARK maintains performance with less degradation than 5% compared to the baseline eviction method, demonstrating its robustness and effectiveness. Our code will be available at https://github.com/Xnhyacinth/SparK.
title SparK: Query-Aware Unstructured Sparsity with Recoverable KV Cache Channel Pruning
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2508.15212