Files
myWiki/concepts/prefix-survival-probability.md

30 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Prefix Survival Probability"
created: 2026-06-28
updated: 2026-06-28
type: concept
tags: [speculative-decoding, probability, acceptance-metric]
sources: [DSpark]
---
# Prefix Survival Probability
前缀存活概率是投机解码中衡量草稿前缀被目标模型接受的可能性的核心度量。对于草稿位置 $j$,其前缀存活概率定义为累积条件接受率的乘积:
$$a_{r,j} = \prod_{i \le j} c_{r,i}$$
其中 $c_{r,i} = P(\text{accept}_i | \text{accept}_{1:i-1})$ 是位置 $i$ 的条件存活概率。
## 性质
**单调非增**$a_{r,j} \le a_{r,j-1}$,即越靠后的 token 存活概率越低。这一性质是 [[DSpark]] 的[[hardware-aware-prefix-scheduler|硬件感知前缀调度器Hardware-Aware Prefix Scheduler]]贪心算法正确性的关键保证。
## 在调度中的应用
调度器将每个请求 $r$ 在位置 $j$ 的期望收益直接建模为 $a_{r,j}$——即接纳该 token 所带来的额外期望接受数。全局排序所有 $a_{r,j}$ 后按降序接纳,自然遵守块内前缀依赖(因为 $a_{r,j}$ 的单调性保证 $a_{r,j} \le a_{r,j-1}$)。
## 参考
- [[DSpark]]
- [[confidence-head|置信度头Confidence Head]]
- [[hardware-aware-prefix-scheduler|硬件感知前缀调度器Hardware-Aware Prefix Scheduler]]