arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2603.05210cs.CLcs.AIcs.LG
收藏

在词汇修剪中平衡覆盖率和草案延迟以加快推测解码

Balancing Coverage and Draft Latency in Vocabulary Trimming for Faster Speculative Decoding

Intuit

Ofir Ben Shoham

AI总结:

通过词汇修剪平衡覆盖率和延迟,提升推测解码效率。

摘要:

推测解码通过使用轻量级草案模型提出候选词,这些词由更大的目标模型并行验证,从而加速大型语言模型的推理。先前的工作表明,草案模型往往主导推测解码延迟,因为它按顺序生成词,并且随着词汇量的增长,其语言建模头的高成本导致延迟增加。这暴露了草案模型设计中的根本权衡:更大的词汇量可以提高词覆盖度并更符合目标模型,但会增加草案延迟,而较小的词汇量会减少延迟,但有遗漏准确草案生成所需词的风险。我们通过为草案模型进行词汇修剪来解决这一权衡,受到观察到的领域特定工作负载只使用完整词汇的小部分的启发。我们将草案词汇选择视为一个约束优化问题,以平衡词覆盖度和草案延迟。覆盖度是根据训练数据中的助手响应计算的,而延迟则使用架构感知的FLOPs进行估计,以捕捉词汇量作为函数的语言建模头成本。我们优化一个效用函数,使用树结构的帕尔泽估计器,以在最小覆盖度约束下高效探索覆盖度-延迟帕累托前沿。实验表明,虽然减少了词汇量高达97%,但推测解码吞吐量得到了改善。在领域特定任务中,我们实现了高达16%的延迟减少和20%的吞吐量提升,并在多样化非分布任务中实现了高达6.7%的吞吐量提升。

英文摘要:

Speculative decoding accelerates inference for Large Language Models by using a lightweight draft model to propose candidate tokens that are verified in parallel by a larger target model. Prior work shows that the draft model often dominates speculative decoding latency, since it generates tokens sequentially and incurs high cost from its language modeling head as vocabulary size grows. This exposes a fundamental trade-off in draft model design: larger vocabularies improve token coverage and agreement with the target model, but incur higher draft latency, while smaller vocabularies reduce latency at the risk of missing tokens required for accurate draft generation. We address this trade-off through vocabulary trimming for draft models, motivated by the observation that domain-specific workloads use only a small fraction of the full vocabulary. We cast draft vocabulary selection as a constrained optimization problem that balances token coverage and draft latency. Coverage is computed over assistant responses in the training data, while latency is estimated using architecture-aware FLOPs that capture the cost of the language modeling head as a function of vocabulary size. We optimize a utility function with a Tree-structured Parzen Estimator to efficiently explore the coverage-latency Pareto frontier under a minimum coverage constraint. Experiments show improved speculative decoding throughput while reducing draft vocabularies by up to 97% with high coverage. On domain-specific tasks, we achieve up to 16% latency reduction and 20% throughput improvement, and up to 6.7% throughput gains on diverse out-of-distribution tasks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑