ManifoldKV: 通过欧几里得异常检测实现无需训练的KV缓存压缩
ManifoldKV: Training-Free KV Cache Compression via Euclidean Outlier Detection
AI总结:
ManifoldKV通过欧几里得距离实现无需训练的KV缓存压缩,在多键检索和大上下文场景中提升鲁棒性和准确性。
摘要:
长上下文推理受到KV缓存内存的限制,其大小与序列长度成线性增长;因此,KV缓存压缩的关键在于可靠地选择保留哪些先前的token。大多数基于几何的淘汰方法通过将键与全局质心的余弦相似性进行评分,但余弦是尺度不变的,可能丢弃区分语义显著token的幅度信息。我们提出ManifoldKV,一种无需训练的评分器,通过token到键质心的欧几里得距离对token进行排名,捕捉角度和径向的偏差。在RULER基准测试中,ManifoldKV在4K-16K上下文中实现95.7%的准确率,压缩率20%;在两个cosine评分失败的 regime 中,其鲁棒性优于最佳几何基线。首先,在多键检索中,ManifoldKV减少方向碰撞,3键NIAH在50%压缩时达到92.4% vs KeyDiff的77.0% (+15.4 points)。其次,为解决64K上下文中全局质心的稀释和性能崩溃问题,我们引入WindowedManifoldKV,其在25%压缩时准确率恢复到84.3%,比全局L2高49点,比KeyDiff高3.2点。该方法仅需3行代码,可在4种架构上无需调优工作。
英文摘要:
Long-context inference is constrained by KV-cache memory, which grows linearly with sequence length; KV-cache compression therefore hinges on reliably selecting which past tokens to retain. Most geometry-based eviction methods score keys by cosine similarity to a global centroid, but cosine is scale-invariant and can discard magnitude cues that distinguish semantically salient tokens. We propose ManifoldKV, a training-free scorer that ranks tokens by Euclidean distance to the key centroid, capturing both angular and radial deviations. On the RULER benchmark, ManifoldKV achieves 95.7% accuracy at 4K-16K contexts with 20% compression; matching the best geometric baseline while improving robustness in two regimes where cosine scoring fails. First, on multi-key retrieval, ManifoldKV reduces directional collisions, achieving 92.4% vs KeyDiff's 77.0% (+15.4 points) on 3-key NIAH at 50% compression. Second, to address dilution and performance collapse of global centroids at 64K context, we introduce WindowedManifoldKV, which restores accuracy to 84.3% at 25% compression, a 49-point recovery over global L2 and +3.2 points over KeyDiff. The method requires only 3 lines of code and works across 4 architectures without tuning.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。