跳到正文
arXiv cs.CL· Li Wang, Yi Su, Xiabao Wu, Chiran You, Yongchao Liu, Zhan Qiu, Juelu Zhang, Jiajun Zheng, Fangxin Liu, Jie Zhang, Chen Tian, Chengying Huan·· 11 小时前AI 评分42

Twig:面向混合注意力 LLM 的并行内存高效树形投机解码

Twig: Parallel and Memory-Efficient Tree Speculative Decoding for Hybrid-Attention LLMs

AI 导读

Twig 是面向混合注意力 LLM 的树形投机解码内核与运行时协同设计,通过树结构分解线性注意力递归,用 GPU 内核并行验证所有节点,线性注意力树验证提速 3.4–7.7 倍。

正文 · 原文

Authors:Li Wang, Yi Su, Xiabao Wu, Chiran You, Yongchao Liu, Zhan Qiu, Juelu Zhang, Jiajun Zheng, Fangxin Liu, Jie Zhang, Chen Tian, Chengying Huan

View PDF HTML (experimental)

Abstract:Emerging LLMs increasingly interleave full attention with recurrent linear attention to reduce long-context serving costs. Tree speculative decoding could further accelerate these hybrid models, but recurrent linear-attention layers carry parent-dependent states. Existing engines therefore verify proposal trees sequentially and snapshot the full state per node, causing latency and memory to grow with tree and batch sizes. We present Twig, a kernel--runtime co-design for tree speculative decoding of hybrid LLMs. Twig derives a tree-structured factorization of the linear-attention recurrence and realizes it with a resource-efficient GPU kernel that verifies all nodes in parallel, accelerating linear-attention tree verification by 3.4--7.7$\times$. It losslessly represents speculative state updates as token-level factors and reconstructs only the accepted state, reducing transient state memory by 82--99$\times$ and freeing GPU memory for KV caches. We integrate Twig into SGLang, a widely deployed production LLM serving engine, and further optimize its runtime through batch-wide verification budgeting. Across four models, two GPU platforms, and diverse datasets, Twig achieves up to $4.72\times$ the offline decode throughput of autoregressive decoding and up to $2.03\times$ that of the strongest tree-speculative baseline. Under online agent workloads, Twig reduces TTFT and TPOT by up to $67.6\%$ and $49.9\%$, respectively, over the strongest tree-speculative baseline.
Comments: Accepted to HPCA 2027
Subjects: Distributed, Parallel, and Cluster Computing (cs.DC); Computation and Language (cs.CL); Machine Learning (cs.LG)
Cite as: arXiv:2608.01651 [cs.DC]
  (or arXiv:2608.01651v2 [cs.DC] for this version)
  https://doi.org/10.48550/arXiv.2608.01651

arXiv-issued DOI via DataCite

Submission history

From: Li Wang [view email]
[v1] Mon, 3 Aug 2026 03:43:14 UTC (705 KB)
[v2] Thu, 5 Nov 2026 02:51:48 UTC (873 KB)

来源:arXiv cs.CL · arxiv.org