一个可适配所有模型的在线自适应草稿框架,让设备端大模型更快生成。
OmniDraft: A Cross-vocabulary, Online Adaptive Drafter for On-device Speculative Decoding
- 用动态n-gram缓存和混合蒸馏解决草稿与目标模型词汇不匹配问题
- 单个68M模型可配对多个7B~8B目标模型,实现1.5-2倍加速
- 适合设备端大模型应用,支持用户数据实时适应
推测解码通常依赖于一个预训练或离线蒸馏的小型高效草稿模型,针对特定目标模型系列(如Llama或Qwen)。然而在在线部署中存在两大挑战:1)目标模型与草稿模型词汇不兼容;2)期望在使用过程中持续降低延迟。本文提出OmniDraft,一个统一框架,使单一草稿模型能适配任意目标模型,并动态适应用户数据。通过引入在线n-gram缓存与混合蒸馏微调,解决草稿与目标模型间的跨词汇不匹配问题;进一步利用自适应草稿技术提升解码速度。OmniDraft特别适用于设备端大模型应用,其中模型成本、效率与用户定制是关键考量。我们展示了其在数学推理、代码生成和文本生成任务上的在线学习能力。值得注意的是,该框架使单个Llama-68M模型可与Vicuna-7B、Qwen2-7B和Llama3-8B等多种目标模型进行推测解码,并实现最高达1.5-2倍的速度提升。
原文摘要 · Abstract (English)
Speculative decoding generally dictates having a small, efficient draft model that is either pretrained or distilled offline to a particular target model series, for instance, Llama or Qwen models. However, within online deployment settings, there are two major challenges: 1) usage of a target model that is incompatible with the draft model; 2) expectation of latency improvements over usage and time. In this work, we propose OmniDraft, a unified framework that enables a single draft model to operate with any target model and adapt dynamically to user data. We introduce an online n-gram cache with hybrid distillation fine-tuning to address the cross-vocabulary mismatch across draft and target models; and further improve decoding speed by leveraging adaptive drafting techniques. OmniDraft is particularly suitable for on-device LLM applications where model cost, efficiency and user customization are the major points of contention. This further highlights the need to tackle the above challenges and motivates the \textit{``one drafter for all''} paradigm. We showcase the proficiency of the OmniDraft framework by performing online learning on math reasoning, coding and text generation tasks. Notably, OmniDraft enables a single Llama-68M model to pair with various target models including Vicuna-7B, Qwen2-7B and Llama3-8B models for speculative decoding; and additionally provides up to 1.5-2x speedup.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。