Accelerating LLM Inference with Lossless Speculative Decoding Algorithms for Heterogeneous Vocabularies
To address the slow inference speed of large language models (LLMs) and the limitation of existing speculative decoding methods—namely, their reliance on shared vocabularies—this paper proposes the first lossless speculative decoding framework supporting heterogeneous tokenizers. Methodologically, it requires no vocabulary alignment, modifies or retrains neither the draft nor the target model, and achieves cross-vocabulary distribution preservation via three lightweight components: token mapping, dynamic probability projection, and distribution calibration. Its core contribution is the elimination of vocabulary consistency constraints, enabling the first truly plug-and-play speculative decoding across disparate tokenizers. Evaluated on summarization, code generation, and long-context tasks, the framework achieves average speedups of 1.8–2.3× over standard autoregressive decoding, with zero accuracy degradation—outperforming all baseline speculative decoding approaches.