探测提示KV缓存:何时变得可有可无
Probing the Prompt KV Cache: Where It Becomes Dispensable
AI总结:
通过控制实验发现,提示KV缓存的冗余主要源于聊天模板的形式而非内容,上层缓存可用中性填充模板的KV缓存替代而不损失精度。
摘要:
先前的KV缓存压缩方案经验性地表明,在解码过程中提示缓存部分冗余,丢弃或总结条目几乎不损失精度。我们探究这种冗余何时以及何种形式出现:在哪些层、经过多少解码步骤、以及提示跨度KV缓存可以何种方式被替换而不破坏任务。通过控制拼接干预,扫描层截止点和解码步骤,发现这种冗余关乎形式(聊天模板脚手架)而非内容。将上层提示跨度KV缓存替换为来自聊天模板脚手架(其用户内容为中性填充)的KV缓存,可恢复接近干净的精度,而将相同槽位归零则使精度崩溃。这种分离在Qwen3、Gemma 3和Llama 3系列的多数据集上重复出现。
英文摘要:
Prior KV cache compression schemes empirically demonstrate that the prompt cache can be dropped or summarised during decoding with little accuracy loss, indicating that it is partly redundant. We ask when and what kind of redundancy, i.e., at which layers, after how many decoding steps, and in what form can the prompt span KV cache be replaced without breaking the task. A controlled splice intervention swept over layers and decoding steps shows this redundancy is about form rather than content. Replacing the upper layer prompt span KV cache with KV cache from a chat template scaffold with empty user content or filler tokens recovers near clean accuracy, while zeroing the entire prompt KV collapses accuracy. The dissociation replicates across the Qwen3, Gemma 3, and Llama 3 model families of varying sizes on multiple datasets. A serving implementation of this technique reduces KV memory by $15.4\%$, supports $18\%$ more HBM-constrained concurrent requests, and improves throughput by $13$-$21\%$.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。