用奇异值分解实现1.25比特低精度压缩,让大模型推理更快更省显存。
SVDq: 1.25-bit and 410x Key Cache Compression for LLM Attention
- 先用SVD将键缓存转为潜空间通道,再按重要性分层量化
- 实测在长文本任务中可压缩410倍,仅需1.25比特仍保持高精度
- 适合追求极致推理效率的部署场景,尤其长序列生成任务
为提升大语言模型(LLM)的推理效率,键值(KV)缓存压缩至关重要。现有技术主要分为稀疏性、通道压缩和量化三类。本文提出SVDq,一种基于奇异值分解(SVD)的混合精度量化方法,用于键缓存压缩。首先通过SVD基表示将键缓存转换为潜通道;由于潜通道值衰减迅速,仅前几项具有显著意义,因此对这些通道实施重要性感知的量化与压缩,实现高精度资源向关键通道倾斜分配。理论上,SVDq的量化误差可低至原通道量化方式的0.1倍甚至更低。基于RULER和LongBench基准测试结果表明,SVDq可实现最低1.25比特的等效键缓存精度;结合键稀疏性后,键缓存压缩比最高可达410倍,同时保持与原模型相当的性能。特别地,在LongBench数据集上几乎无损,证明其可在极低比特下实现高精度压缩,为LLM的键缓存压缩提供了更高效解决方案。
原文摘要 · Abstract (English)
For the efficient inference of Large Language Models (LLMs), the effective compression of key-value (KV) cache is essential. Three main types of KV cache compression techniques, namely sparsity, channel compression, and quantization, have been identified. This study presents SVDq, a Singular Value Decomposition (SVD) - based mixed precision quantization method for K cache. Initially, K cache is transformed into latent channels using SVD basis representations. Since the values in latent channels decay rapidly and become negligible after only a few latent channels, our method then incorporates importance-aware quantization and compression for latent channels. This enables the effective allocation of higher precision to more significant channels. Theoretically, we prove that SVDq results in quantization errors (x0.1 or even lower) that are much lower than those of per-channel key quantization in the original space. Our findings based on RULER and LongBench benchmarks demonstrate that SVDq can achieve an equivalent key cache precision as low as 1.25-bit. When combined with key sparsity, it can reach a key compression ratio of up to 410x for attention computation, all while maintaining comparable model performance. Notably, our method is nearly lossless for LongBench datasets. This indicates that SVDq enables high-precision low-bit quantization, providing a more efficient solution for KV cache compression in LLMs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。