周期性弱点:分块KV缓存压缩的相位敏感性
研究论文 · 2026/10/01
分块KV缓存压缩通过以固定步长将连续token窗口压缩为更少的缓存条目,降低了长上下文推理的内存和注意力成本。这种压缩引入了一个新的位置坐标:token的相位,即其相对于压缩窗口边界的位置。我们发现在使用此类压缩的模型中存在一种系统性不对称:相同信息在一个相位可能容易检索,在另一个相位则难以检索。我们将这种检索性能的周期性变化称为相位敏感性。在采用此类压缩的大型开放权重模型中,长上下文检索准确率在不同相位间可相差高达40个百分点,揭示了平均基准分数可能掩盖的周期性弱点。为研究此行为,我们从零开始预训练了一系列transformer,涵盖多种KV压缩设计,在不同变体中复现了相位敏感性。通过因果干预的机制分析,我们揭示了相位特化:不同的注意力组件在不同源相位的信息检索中贡献不对称。我们进一步分析理想化检索模型,表明梯度流动力学可能倾向于形成尖锐的相位特化。因此,评估采用分块KV缓存压缩的模型需要在压缩相位间进行测量:高平均准确率可能与系统性的位置失败共存。
该研究揭示了分块KV缓存压缩中一个此前未被注意的系统性缺陷——相位敏感性,挑战了仅依赖平均基准分数的评估方式,对长上下文模型的设计与评估具有重要启示。
Chunked KV-cache compression reduces the memory and attention costs of long-context inference by compressing windows of consecutive tokens into fewer cache entries at a fixed stride. Such compression also introduces a new positional coordinate: a token's phase, or its position relative to compression-window boundaries. We uncover a systematic asymmetry in models using such compression: the same information can be easy to retrieve at one phase and difficult at another. We call this periodic variation in retrieval performance phase sensitivity. In large open-weight models with such compression, long-context retrieval accuracy can differ by up to 40 percentage points across phases, revealing periodic weak spots that average benchmark scores can conceal. To investigate this behavior, we pretrain a family of transformers from scratch across multiple KV-compression designs, reproducing phase sensitivity across the variants. Mechanistic analysis using causal interventions in these models reveals phase specialization: different attention components contribute asymmetrically to retrieving information at different source phases. We further analyze idealized retrieval models, showing how gradient flow dynamics may favor sharp phase specialization. Evaluating models with chunked KV-cache compression thus requires measuring across compression phases: high average accuracy can coexist with systematic positional failures.