arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.07243cs.CL
收藏

SpecBlock:带有动态树草案的块迭代推测解码

SpecBlock: Block-Iterative Speculative Decoding with Dynamic Tree Drafting

Hong Kong University of Science and Technology(香港科技大学);MetaX;Zhejiang Normal University(浙江师范大学);Soochow University(苏州大学)

Weijie Shi, Qiang Xu, Fan Deng, Yaguang Wu, Jiarun Liu, Yehong Xu, Hao Chen, Jia Zhu, Jiajie Xu, Xiangjun Huang, Jian Yang, Xiaofang Zhou

AI总结:

该研究提出了一种结合路径依赖性和低成本草案的块迭代草案方法SpecBlock,通过动态树草案和路径依赖机制提高LLM推理效率,同时在部署时利用验证器反馈进行成本感知适应,从而在速度和成本上均优于现有方法。

摘要:

推测解码通过起草候选延续的树并单次目标前向验证来加速LLM推理。现有草案工具分为两派,各有缺陷。自回归草案工具如EAGLE-3在每条草案路径上保留依赖性,但每次树深度调用一次草案器,使草案成为每次迭代延迟的重要部分。并行草案工具通过一次前向预测多个未来位置来减少草案器调用,但每个位置的预测不考虑其他位置,导致验证器拒绝路径。本文提出SpecBlock,一种结合路径依赖性和低成本草案的块迭代草案工具。每个草案器前向生成K个依赖位置,称为块。草案树通过重复块扩展生长。两种机制显式携带路径依赖性以保持后续草案位置的准确性。在每个块内,逐层位移将前一位置的隐藏状态传输到每个解码器层。在块之间,每个新块可以从上一个块的任意位置开始,继承其隐藏状态以延长路径。为在验证器预算中花费在可能接受的位置,一个共同训练的排名头取代固定top-k树,通过在草案过程中分配每位置分支。为避免在推理时训练草案器在它从未生成的前缀上,一个有效前缀掩码在较后位置的损失在较早位置出错时丢弃。除了静态草案外,部署时的成本感知老虎机利用免费验证器反馈来选择性更新草案器,仅当预期吞吐量增益超过更新成本时。实验表明,SpecBlock在44-52%的草案成本下,相比EAGLE-3提高了8-13%的平均速度,而成本感知适应将此优势扩展到11-19%。

英文摘要:

Speculative decoding accelerates LLM inference by drafting a tree of candidate continuations and verifying it in one target forward. Existing drafters fall into two camps with opposite weaknesses. Autoregressive drafters such as EAGLE-3 preserve dependence along each draft path but call the drafter once per tree depth, making drafting a non-trivial share of per-iteration latency. Parallel drafters cut drafter calls by predicting multiple future positions in one forward, but each position is predicted without seeing the others, producing paths the verifier rejects. In this paper, we propose SpecBlock, a block-iterative drafter that combines path dependence with cheap drafting. Each drafter forward produces K dependent positions and we call this a block. The draft tree grows through repeated block expansions. Two mechanisms explicitly carry path dependence to keep later draft positions accurate. Within each block, a layer-wise shift carries the previous position's hidden state into every decoder layer. Across blocks, each new block can start from any position of the previous block, inheriting its hidden state to extend the path. To spend verifier budget where acceptance is likely, a co-trained rank head replaces the fixed top-k tree by allocating per-position branching during drafting. To avoid training the drafter on prefixes it never produces at inference, a valid-prefix mask drops the loss at later positions once an earlier one is wrong. Beyond static drafting, a cost-aware bandit at deployment uses free verifier feedback to update the drafter selectively, only when the expected throughput gain exceeds the update cost. Experiments show that SpecBlock improves mean speedup by 8-13% over EAGLE-3 at 44-52% of its drafting cost, and cost-aware adaptation extends this lead to 11-19%.

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

↑