SlimSpec:用于加速推测解码的低秩草稿模型LM-Head
推测解码通过轻量草稿模型生成候选令牌来加速大语言模型推理,但其LM-Head对大规模词汇的投影计算成本高昂。现有方法多采用词汇截断,但增加了复杂性。本文提出SlimSpec,采用低秩参数化压缩草稿模型LM-Head的内部表示而非输出,从而保留完整词汇支持。在EAGLE-3草稿模型和多个目标模型及基准测试中评估,SlimSpec在延迟和吞吐量场景下,相比标准LM-Head实现了4-5倍加速,同时保持有竞争力的接受长度,端到端加速效果超越现有方法8-9%,且对训练和推理流程改动最小。
Speculative decoding speeds up autoregressive generation in Large Language Models (LLMs) through a two-step procedure, where a lightweight draft model proposes tokens which the target model then verifies in a single forward pass. Although the drafter network is small in modern architectures, its LM-head still performs projection to a large vocabulary, becoming one of the major computational bottlenecks. In prior work this issue has been predominantly addressed via static or dynamic vocabulary truncation. Yet mitigating the bottleneck, these methods bring in extra complexity, such as special vocabulary curation, sophisticated inference-time logic or modifications of the training setup. In this paper, we propose SlimSpec, a low-rank parameterization of the drafter's LM-head that compresses the inner representation rather than the output, preserving full vocabulary support. We evaluate our method with EAGLE-3 drafter across three target models and diverse benchmarks in both latency- and throughput-bound inference regimes. SlimSpec achieves 4-5times acceleration over the standard LM-head architecture while maintaining a competitive acceptance length, surpassing existing methods by up to 8-9% of the end-to-end speedup. Our method requires minimal adjustments of training and inference pipelines. Combined with the aforementioned speedup improvements, it makes SlimSpec a strong alternative across wide variety of draft LM-head architectures.