TL;DR: D-Cut 是一种针对 DFlash 的动态剪枝优化算法。通过建立硬件驱动的 cost model,跨请求进行剪枝,减少不必要的验证开销,实现全方面加速。D-Cut is a dynamic pruning optimization for DFlash. By building a hardware-driven cost model and pruning across requests, it eliminates unnecessary verification overhead for end-to-end speedup.
LLM 推理的瓶颈在于自回归——每步只产一个 token,GPU 大部分时间在等显存。Speculative decoding[1] 的思路是"先猜后验":用小模型快速猜多个 token,再让大模型一次验证。The bottleneck of LLM inference is autoregressive decoding — one token per step, with GPU mostly waiting on memory. Speculative decoding[1] breaks this by "draft then verify": a small model quickly drafts multiple tokens, then the large model verifies them in one pass.
加速效果取决于两件事:猜得准不准(接受率)和验证贵不贵(step time)。Speedup depends on two things: draft accuracy (acceptance rate) and verification cost (step time).
DFlash[2] 用 diffusion model 做 draft——跳过逐 token 生成,一次并行出 15 个候选。DFlash[2] uses a diffusion model as the drafter, producing 15 candidates in parallel in one shot.
每步:① Diffusion 并行生成 15 token + 1 bonus($D=16$);② Target 一次 forward 验证;③ 取最长接受前缀。低并发下很高效,但 batch size 上去后问题出现了。Each step: ① Diffusion drafts 15 tokens + 1 bonus ($D=16$) in parallel; ② Target verifies in one forward; ③ Accept the longest correct prefix. Works great at low concurrency, but breaks down at high batch sizes.
Target 每步要验证 $N = \text{bs} \times D$ 个 token。但平均只有 $\mathbb{E}[L] \approx 6.3$ 个会被接受——约 60% 的计算是浪费的。高 bs 时浪费更严重:Target verifies $N = \text{bs} \times D$ tokens per step. But only $\mathbb{E}[L] \approx 6.3$ get accepted — ~60% of computation is wasted. At high bs it gets worse:
| bs | R=25% | R=50% | R=75% | R=100% | 100%/25% |
|---|---|---|---|---|---|
| 4 | 8.2 ms | 8.7 ms | 9.7 ms | 10.9 ms | 1.33× |
| 8 | 10.6 ms | 12.8 ms | 16.3 ms | 19.6 ms | 1.85× |
| 16 | 16.0 ms | 22.7 ms | 29.8 ms | 35.8 ms | 2.24× |
| 32 | 29.8 ms | 43.1 ms | 56.6 ms | 70.1 ms | 2.35× |
| 64 | 55.2 ms | 82.2 ms | 107.9 ms | 133.9 ms | 2.42× |
Qwen3-8B, H20 GPU, TP1.Qwen3-8B, H20 GPU, TP1.
bs=64 时 full verify 比只保留 25% 慢了 2.42 倍。多出来的时间花在了"注定被拒绝"的位置上。At bs=64, full verify is 2.42× slower than keeping only 25%. The extra time is spent on positions that will be rejected anyway.
Qwen3-8B 上,DFlash-B16 从 bs=16 开始就比 AR 更慢。bs=64 时仅有 AR 吞吐的 42%。On Qwen3-8B, DFlash-B16 becomes slower than AR starting at bs=16. At bs=64 it only achieves 42% of AR throughput.
Draft model 给每个 token 一个 confidence 分数。已有工作[3]表明,auto-regressive draft model 的 draft confidence 和最终的接受率呈明显正相关。我们发现,这个性质对于 diffusion-based draft model 也成立。定义 prefix product score:The draft model assigns a confidence score to each token. Prior work[3] has shown that draft confidence of auto-regressive draft models is strongly correlated with final acceptance rate. We find this property also holds for diffusion-based draft models. Define prefix product score:
$$s_{i,k} = \prod_{t=1}^{k-1} c_{i,t}$$$s_{i,k}$ 估计的是"前 $k$ 个位置全部被接受"的概率。以此为依据,在 batch 内跨请求做全局 top-$K$ 分配:$s_{i,k}$ estimates the probability that all first $k$ positions are accepted. Based on this, we allocate verify budget globally across requests via top-$K$:
| 策略Strategy | Verify tokens | Accepted tokens | Accepted / Verify |
|---|---|---|---|
| 每请求固定保留 4 个Fixed 4 per request | 128 | 101.4 | 79.2% |
| Confidence top-25% | 128 | 124.6 | 97.3% |
| 每请求固定保留 8 个Fixed 8 per request | 256 | 152.9 | 59.7% |
| Confidence top-50% | 256 | 190.8 | 74.6% |
| 每请求固定保留 12 个Fixed 12 per request | 384 | 183.0 | 47.7% |
| Confidence top-75% | 384 | 200.9 | 52.3% |
| Full verify(不裁剪)Full verify (no pruning) | 512 | 201.2 | 39.3% |
相同预算下,全局 confidence top-K 比 per-request 均匀截断多接受 20-25% 的 token。只 verify 一半就能保留 full verify 95% 的收益。At the same budget, global confidence top-K accepts 20-25% more tokens than per-request uniform truncation. Verifying only half retains 95% of full-verify acceptance.
关键在于 batch 内跨请求的全局预算分配,而非逐请求独立截断。The key is global budget allocation across the batch, not per-request independent truncation.
不同模型的 verify cost 对 token 数量的敏感度差异巨大:Different models have vastly different sensitivity of verify cost to token count:
| bs | R=25% | R=50% | R=75% | R=100% | 100%/25% |
|---|---|---|---|---|---|
| Qwen3-8B (Dense, H20 TP1) — cost 随 token 近似线性增长Qwen3-8B (Dense, H20 TP1) — cost scales near-linearly with tokens | |||||
| 64 | 55.2 ms | 82.2 ms | 107.9 ms | 133.9 ms | 2.42× |
| Qwen3.5-35B-A3B (MoE, H20 TP2) — cost 增长极其平缓Qwen3.5-35B-A3B (MoE, H20 TP2) — cost barely increases with tokens | |||||
| 64 | 79.9 ms | 85.4 ms | 86.1 ms | 90.6 ms | 1.13× |
Dense 模型的 cost 接近 $O(N)$,裁剪收益大;MoE 的 cost 额外跟激活 expert 数量挂钩,相对变化没有那么激烈,更偏 memory-bound。所以 最优裁剪比例必须根据实际硬件 cost curve 来定。D-Cut 在 server 启动时实测 cost table,用数据而非假设做决策。Dense models have $O(N)$ cost — pruning helps a lot. MoE cost is additionally tied to the number of activated experts, making the relative change less dramatic and more memory-bound. So optimal pruning ratio must be determined by the actual hardware cost curve. D-Cut profiles the cost table at server startup, making decisions from measurements, not assumptions.
Batch 中 $bs$ 个请求,每个有 $D$ 个候选位置。请求 $i$ 的有效产出为 $A_i = \min(L_i, n_i)$($L_i$ 为真实接受长度,$n_i$ 为保留深度)。展开期望:$bs$ requests in a batch, each with $D$ candidate positions. Effective output of request $i$: $A_i = \min(L_i, n_i)$ ($L_i$ = true accept length, $n_i$ = keep depth). Expanding the expectation:
$$\mathbb{E}[\min(L_i, n_i)] = \sum_{k=1}^{n_i} P(L_i \ge k)$$保留第 $k$ 个位置的边际收益就是 $P(L_i \ge k)$。The marginal benefit of keeping position $k$ is $P(L_i \ge k)$.
用 draft confidence 的前缀乘积估计这个概率:Estimate this probability using the prefix product of draft confidences:
$$s_{i,k} = \prod_{t=1}^{k-1} c_{i,t}$$性质:同一请求内单调递减,所以全局 top-K 自动满足前缀约束。Property: monotonically decreasing within each request, so global top-K automatically satisfies prefix constraints.
最大化吞吐 = 单位时间有效产出:Maximize throughput = effective output per unit time:
$$U_q = \frac{\sum_{r=1}^{K_q} s_{(r)}}{C_{\text{graph}}(bs, \rho_q)}$$其中 $K_q = \lceil \rho_q \cdot bs \cdot (D-1) \rceil$。选 $U_q$ 最大的 bucket。where $K_q = \lceil \rho_q \cdot bs \cdot (D-1) \rceil$. Pick the bucket with highest $U_q$.
离线(启动时 ~30s):profiling cost table $C_{\text{graph}}(bs, \rho)$,$\rho \in \{0.25, 0.50, 0.75, 1.00\}$。Offline (~30s at startup): profile cost table $C_{\text{graph}}(bs, \rho)$, $\rho \in \{0.25, 0.50, 0.75, 1.00\}$.
在线(每步):① Draft 生成 → ② 算 score → ③ 全局排序选 bucket → ④ 按 keep depth 送 target verify。Online (each step): ① Draft → ② Compute scores → ③ Global rank & select bucket → ④ Send kept positions to target verify.
verify 深度离散化为 4 个 ratio bucket,每个对应一个预 capture 的 CUDA graph shape,避免 graph miss。*Verify depth is discretized into 4 ratio buckets, each corresponding to a pre-captured CUDA graph shape, avoiding graph misses.*
* 当前 D-Cut 实现采用 piecewise CUDA graph,实际上由于大部分 bs 的不同 ratio 存在 overlap,几乎不增加额外 capture 的 CUDA graph。The current D-Cut implementation uses piecewise CUDA graphs. In practice, since different ratios overlap for most batch sizes, this barely increases the number of additionally captured CUDA graphs.
Profiled on H20, vLLM=0.20.2, temperature=0, 仅 report 稳态吞吐 (active_bs ≥ 85%).Profiled on H20, vLLM=0.20.2, temperature=0, only reporting steady-state throughput (active_bs ≥ 85%).
| Method | bs=4 | bs=8 | bs=16 | bs=32 | bs=64 | Geo Mean |
|---|---|---|---|---|---|---|
| DFlash-B16 | 2.04× | 1.28× | 0.80× | 0.52× | 0.42× | 0.85× |
| D-Cut-B16 | 2.42× | 1.93× | 1.41× | 0.99× | 0.81× | 1.39× |
| D-Cut-B8 | 2.34× | 2.05× | 1.59× | 1.13× | 0.92× | 1.51× |
| EAGLE-3 | 1.70× | 1.64× | 1.37× | 1.01× | 0.84× | 1.26× |
| Method | bs=4 | bs=8 | bs=16 | bs=32 | bs=64 | Geo Mean |
|---|---|---|---|---|---|---|
| DFlash-B16 | 2.85× | 2.23× | 1.54× | 1.14× | 0.91× | 1.59× |
| D-Cut-B16 | 2.83× | 2.55× | 1.94× | 1.59× | 1.41× | 1.99× |
| D-Cut-B8 | 2.17× | 2.33× | 1.79× | 1.52× | 1.37× | 1.80× |
| MTP | 2.45× | 2.30× | 2.01× | 1.66× | 1.44× | 1.93× |
| Method | bs=4 | bs=8 | bs=16 | bs=32 | bs=64 | Geo Mean |
|---|---|---|---|---|---|---|
| DFlash-B16 | 1.99× | 2.30× | 2.75× | 3.20× | 3.08× | 2.62× |
| D-Cut-B16 | 2.36× | 2.47× | 2.86× | 3.34× | 3.26× | 2.83× |
| D-Cut-B8 | 2.06× | 2.12× | 2.46× | 2.91× | 3.08× | 2.50× |
| MTP | 1.67× | 1.77× | 1.98× | 2.24× | 2.47× | 2.00× |
| Method | bs=4 | bs=8 | bs=16 | bs=32 | bs=64 | Geo Mean |
|---|---|---|---|---|---|---|
| DFlash-B16 | 1.14× | 1.46× | 1.74× | 2.01× | 2.06× | 1.64× |
| D-Cut-B16 | 1.33× | 1.55× | 1.85× | 2.08× | 2.56× | 1.83× |
| MTP | 1.45× | 1.59× | 1.77× | 2.08× | 2.30× | 1.81× |
D-Cut 在 MoE 上全面超越 MTP,在 dense 8B 上全面超越 EAGLE-3。且无需修改 target model、无需额外训练。D-Cut outperforms MTP on MoE models and EAGLE-3 on dense 8B across all batch sizes. No target model modification needed, no extra training.
[1] Leviathan, Y., Kalman, M., & Matias, Y. (2023). Fast inference from transformers via speculative decoding. ICML 2023.
[2] Chen, J., Liang, Y., & Liu, Z. (2026). DFlash: Block Diffusion for Flash Speculative Decoding. arXiv:2602.06036.
[3] Li, Y., Wei, F., Zhang, C., & Zhang, H. (2024). EAGLE-2: Faster Inference of Language Models with Dynamic Draft Trees. EMNLP 2024.