SPECTRA: Pushing the KV Cache Beyond the 2-Bit Cliff via Spectral Transform Coding
Jiamu Zhang, Liang Wu, Kelly Wan, Hanjie Chen, Liangjie Hong
cs.LG
Submitted: 2026-08-08
Updated: 2026-08-11
Comments: 28 pages
Code: https://github.com/nokia-applied-research/SPECTRA
License: http://creativecommons.org/licenses/by/4.0/
The gist: Large language models (LLMs) increasingly read long inputs in the agentic era, from whole documents and codebases to conversations across many turns.
Terminology
Abstract
Large language models (LLMs) increasingly read long inputs in the agentic era, from whole documents and codebases to conversations across many turns. Their inference memory is then dominated by the key-value (KV) cache, the stored attention keys and values of every token the model has read and generated. Because the cache grows with context length and is re-read in full at every generated token, a longer context means more GPU memory. To reduce this cost, most existing methods compress the KV cache by lowering every stored value to the same low precision, a technique known as quantization. They can push this to nearly two bits per value, but rarely further, because quality drops sharply at this 2-bit cliff: four levels are too few for the cache's outlier-heavy values, where a few large entries consume the levels and collapse the rest into noise. A natural remedy is to spend more bits on the channels (feature dimensions) that matter and fewer on the rest, but the raw cache offers no handle: its channels are strongly correlated, so none stands out as more important. Our analysis shows that this handle appears once the cache is rotated into a coordinate system computed from its own statistics, removing these correlations. There, a small fraction of channels carries almost all the information, and spending the budget on those few is far more accurate than spreading it evenly. Guided by this analysis, we develop SPECTRA, a training-free, drop-in codec that re-encodes the cache into this coordinate system and concentrates the bit budget on the channels that carry the signal. On Llama-3.1-8B and Qwen2.5-7B over long-context benchmarks, SPECTRA is near-lossless at 4x compression, competitive at 8x where uniform quantization has collapsed, and reaches up to 12x, pushing usable compression past the 2-bit cliff so the same GPU holds longer contexts and larger batches.
Sources
- QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs
- LongBench: A Bilingual, Multitask Benchmark for Long Context Understanding
- Palu: Compressing KV-Cache with Low-Rank Projection
- DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model
- The case for 4-bit precision: k-bit Inference Scaling Laws
- LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale
- The Llama 3 Herd of Models
- PolarQuant: Quantizing KV Caches with Polar Transformation
- RULER: What's the Real Context Size of Your Long-Context Language Models?
- SWE-bench: Can Language Models Resolve Real-World GitHub Issues?
- Efficient Memory Management for Large Language Model Serving with PagedAttention
- SnapKV: LLM Knows What You are Looking for Before Generation
- SpinQuant: LLM quantization with learned rotations
- TransMLA: Multi-Head Latent Attention Is All You Need
- Qwen2.5 Technical Report
- Toolformer: Language Models Can Teach Themselves to Use Tools
- Accurate KV Cache Quantization with Outlier Tokens Tracing
- RotateKV: Accurate and Robust 2-Bit KV Cache Quantization for LLMs via Outlier-Aware Adaptive Rotations
- Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context
- SVD-LLM: Truncation-aware Singular Value Decomposition for Large Language Model Compression
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks