arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2611.04137cs.LGcs.CLcs.DC
收藏

LoopKV:面向循环Transformer的感知循环KV缓存压缩技术

LoopKV: Loop-Aware KV Cache Compression for Serving Looped Transformers

Harvard University(哈佛大学);University of California San Diego(加州大学圣迭戈分校);University of Chicago(芝加哥大学)

Tianle Zhou, Yang Zhang, Tianyu Wu, Zhuohan Wang, William Nixon, Juncheng Yang

AI总结:

针对循环Transformer的KV缓存压缩问题,提出LoopKV方法,通过离线规划为各循环层单元分配存储策略,在vLLM中实现后,部署Ouro-1.4B时KV存储减少35%,吞吐量提升1.7-2.2倍且精度接近BF16。

摘要:

循环Transformer对每个token多次应用共享块以提升精度且不增加参数。对于如Ouro这类为每个循环维护单独键值(KV)缓存的模型,缓存内存会限制分摊重复权重读取的批量大小。均匀比特量化和每个循环的固定规则无法根据每个循环中各层的敏感度分配精度。对Ouro的测量显示,量化敏感度在(循环,层)单元间存在差异,且各单元的单独损伤之和近似等于整体输出损伤。共享损伤也因单元而异,通常后续循环更能容忍共享。跳过低注意力值以节省读取会产生在各循环间累积的误差。LoopKV使用一次性离线分析为每个单元选择4比特存储、2比特存储或复用最后一个循环的KV。规划器在预测损伤和存储的预算下最小化读取量。解码期间,每个循环读取每个4比特值的高2位,仅在自身注意力权重需要4比特精度时才获取低比特。vLLM中的单个融合内核执行该规划。在单个RTX PRO 6000上部署Ouro-1.4B时,内存优化的LoopKV-M规划存储的KV比相同融合内核和CUDA图下的均匀4比特量化(KIVI-4)少35%。在延迟服务水平目标下,最大长度为16K token时,其持续吞吐量是KIVI-4的1.7-2.2倍,且在六个公开基准上的所有平均值均未显著低于BF16的水平。

英文摘要:

Looped transformers apply a shared block several times per token to improve accuracy without adding parameters. For models such as Ouro that keep a separate key-value (KV) cache per loop, cache memory limits the batch size that amortizes repeated weight reads. Uniform-bit quantization and fixed rules per loop do not allocate precision according to each layer's sensitivity in each loop. Measurements on Ouro show that quantization sensitivity varies across (loop, layer) cells, and the sum of individual cell damages approximates the overall output damage. Sharing damage also varies by cell, with later loops generally tolerating sharing better. Skipping low-attention values to save reads produces errors that compound across loops. LoopKV uses a one-time offline profile to choose 4-bit storage, 2-bit storage or reuse of the final loop's KV for each cell. The planner minimizes reads under budgets for predicted damage and storage. During decoding, each loop reads the high 2 bits of each 4-bit value and fetches the low bits only where its own attention weights require 4-bit precision. A single fused kernel in vLLM executes the plan. Serving Ouro-1.4B on one RTX PRO 6000, the memory-optimized LoopKV-M plan stores 35% less KV than uniform 4-bit quantization (KIVI-4) on the same fused kernel and CUDA graph. It sustains 1.7-2.2x KIVI-4's goodput under a latency service-level objective with a 16K-token maximum length. None of its averages on six public benchmarks falls significantly below BF16's.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑