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

通过序列蒙特卡洛方法加速大语言模型推理

Faster LLM Inference via Sequential Monte Carlo

Cornell University(康奈尔大学);Makora(马科拉);MIT(麻省理工学院);ETH Zürich(苏黎世联邦理工学院)

Yahya Emara, Mauricio Barba da Costa, Chi-Chih Chang, Cameron Freer, Tim Vieira, Ryan Cotterell, Mohamed S. Abdelfattah

AI总结:

本文提出SMC-SD方法,通过重要性加权重采样替代传统拒绝采样,提升推理速度,实验证明在多个基准测试中保持高精度的同时,比推测解码和自回归解码分别快2.36倍和5.2倍。

摘要:

推测解码(SD)通过使用廉价的提案模型生成token并用昂贵的目标模型进行拒绝采样来加速语言模型推理。由于拒绝采样在首次错误时截断草案块,当草案和目标模型分歧时,吞吐量会下降。本文提出序列蒙特卡洛推测解码(SMC-SD),通过重要性加权重采样替代token级拒绝,从而在保持理论误差界的同时提高速度。由于LLM推理是内存带宽受限的,生成粒子和并行评分所需的算力几乎免费,SMC-SD利用空闲计算将验证转化为向量化、固定大小的操作,无需回滚。实验证明,SMC-SD在多个基准测试中保持高精度,比推测解码和自回归解码分别快2.36倍和5.2倍。

英文摘要:

Speculative decoding (SD) accelerates language model inference by drafting tokens from a cheap proposal model and verifying them against an expensive target model via rejection sampling. Because rejection truncates the draft block at the first error, throughput degrades when draft and target diverge. Rather than rejecting draft tokens outright, we propose to reweight them. To this end, we introduce sequential Monte Carlo speculative decoding (SMC-SD), which replaces token-level rejection with importance-weighted resampling over a population of draft particles. SMC-SD is a principled approximate inference scheme that trades exactness for additional speed, while preserving theoretical bounds on its per-step approximation error. Because LLM inference is memory bandwidth-bound, the arithmetic needed to draft particles and to score them in parallel comes nearly for free -- SMC-SD uses idle compute to turn verification into a vectorized, fixed-size operation with no rollback. Empirically, SMC-SD achieves 2.36x speed-up over speculative decoding and a 5.2x speed-up over autoregressive decoding, while remaining within 3% of the target model's accuracy on reasoning, instruction-following, and coding benchmarks.

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

↑