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

Nightjar: 面向大语言模型服务的动态自适应推测解码

Nightjar: Dynamic Adaptive Speculative Decoding for Large Language Models Serving

State Key Laboratory of Complex & Critical Software Environment, National Key Laboratory of Parallel and Distributed Computing, College of Computer Science and Technology, National University of Defense Technology(复杂与关键软件环境国家重点实验室、平行与分布式计算国家实验室、计算机科学与技术学院、国防科技大学)

Rui Li, Zhaoning Zhang, Libo Zhang, Huaimin Wang, Xiang Fu, Zhiquan Lai

AI总结:

提出Nightjar框架,通过动态调整推测长度和主动禁用推测解码,在高低负载下优化吞吐量,最高提升14.76%。

摘要:

推测解码通过并行验证草稿令牌加速LLM推理。然而,该方法存在关键权衡:在低负载、内存受限系统中提高吞吐量,但在高负载、计算受限环境中因验证开销而降低性能。现有推测解码方法使用固定长度,无法适应工作负载变化或决定何时停止推测。重新启动推测推理的成本也未被量化。在高负载下,推测的收益减少,而保留草稿模型会减少KV缓存容量,限制批处理大小并降低吞吐量。为解决此问题,我们提出Nightjar,一种资源感知的自适应推测框架。它首先通过动态选择不同批处理大小的最优推测长度来适应请求负载。关键的是,当MAB规划器确定推测不再有益时,Nightjar主动禁用推测解码,并在禁用阶段仅在GPU内存压力下将草稿模型卸载到CPU。这为KV缓存回收内存,从而促进更大的批处理大小并最大化系统整体吞吐量。实验表明,在实时LLM服务场景的动态请求到达率下,Nightjar在主要基准测试套件中比标准推测解码实现高达14.76%的吞吐量提升和高达20.18%的延迟降低。

英文摘要:

Speculative decoding (SD) accelerates LLM inference by verifying draft tokens in parallel. However, this method presents a critical trade-off: it improves throughput in low-load, memory-bound systems but degrades performance in high-load, compute-bound environments due to verification overhead. Existing speculative decoding methods use fixed lengths and cannot adapt to workload changes or decide when to stop speculation. The cost of restarting speculative inference also remains unquantified. Under high load, the benefit of speculation diminishes, while retaining the draft model reduces KV cache capacity, limiting batch size and degrading throughput. To overcome this, we propose Nightjar, a resource-aware adaptive speculative framework. It first adjusts to the request load by dynamically selecting the optimal speculative length for different batch sizes. Crucially, Nightjar proactively disables speculative decoding when the MAB planner determines that speculation is no longer beneficial, and during the disabled phase, offloads the draft model to the CPU only under GPU memory pressure. This reclaims memory for the KV cache, thereby facilitating larger batch sizes and maximizing overall system throughput. Experiments show that Nightjar achieves up to 14.76% higher throughput than standard speculative decoding and up to 20.18% lower latency in the main benchmark suite under dynamic request arrival rates for real-time LLM serving scenarios.

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

↑