arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.24786cs.LGcs.AI
收藏

CONF-KV:面向长序列LLM的置信度感知KV缓存淘汰与混合精度存储

CONF-KV: Confidence-Aware KV Cache Eviction with Mixed-Precision Storage for Long-Horizon LLM

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

Yubo Li, Yidi Miao

AI总结:

提出CONF-KV方法,利用模型当前不确定性(置信度)动态调整KV缓存预算,结合混合精度存储和分块在线softmax注意力,在长序列推理中显著降低显存占用并保持高精度。

摘要:

长序列LLM推理使键值(KV)缓存成为GPU内存的主要消耗者,并使每个token的注意力计算越来越昂贵。许多常见的淘汰策略使用静态的最近窗口或历史注意力,忽略了每个解码步骤中计算出的一个信号:模型当前的不确定性。我们引入CONF-KV,一个KV缓存管理器,它将下一个token分布转换为标量置信度分数,并用它来选择每步缓存预算,在模型不确定时保留更多上下文,在模型确定时积极剪枝。在每个预算内,token根据累积注意力质量和最近性的组合进行排序,同时一个受保护的最近窗口保持局部连贯性。我们将该策略与分块在线softmax注意力、混合FP16/INT8存储以及金字塔式逐层预算变体相结合。在四个模型家族和生成长度高达4K的情况下,CONF-KV的显存占用接近固定的512 token滑动窗口,同时与完整KV相比,困惑度差异保持在1.5-2.1点以内。在长达32K token的“大海捞针”测试中,CONF-KV的检索准确率达到91.4%,而滑动窗口为53.8%,H2O为80.6%;在75个VisualWebArena任务中,它以2.8倍的峰值内存降低保留了完整KV成功率的95.3%。

英文摘要:

Long-horizon LLM inference turns the key--value (KV) cache into the dominant GPU memory consumer and makes per-token attention increasingly expensive. Many common eviction policies use static recency windows or historical attention, leaving unused a signal computed on every decoding step: the model's current uncertainty. We introduce CONF-KV, a KV-cache manager that converts the next-token distribution into a scalar confidence score and uses it to choose the per-step cache budget, retaining more context when the model is uncertain and pruning aggressively when it is confident. Within each budget, tokens are ranked by a composite of accumulated attention mass and recency, while a protected recent window preserves local coherence. We combine the policy with blockwise online-softmax attention, mixed FP16/INT8 storage, and a pyramidal per-layer budget variant. Across four model families and generated lengths up to 4K, CONF-KV stays near the footprint of a fixed 512-token sliding window while remaining within 1.5--2.1 perplexity points of full KV. On Needle-in-a-Haystack up to 32K tokens, CONF-KV reaches 91.4% retrieval accuracy versus 53.8% for sliding windows and 80.6% for H2O; on 75 VisualWebArena tasks it retains 95.3% of full-KV success at 2.8 times lower peak memory.

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

↑