通过动态组合压缩策略,实现无需训练的快速大模型推理。
CAS-Spec: Cascade Adaptive Self-Speculative Decoding for On-the-Fly Lossless Inference Acceleration of LLMs

- 用动态切换的稀疏与量化策略构建多级草稿模型。
- 平均提速1.1到2.3倍,比传统方法快47%以上。
- 适合希望无额外训练加速推理的研究者与工程师。
推测解码已成为部署大语言模型(LLMs)时实现无损推理加速的常用技术。虽然即插即用的自推测方法具有无缝集成和广泛适用性,但其速度提升常不及依赖专用训练的方法。分层级联多个草稿模型可进一步加速并增强灵活性,但训练多个模型的高成本限制了其实用性。本文提出一种新型级联自推测解码方法(CAS-Spec),通过动态可切换的推理加速策略(包括层稀疏与激活量化)构建推测草稿模型。此外,传统垂直或水平级联算法在自推测解码中效率低下。我们引入动态树级联(DyTC)算法,基于接受率与延迟预测的启发式规则,自适应地路由多级草稿模型并分配草稿长度。相比现有即插即用推测解码方法,CAS-Spec在不同大模型与数据集上实现了最高2.3倍的平均加速;相较于基于级联与树状结构的基线算法,其平均加速分别提升47%和48%。CAS-Spec可轻松集成至多数现有大模型,并随着自推测解码技术的发展具备进一步加速潜力。
原文摘要 · Abstract (English)
Speculative decoding has become a widely adopted as an effective technique for lossless inference acceleration when deploying large language models (LLMs). While on-the-fly self-speculative methods offer seamless integration and broad utility, they often fall short of the speed gains achieved by methods relying on specialized training. Cascading a hierarchy of draft models promises further acceleration and flexibility, but the high cost of training multiple models has limited its practical application. In this paper, we propose a novel Cascade Adaptive Self-Speculative Decoding (CAS-Spec) method which constructs speculative draft models by leveraging dynamically switchable inference acceleration (DSIA) strategies, including layer sparsity and activation quantization. Furthermore, traditional vertical and horizontal cascade algorithms are inefficient when applied to self-speculative decoding methods. We introduce a Dynamic Tree Cascade (DyTC) algorithm that adaptively routes the multi-level draft models and assigns the draft lengths, based on the heuristics of acceptance rates and latency prediction. Our CAS-Spec method achieves state-of-the-art acceleration compared to existing on-the-fly speculative decoding methods, with an average speedup from $1.1\times$ to $2.3\times$ over autoregressive decoding across various LLMs and datasets. DyTC improves the average speedup by $47$\% and $48$\% over cascade-based baseline and tree-based baseline algorithms, respectively. CAS-Spec can be easily integrated into most existing LLMs and holds promising potential for further acceleration as self-speculative decoding techniques continue to evolve.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。