arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2505.14969cs.LGcs.AI
收藏

STree:面向混合状态空间模型的推测树解码

STree: Speculative Tree Decoding for Hybrid State-Space Models

UCLA(加州大学洛杉矶分校);Yale University(耶鲁大学)

Yangchao Wu, Zongyue Qin, Alex Wong, Stefano Soatto

AI总结:

针对现有SSM推测解码无法高效利用树验证的问题,提出首个可扩展的SSM及混合架构推测树解码算法STree,结合硬件感知实现以低开销超越普通SSM推测解码,为模型推理提速提供新路径。

摘要:

推测解码是一种利用硬件并发性以在单次前向传播中实现多步令牌生成的技术,由此提升大规模自回归(AR)Transformer模型的效率。状态空间模型(SSMs)本就比AR Transformer更高效,因为其状态可汇总所有过往数据,无需在滑动窗口上下文中缓存或重新处理令牌。不过,SSM的状态也可能包含数千个令牌,因此推测解码近期已被拓展应用到SSM上。但现有方法并未利用基于树的验证方法,因为当前的SSM缺乏高效计算令牌树的手段。我们提出了首个可扩展算法,用于在状态空间模型(SSMs)以及SSM与Transformer层的混合架构中执行基于树的推测解码。我们利用累积状态转移矩阵的结构来实现基于树的推测解码,相较于当前的SSM实现,其额外开销极低。除算法外,我们还介绍了一种硬件感知的实现方案,该方案改进了将AR Transformer基于树的推测解码方法直接应用到SSM的朴素做法。此外,即便使用基线草稿模型和树结构,我们的方法在三个不同基准上的表现也优于SSM的普通推测解码,为SSM及混合模型推理的进一步提速开辟了可能。代码可在以下地址获取:https://github.com/wyc1997/stree。

英文摘要:

Speculative decoding is a technique to leverage hardware concurrency in order to enable multiple steps of token generation in a single forward pass, thus improving the efficiency of large-scale autoregressive (AR) Transformer models. State-space models (SSMs) are already more efficient than AR Transformers, since their state summarizes all past data with no need to cache or re-process tokens in the sliding window context. However, their state can also comprise thousands of tokens; so, speculative decoding has recently been extended to SSMs. Existing approaches, however, do not leverage the tree-based verification methods, since current SSMs lack the means to compute a token tree efficiently. We propose the first scalable algorithm to perform tree-based speculative decoding in state-space models (SSMs) and hybrid architectures of SSMs and Transformer layers. We exploit the structure of accumulated state transition matrices to facilitate tree-based speculative decoding with minimal overhead relative to current SSM implementations. Along with the algorithm, we describe a hardware-aware implementation that improves naive application of AR Transformer tree-based speculative decoding methods to SSMs. Furthermore, we outperform vanilla speculative decoding with SSMs even with a baseline drafting model and tree structure on three different benchmarks, opening up opportunities for further speed up with SSM and hybrid model inference. Code can be found at: https://github.com/wyc1997/stree.

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

↑