arXiv:2505.22179cs.CLcs.AI2025-05被引 3

提出分层框架,让压缩模型与推测解码更好兼容。

Speculative Decoding Meets Quantization: Compatibility Evaluation and Hierarchical Framework Design

  • 用小模型把树状草稿转为序列草稿,降低计算负担。
  • 在4比特量化Llama-3-70B上实现2.78倍加速,比EAGLE-2快1.31倍。
  • 适合追求低精度推理速度的工程师和研究者。

推测解码与量化能有效加速大语言模型的内存受限推理。推测解码通过单次前向传播验证多个词元,缓解内存带宽瓶颈,但增加计算开销;量化通过将权重和激活压缩至低位宽,利用低比特矩阵乘法减少计算量并压缩内存占用。为融合二者优势,我们研究了其结合效果。实验发现,将先进推测解码方法EAGLE-2应用于多种量化模型时,4比特权重量化带来的内存收益被推测解码的计算负载抵消。具体而言,在4比特量化模型上,验证树状草稿的时间开销远高于单词元前向传播。为此,我们设计了一种分层框架:使用小模型作为中间阶段,将树状草稿转换为序列草稿,从而利用目标量化模型的内存访问优势。实验结果表明,该方法在A100 GPU上对4比特权重的Llama-3-70B模型实现了2.78倍加速,较EAGLE-2提升1.31倍。代码已开源:https://github.com/AI9Stars/SpecMQuant。

原文摘要 · Abstract (English)

Speculative decoding and quantization effectively accelerate memory-bound inference of large language models. Speculative decoding mitigates the memory bandwidth bottleneck by verifying multiple tokens within a single forward pass, which increases computational effort. Quantization achieves this optimization by compressing weights and activations into lower bit-widths and also reduces computations via low-bit matrix multiplications. To further leverage their strengths, we investigate the integration of these two techniques. Surprisingly, experiments applying the advanced speculative decoding method EAGLE-2 to various quantized models reveal that the memory benefits from 4-bit weight quantization are diminished by the computational load from speculative decoding. Specifically, verifying a tree-style draft incurs significantly more time overhead than a single-token forward pass on 4-bit weight quantized models. This finding led to our new speculative decoding design: a hierarchical framework that employs a small model as an intermediate stage to turn tree-style drafts into sequence drafts, leveraging the memory access benefits of the target quantized model. Experimental results show that our hierarchical approach achieves a 2.78$\times$ speedup across various tasks for the 4-bit weight Llama-3-70B model on an A100 GPU, outperforming EAGLE-2 by 1.31$\times$. Code available at https://github.com/AI9Stars/SpecMQuant.

推理加速量化推测解码

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