20260625:很多新内容
This commit is contained in:
45
concepts/keydiff.md
Normal file
45
concepts/keydiff.md
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
title: "KeyDiff"
|
||||
created: 2026-06-18
|
||||
updated: 2026-06-18
|
||||
type: concept
|
||||
tags: ["kv-cache", "attention", "intra-head-eviction"]
|
||||
sources: []
|
||||
---
|
||||
|
||||
# KeyDiff
|
||||
|
||||
## 定义
|
||||
|
||||
KeyDiff (Park et al., 2025) 是一种 [[heuristic-metric]],利用 Key 向量的**几何特征**(相邻位置 Key 向量之间的差分模式)来评估 KV Cache token 的重要性。它是 LU-KV 实验中使用的第二种 intra-head 指标(π_2)。
|
||||
|
||||
## 核心机制
|
||||
|
||||
与传统方法依赖注意力权重不同,KeyDiff 通过分析 Key 向量本身的结构变化来识别关键 token:
|
||||
|
||||
1. 计算相邻位置 Key 向量之间的差异
|
||||
2. Key 向量变化剧烈的 token 位置往往对应语义转折/关键信息点
|
||||
3. 基于差分模式评分,保留高分 token
|
||||
|
||||
## 与 SnapKV 的对比
|
||||
|
||||
| 维度 | SnapKV (π_1) | KeyDiff (π_2) |
|
||||
|------|-------------|--------------|
|
||||
| 评分来源 | 注意力权重 | Key 向量几何 |
|
||||
| 视角 | Query-Key 交互 | Key 内部分布 |
|
||||
| 对注意力模式假设 | 依赖 | 不依赖 |
|
||||
| 与 Oracle 对齐度 | 各 head 不同 | 各 head 不同 |
|
||||
|
||||
LU-KV 实验表明,两种指标在不同 head 中的 [[optimality-gap]] 模式不同——这正是 LU-KV "指标无关"设计的价值:无论选用哪种指标,都能找到最优预算配置。
|
||||
|
||||
## 相关概念
|
||||
|
||||
- [[heuristic-metric]] — KeyDiff 是启发式指标的一种
|
||||
- [[snapkv]] — 常用的注意力权重指标
|
||||
- [[intra-head-eviction]] — KeyDiff 属于头内驱逐方法
|
||||
- [[tang-lukv|LU-KV]] — 可兼容 KeyDiff 作为 intra-head scoring 方法
|
||||
|
||||
## 参考
|
||||
|
||||
- KeyDiff (Park et al., 2025)
|
||||
- [[tang-lukv|LU-KV]] (Tang et al., ICML 2026)
|
||||
Reference in New Issue
Block a user