Ouroboros: Generating Longer Drafts Phrase by Phrase for Faster Speculative Decoding (2402.13720v3)
Abstract: Speculative decoding is a widely used method that accelerates the generation process of LLMs with no compromise in model performance. It achieves this goal by using an existing smaller model for drafting and then employing the target LLM to verify the draft in a low-cost parallel manner. Under such a drafting-verification framework, drafting efficiency has become a bottleneck in the final speedup of speculative decoding. Therefore, generating longer drafts at less cost can lead to better decoding speedup. To achieve this, we introduce Ouroboros, which can generate draft phrases to parallelize the drafting process and meanwhile lengthen drafts in a training-free manner. The experimental results on various typical text generation tasks show that Ouroboros can achieve speedups of up to $2.8\times$ over speculative decoding and $3.9\times$ over vanilla decoding, without fine-tuning draft and target models. The source code of Ouroboros is available at https://github.com/thunlp/Ouroboros.
- 01-ai. Yi, 2023. URL https://github.com/01-ai/Yi.
- Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023.
- Program synthesis with large language models. arXiv preprint arXiv:2108.07732, 2021.
- Fast and robust early-exiting framework for autoregressive language models with synchronized parallel decoding. In Proceedings of EMNLP, 2023.
- Deepseek llm: Scaling open-source language models with longtermism. arXiv preprint arXiv:2401.02954, 2024.
- Findings of the 2016 conference on machine translation. In Proceedings of the First Conference on Machine Translation, pp. 131–198, 2016.
- Medusa: Simple llm inference acceleration framework with multiple decoding heads. arXiv preprint arXiv: 2401.10774, 2024.
- Accelerating large language model decoding with speculative sampling. arXiv preprint arXiv:2302.01318, 2023a.
- Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021.
- The lottery ticket hypothesis for pre-trained bert networks. In Proceedings of NeurIPS, pp. 15834–15846, 2020.
- Cascade speculative drafting for even faster llm inference. arXiv preprint arXiv:2312.11462, 2023b.
- Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021.
- Flash-decoding for long-context inference, 2023.
- Palm-e: An embodied multimodal language model. arXiv preprint arXiv:2303.03378, 2023.
- Depth-adaptive transformer. In Proceedings of ICLR, 2019.
- Reducing transformer depth on demand with structured dropout. In Proceedings of ICLR, 2020.
- Gptq: Accurate quantization for generative pre-trained transformers. In Proceedings of ICLR, 2023.
- Breaking the sequential dependency of llm inference using lookahead decoding, November 2023. URL https://lmsys.org/blog/2023-11-21-lookahead-decoding/.
- Mask-predict: Parallel decoding of conditional masked language models. arXiv preprint arXiv:1904.09324, 2019.
- Jointly masked sequence-to-sequence model for non-autoregressive neural machine translation. In Proceedings of ACL, pp. 376–385, 2020.
- Learning both weights and connections for efficient neural network. In Proceedings of NeurIPS, pp. 1135–1143, 2015.
- Teaching machines to read and comprehend. In Proceedings of NeurIPS, pp. 1693–1701, 2015.
- Squeezellm: Dense-and-sparse quantization. arXiv preprint arXiv:2306.07629, 2023.
- Efficient memory management for large language model serving with pagedattention. In Proceedings of SOSP, 2023.
- Fast inference from transformers via speculative decoding. In Proceedings of ICML, pp. 19274–19286, 2023.
- Solving quantitative reasoning problems with language models. arXiv preprint arXiv:2206.14858, 2022.
- Awq: Activation-aware weight quantization for llm compression and acceleration. arXiv preprint arXiv:2306.00978, 2023.
- Specinfer: Accelerating generative llm serving with speculative inference and token tree verification. arXiv preprint arXiv:2305.09781, 2023.
- Pass: Parallel speculative sampling. arXiv preprint arXiv:2311.13581, 2023.
- Webgpt: Browser-assisted question-answering with human feedback. arXiv preprint arXiv:2112.09332, 2021.
- Nvidia. Fastertransformer, a. URL https://github.com/NVIDIA/FasterTransformer.
- Nvidia. Tensorrt-llm, b. URL https://github.com/NVIDIA/TensorRT-LLM.
- OpenAI, T. Chatgpt: Optimizing language models for dialogue. OpenAI, 2022.
- Deepspeed: System optimizations enable training deep learning models with over 100 billion parameters. In Proceedings of SIGKDD, pp. 3505–3506, 2020.
- Code llama: Open foundation models for code. arXiv preprint arXiv:2308.12950, 2023.
- Accelerating transformer inference for translation via parallel decoding. 2023.
- Get to the point: Summarization with pointer-generator networks. In Proceedings of ACL, pp. 1073–1083, 2017.
- Megatron-lm: Training multi-billion parameter language models using model parallelism. arXiv preprint arXiv:1909.08053, 2019.
- Powerinfer: Fast large language model serving with a consumer-grade gpu. arXiv preprint arXiv:2312.12456, 2023.
- Accelerating llm inference with staged speculative decoding. arXiv preprint arXiv:2308.04623, 2023.
- Blockwise parallel decoding for deep autoregressive models. volume 31, 2018.
- Training with quantization noise for extreme model compression. In Proceedings of ICLR, 2021.
- Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023.
- LightSeq: A high performance inference library for transformers. In Proceedings of NAACL, pp. 113–120, 2021.
- Structured pruning of large language models. In Proceedings of EMNLP, pp. 6151–6162, 2020.
- Imitation learning for non-autoregressive neural machine translation. arXiv preprint arXiv:1906.02041, 2019.
- Speculative decoding: Exploiting speculative execution for accelerating seq2seq generation. In Proceedings of EMNLP, pp. 3909–3925, 2023.
- Structured pruning learns compact and accurate models. In Proceedings of ACL, pp. 1513–1528, 2022.
- Rethinking network pruning – under the pre-train and fine-tune paradigm. In Proceedings of NAACL, pp. 2376–2382, 2021.
- Predictive pipelined decoding: A compute-latency trade-off for exact llm decoding. arXiv preprint arXiv:2307.05908, 2023.
- Q8bert: Quantized 8bit bert. In Proceedings of EMC2-NIPS, pp. 36–39, 2019.
- Draft & verify: Lossless large language model acceleration via self-speculative decoding. arXiv preprint arXiv:2309.08168, 2023.
- Know what you don’t need: Single-shot meta-pruning for attention heads. volume 2, pp. 36–42, 2021.
- MoEfication: Transformer feed-forward layers are mixtures of experts. In Findings of ACL, pp. 877–890, 2022.
- Distillspec: Improving speculative decoding via knowledge distillation. arXiv preprint arXiv:2310.08461, 2023.
- Weilin Zhao (22 papers)
- Yuxiang Huang (17 papers)
- Xu Han (270 papers)
- Chaojun Xiao (39 papers)
- Zhiyuan Liu (433 papers)
- Maosong Sun (337 papers)
- Wang Xu (16 papers)
- Xinrong Zhang (9 papers)
- Yewei Fang (7 papers)
- Kaihuo Zhang (4 papers)