SWAN: Sparse Winnowed Attention for Reduced Inference Memory via Decompression-Free KV-Cache Compression
Santhosh G S, Saurav Prakash, Balaraman Ravindran
TL;DR
SWAN addresses the KV-cache memory bottleneck in autoregressive LLMs by introducing a decompression-free framework that rotates and prunes KV vectors in an offline learned subspace and then uses the sparse cache directly during attention. The method combines an offline SVD-derived projection per layer with a runtime absorption for V and O, while keeping QK projections RoPE-aware and applied at decode time, balanced by a dense 128-token buffer. The approach achieves 50-60% per-token memory savings with robust performance across reasoning and long-context benchmarks, and introduces a tunable compression parameter that allows dynamic memory-accuracy trade-offs. The key theoretical insight is a break-even point for computational savings given by $L > \frac{d_h^2}{d_h - k_{active}} + b$, guiding deployment for long sequences, with practical validation across Llama-3.1 and OLMoE architectures.
Abstract
Large Language Models (LLMs) face a significant bottleneck during autoregressive inference due to the massive memory footprint of the Key-Value (KV) cache. Existing compression techniques like token eviction, quantization, or other low-rank methods often risk information loss, have fixed limits, or introduce significant computational overhead from explicit decompression steps. In this work, we introduce SWAN, a novel, fine-tuning-free framework that eliminates this overhead. Our method uses an offline orthogonal matrix to rotate and prune the KV-cache, which is then used directly in the attention computation without any reconstruction. Our extensive experiments demonstrate that SWAN, augmented with a small dense buffer, offers a robust trade-off, maintaining performance close to the uncompressed baseline even at aggressive 50-60% memory savings per-token on KV-cache. A key advantage is its runtime-tunable compression level, allowing operators to dynamically adjust the memory footprint, a flexibility absent in methods requiring fixed offline configurations. This combination of a decompression-free design, high performance under compression, and adaptability makes SWAN a practical and efficient solution for serving LLMs with long contexts.
