通过精简草案模型词汇表,提升大模型推测解码速度。
VOCABTRIM: Vocabulary Pruning for Efficient Speculative Decoding in LLMs
- 用目标模型高频词构建草案模型小词汇表,减少推理开销。
- 在边缘设备上使Llama-3.2-3B-Instruct的内存瓶颈加速比提升16%。
- 无需训练,适合资源受限场景下的高效生成部署。
本文提出一种无需训练的简单技术VocabTrim,用于改进基于草案模型的推测解码(SpD)性能。传统方法要求草案模型与目标大模型词汇表一一对应,常共享词表甚至语言建模头,导致在词汇量大的目标模型上产生不必要的推理开销。VocabTrim通过重构草案模型的语言建模头,仅保留目标模型中高频出现的有限词汇,显著降低内存密集型环境下的草案生成延迟。尽管接受率略有下降,但在内存受限场景下大幅减少推理耗时,使Llama-3.2-3B-Instruct在Spec-Bench上的内存瓶颈加速比(MBSU)提升16%。该方法适用于边缘设备等资源受限环境。
原文摘要 · Abstract (English)
In this paper, we introduce a simple training-free technique to improve the performance of drafter-based speculative decoding (SpD) methods that incorporates language modeling head (LM head) during drafting process. A drafter-based speculative decoding leverages one or more smaller language models, a.k.a. drafters or draft models, to sample a draft sequence or tree consisting of multiple tokens, followed by verification by a base LLM, a target model, accepting a subset as its valid generation. As it is usually considered that the speculative decoding requires one-to-one mapping between vocabularies of the target model and the draft model, it has been natural to share the vocabulary between them, or even share the LM head as in EAGLE or Medusa. We first identify that this draft token sampling scheme inherently contains an unnecessary inference overhead in drafting, especially for some target LLMs with very large vocabularies. Then, we propose a simple technique, VocabTrim, to mitigate the drafting overhead to improve the generation speed in memory-bound environment. VocabTrim reconstructs the drafter LM head to contain only a limited set of tokens, selected by the most frequently sampled from the vocabulary of the target model. While limiting the vocabulary in drafting slightly degrades the acceptance rate, it significantly reduces the drafting latency in memory-bound process which is often the case on edge devices, resulting in higher memory-bound speed up (MBSU). We show that our method can boost the memory-bound speed-up for Llama-3 models on Spec-Bench, specifically by 16% for Llama-3.2-3B-Instruct.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。