Files
myWiki/concepts/optimality-gap.md

2.1 KiB
Raw Blame History

title, created, updated, type, tags, sources
title created updated type tags sources
Optimality Gap 2026-06-18 2026-06-18 concept
kv-cache
optimization
evaluation
https://arxiv.org/abs/2602.08585

Optimality Gap

定义

Optimality Gap最优性差距是 LU-KV 论文中提出的概念,指 heuristic-metricoracle-importance 之间的性能差距。它量化了使用次优指标 π(如 SnapKV、KeyDiff来近似 Oracle 指标 π* 所导致的额外驱逐损失。

形式化

LU-KV 将驱逐损失严格分解为两项:

L(M^π) = L(M^*) + Δ(π, π*, b)

其中:

  • L(M^*)Oracle Metric Loss — 即使使用完美指标,压缩率约束下仍不可避免的损失
  • Δ(π, π*, b)Optimality Gap — 指标 π 与 Oracle π* 在预算 b 下的差距

三个组成类别

在给定预算 b 下,启发式指标保留的 token 集合 M^π 可分解为:

  • HitsM^π ∩ M^* — 正确保留的高 Oracle 重要性 token
  • MissesM^* \ M^π — 高 Oracle 重要性但被错误驱逐的 token损失来源
  • False PositivesM^π \ M^* — 低 Oracle 重要性但被错误保留的 token浪费预算

Optimality Gap = Misses 中 Oracle 重要性之和 False Positives 中 Oracle 重要性之和

根本原因

不同 attention head 中,同一个启发式指标(如注意力分数)与 Oracle 重要性的对齐程度不同。高注意力分数的 token 在某些 head 中确实重要,但在另一些 head 中可能只是瞬时噪声。

实践意义

相关概念

参考