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

PackLoop:并发场景下循环语言模型的行内自推测解码

PackLoop: Row-Packed Self-Speculative Decoding for Looped Language Models under Concurrency

University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);University of Tübingen(蒂宾根大学)

Runguo Li, Dezhen Lu

AI总结:

PackLoop是针对并发场景下循环语言模型的行内自推测解码方案,通过优化推测布局提升解码速度,在多数负载点上优于现有调度,且输出精确。

摘要:

循环语言模型每个token会重复使用同一组权重块T次,以参数换取测试时的深度,但自回归解码时每个token需要T次顺序前向传播。自推测解码器对单个请求可将速度提升2-10倍,但当多个请求共享一块GPU时,其增益会衰减,当前的做法是随着负载增加减少推测量。我们发现负载下失效的是推测工作的布局,而非推测本身。在并发解码中,成本单位是行:一个请求在一个循环上推进,仅读取该循环的键值(KV)缓存一次;行内的额外位置几乎无成本。波前等流水线调度会将每个推测位置放在不同循环上,因此各位置各占一行,导致每个token仍需读取T次。我们提出PackLoop,其核心原则是仅在必然会被读取的行内进行推测。深层循环会累积位置并作为一个块在单行内推进,上下文复制提议会加入第一个循环已读取的行,而一个基于库存理论的经济订货量闭式准入规则,会根据每个引擎校准一次的成本模型设定累积时长。PackLoop是精确的:在FP32精度下,其输出与自回归解码完全一致,在采样和提前退出场景下也如此。在覆盖3块GPU、4个Ouro模型、6个基准及最长32K token上下文的164个负载点中,有161个负载点上,一种PackLoop配置比各点最优现有调度更快(中位数1.25倍,最高1.76倍),且从未明显更慢。其优势随并发度和上下文长度增长,而这正是现有自推测增益最小的场景。

英文摘要:

Looped language models reuse one block of weights T times per token, trading parameters for test-time depth, but autoregressive decoding then pays T sequential passes per token. Self-speculative decoders recover 2-10x for a single request, yet their gains fade as requests share a GPU, and current practice is to speculate less as load grows. We show that what fails under load is the layout of speculative work, not speculation. In concurrent decoding the unit of cost is the row, one request advancing on one loop, which reads that loop's key-value (KV) cache once; additional positions inside a row are nearly free. Pipelined schedules such as the wavefront place every speculative position on a different loop, hence in a row of its own, so each token is still read T times. We present PackLoop, built on one principle: speculate only inside rows that are read anyway. Deep loops accumulate positions and advance them as a block in one row, context-copy proposals join the row that the first loop already reads, and a closed-form admission rule, the economic order quantity of inventory theory, sets how long to accumulate from a cost model calibrated once per engine. PackLoop is exact: in FP32 its output is token-for-token identical to autoregressive decoding, also under sampling and early exit. Across 164 load points spanning three GPUs, four Ouro models, six benchmarks, and contexts up to 32K tokens, one PackLoop configuration is faster than the best existing schedule, chosen per point, at 161 points (median 1.25x, up to 1.76x) and never significantly slower. Its lead grows with concurrency and context length, the regime in which existing self-speculation gains least.

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

↑