面向推测解码的并行草稿上下文校正

·

研究论文 · 2026/10/12

推测解码通过轻量级草稿模型提出多个令牌,再由目标模型并行验证来加速大语言模型推理。近期基于扩散的草稿模型使这一范式尤为有吸引力:深度注意力神经骨干提供强预测,同时并行草拟多个未来位置避免了自回归生成的顺序成本。然而,这种并行性也有代价:草稿块内的令牌在预测时无法获知前面草稿令牌的实际身份,从而移除了自回归生成下自然可用的块内依赖。我们提出 DCOCO(DFlash 上下文校正器),一种轻量级机制,在保持并行草拟的同时恢复这些依赖。DCOCO 不固定每个位置的最高预测,而是保留多个候选令牌,并并行评估它们在相邻草稿位置间的上下文兼容性,从而以低额外成本实现基于上下文的令牌选择。在四个验证器骨干和十个基准上,DCOCO 在每个评估配置中均实现最高平均吞吐量,涵盖贪婪和随机解码以及有无扩展推理,相比原始解码加速最高达 6.6 倍。其优势在并发服务下依然存在:在 4-32 个并发请求中,DCOCO 比最强竞争方法高出 6-23%,而其他顺序校正器在这些负载下低于未校正的 DFlash。这些结果表明,通过并行上下文评分恢复块内依赖,可在不同解码机制和服务负载下带来一致的加速。

该工作通过并行上下文评分恢复草稿块内依赖,在多种解码机制和并发负载下实现一致加速,对推测解码的实用部署有重要价值。

Speculative decoding accelerates large language model inference by using a lightweight drafter to propose multiple tokens that are subsequently verified in parallel by the target model. Recent diffusion-based drafters make this paradigm particularly attractive: deep attention-based neural backbones provide strong predictions, while drafting multiple future positions in parallel avoids the sequential cost of autoregressive generation. This parallelism, however, comes at a cost. Tokens within a draft block are predicted without access to the realized identities of preceding draft tokens, removing intra-block dependencies that would naturally be available under autoregressive generation. We introduce DCOCO (DFlash Contextual Corrector), a lightweight mechanism that restores these dependencies while preserving parallel drafting. Rather than committing to each position's top prediction, DCOCO retains multiple candidate tokens and evaluates their contextual compatibility across adjacent draft positions in parallel, enabling contextually informed token selection at low additional cost. Across four verifier backbones and ten benchmarks, DCOCO achieves the highest average throughput in every evaluated configuration, spanning greedy and stochastic decoding with and without extended reasoning, with speedups of up to 6.6x over vanilla decoding. Its advantage persists under concurrent serving: DCOCO outperforms the strongest competing method by 6-23% across 4-32 concurrent requests, while other sequential correctors fall below uncorrected DFlash at these loads. These results demonstrate that recovering intra-block dependencies through parallel contextual scoring delivers consistent acceleration across decoding regimes and serving loads.

阅读原文

参与讨论