LoopVQ:面向循环Transformer的亚1比特KV缓存量化
研究论文 · 2026/11/05
循环Transformer通过多次复用相同层来减少参数内存,但每个循环步骤都存储自己的键值,导致KV缓存随循环步数线性增长,成为主要内存瓶颈。观察到循环模型KV缓存沿循环轴高度冗余且不同循环步对量化敏感度差异大,提出LoopVQ——一种联合编码多个循环步通道并微调码本以匹配全精度模型输出的KV缓存向量量化方法。在0.5比特/元素下,LoopVQ在通用、长思维链推理和长上下文检索任务上优于现有标准LLM的KV缓存向量量化方法(使用Ouro和Huginn模型)。其设计与这些方法正交,与TaSQ结合时在0.25比特/元素下仍保留大部分BF16精度。在SGLang中实现后,32K上下文下解码延迟几乎减半,1.4B和2.6B Ouro模型相比BF16基线峰值服务吞吐分别提升高达4.3倍和6.1倍。
该文章针对循环Transformer中KV缓存随循环步数线性增长的关键内存瓶颈,提出了一种新颖的向量量化方法LoopVQ,在极低比特(0.5甚至0.25比特/元素)下保持高精度,并在实际推理框架中显著提升吞吐、降低延迟,对高效部署大语言模型具有重要价值。
Looped transformers are a parameter-efficient alternative to standard transformers for language modeling. By reapplying the same layers across multiple loop steps, recent looped language models match the performance of non-looped models several times their size. While this architecture effectively reduces parameter memory, each loop step still stores its own keys and values, so the key-value (KV) cache grows linearly with the number of loop steps and becomes the main memory bottleneck. We observe that the KV cache of looped models is highly redundant along the loop axis and that the loop steps differ substantially in their sensitivity to quantization. Based on these observations, we propose LoopVQ, a KV cache vector quantization method for looped transformers that codes channels of multiple loop steps jointly, and fine-tunes the codebooks to match the output of the full-precision model. At 0.5 bits per element, LoopVQ outperforms existing KV cache vector quantization methods for standard LLMs on general, long chain-of-thought reasoning, and long-context retrieval tasks with Ouro and Huginn models. Its design is orthogonal to these methods, and combined with TaSQ, it retains much of the BF16 accuracy even at 0.25 bits per element. We also implement LoopVQ in SGLang, where it nearly halves the decode latency at a 32K-token context and raises the peak serving throughput by up to 4.3times and 6.1times on the 1.4B and 2.6B Ouro models compared to the BF16 baseline.