ChatPaper.aiChatPaper

VOCABTRIM: Potatura del Vocabolario per un Decodifica Speculativa Efficiente nei Modelli Linguistici di Grande Dimensione

VOCABTRIM: Vocabulary Pruning for Efficient Speculative Decoding in LLMs

June 28, 2025
Autori: Raghavv Goel, Sudhanshu Agrawal, Mukul Gagrani, Junyoung Park, Yifan Zao, He Zhang, Tian Liu, Yiping Yang, Xin Yuan, Jiuyan Lu, Chris Lott, Mingu Lee
cs.AI

Abstract

In questo articolo, introduciamo una semplice tecnica priva di addestramento per migliorare le prestazioni dei metodi di decodifica speculativa (SpD) basati su drafter, che incorporano la testa di modellazione del linguaggio (LM head) durante il processo di drafting. La decodifica speculativa basata su drafter sfrutta uno o più modelli linguistici più piccoli, noti come drafter o modelli di draft, per campionare una sequenza o un albero di draft composto da più token, seguiti dalla verifica da parte di un LLM di base, il modello target, che accetta un sottoinsieme come sua generazione valida. Poiché si considera generalmente che la decodifica speculativa richieda una mappatura uno-a-uno tra i vocabolari del modello target e del modello di draft, è stato naturale condividere il vocabolario tra di essi, o persino condividere la LM head come in EAGLE o Medusa. Identifichiamo innanzitutto che questo schema di campionamento dei token di draft contiene intrinsecamente un sovraccarico di inferenza non necessario durante il drafting, specialmente per alcuni LLM target con vocabolari molto ampi. Proponiamo quindi una semplice tecnica, VocabTrim, per mitigare il sovraccarico di drafting e migliorare la velocità di generazione in ambienti vincolati dalla memoria. VocabTrim ricostruisce la LM head del drafter per contenere solo un insieme limitato di token, selezionati tra quelli campionati più frequentemente dal vocabolario del modello target. Sebbene la limitazione del vocabolario durante il drafting degradi leggermente il tasso di accettazione, riduce significativamente la latenza di drafting nei processi vincolati dalla memoria, come spesso accade sui dispositivi edge, risultando in un maggiore speed-up vincolato dalla memoria (MBSU). Mostriamo che il nostro metodo può aumentare lo speed-up vincolato dalla memoria per i modelli Llama-3 su Spec-Bench, in particolare del 16% per Llama-3.2-3B-Instruct.
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.
PDF31July 1, 2025