arXiv:2411.11055cs.CL2024-11ACL被引 9

FastDraft快速训练高效草稿模型,加速大模型推理。

FastDraft: How to Train Your Draft

  • 用合成数据微调目标模型,实现草稿模型高效预训练
  • 24小时内单服务器生成100亿token草稿模型,支持3倍内存瓶颈加速
  • 适合想在AI PC等边缘设备部署大模型的开发者

推测解码作为加速大语言模型自回归推理的有效技术受到广泛关注。然而,该技术高度依赖高效且词汇兼容的草稿模型,而现有语言模型往往缺乏此类支持。本文提出 FastDraft,一种针对任意大语言模型进行预训练和对齐草稿模型的新方法,包含高效的预训练阶段及基于目标模型生成的合成数据的微调。我们以 Phi-3-mini 和 Llama-3.1-8B 模型为例展示了 FastDraft 效果:仅使用配备 8 个 Intel® Gaudi® 2 加速器的单台服务器,在 24 小时内完成了约 100 亿条令牌的草稿模型训练。评估结果显示,该草稿模型在代码补全任务中达到高达 3 倍的内存瓶颈加速,摘要、文本补全和指令任务中达 2 倍加速。在最新 Intel® Core™ Ultra 平台上基准测试验证了理论分析,实现了最高 2 倍的时钟时间加速,显著降低运行时开销。由于其高质量,FastDraft 使大模型推理在 AI-PC 及其他边缘设备上成为可能。

原文摘要 · Abstract (English)

Speculative Decoding has gained popularity as an effective technique for accelerating the auto-regressive inference process of Large Language Models. However, Speculative Decoding entirely relies on the availability of efficient draft models, which are often lacking for many existing language models due to a stringent constraint of vocabulary compatibility. In this work we introduce FastDraft, a novel and efficient approach for pre-training and aligning a draft model to any large language model by incorporating efficient pre-training, followed by fine-tuning over synthetic datasets generated by the target model. We demonstrate FastDraft by training two highly parameter efficient drafts for the popular Phi-3-mini and Llama-3.1-8B models. Using FastDraft, we were able to produce a draft model with approximately 10 billion tokens on a single server with 8 Intel$^\circledR$ Gaudi$^\circledR$ 2 accelerators in under 24 hours. Our results show that the draft model achieves impressive results in key metrics of acceptance rate, block efficiency and up to 3x memory bound speed up when evaluated on code completion and up to 2x in summarization, text completion and instruction tasks. We validate our theoretical findings through benchmarking on the latest Intel$^\circledR$ Core$^{\tiny \text{TM}}$ Ultra, achieving a wall-clock time speedup of up to 2x, indicating a significant reduction in runtime. Due to its high quality, FastDraft unlocks large language models inference on AI-PC and other edge-devices.

推理加速草稿模型边缘计算

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。