arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2611.20565cs.LGcs.AI
收藏

使用量化草稿KV缓存的内存高效推测解码

Memory-Efficient Speculative Decoding with Quantized Draft KV Cache

Carnegie Mellon University(卡内基梅隆大学)

Saksham Gupta, Michael Li

AI总结:

本研究针对推测解码的高内存开销问题,提出K4V4量化草稿KV缓存方案,在保证接受率仅小幅下降的同时,大幅降低了缓存内存占用。

摘要:

推测解码可降低生成成本,但它会存储两个KV缓存:一个用于目标模型,一个用于草稿模型。我们通过量化草稿缓存来减少这部分额外内存,目标缓存和验证器保持BF16精度,以确保压缩不会改变目标模型的最终校正规则。我们首先研究如何在键(Key)和值(Value)之间分配精度:简单的逐token量化器使键的敏感度高得多,在12位预算下,K8V4的接受率比K4V8高10.87个百分点;但使用分组的逐通道键后,该差距变为-0.25个百分点。受控的Qwen测试证实,仅更改键量化器即可消除或反转偏好的位分配。因此,我们遵循KIVI方法,提出了采用逐通道键和逐token值的K4V4量化方案。在六组模型对上,我们的方法将草稿缓存内存降低66.20%,两个缓存的总内存降低23.95%,平均接受率从57.93%降至57.14%,仅相对下降1.36%。总体而言,量化草稿缓存可使推测解码更具内存效率;作为高效AI设计的预测原则,键和值的精度必须与量化器布局协同设计。

英文摘要:

Speculative decoding reduces generation cost, but it stores two KV caches: one for the target model and one for the draft model. We reduce this extra memory by quantizing the draft cache. The target cache and verifier remain in BF16, so that compression cannot change the target model's final correction rule. We first study how to divide precision between keys and values. A naive per-token quantizer makes keys appear much more sensitive: splitting a 12-bit budget, K8V4 beats K4V8 in acceptance by 10.87pp. However, with grouped per-channel keys, the gap becomes -0.25pp. A controlled Qwen test confirms that changing only the key quantizer can erase or reverse the preferred bit split. Hence, following KIVI, we propose K4V4 quantization with per-channel keys and per-token values. Across six model pairs, our method reduces draft cache memory by 66.20%, and combined memory across both caches by 23.95%. Mean acceptance drops from 57.93% to 57.14%, only 1.36% relative. Overall, quantized draft caches can make speculative decoding more memory efficient; as a predictive principle for efficient AI design, key and value precision must be co-designed with the quantizer layout.

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

↑