Large language models have shown impressive capabilities across a variety of NLP tasks, yet their generating text autoregressively is time-consuming. One way to speed them up is speculative decoding, which generates candidate segments (a sequence of tokens) from a fast draft model that is then verified in parallel by the target model. However, the acceptance rate of candidate tokens from the draft model can be affected by several factors, such as the model, the dataset, and the decoding setup. This paper proposes to sample multiple candidates from a draft model and then organise them in batches for verification. We design algorithms for efficient multi-candidate verification while maintaining the distribution of the target model. Our approach shows significant improvements in acceptance rates across datasets, models, and decoding setups, consistently outperforming standard speculative decoding. Our code and data are available at https://github.com/NJUNLP/MCSD .

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Multi-candidate Speculative Decoding

  • Sen Yang,
  • Shujian Huang,
  • Xinyu Dai,
  • Jiajun Chen

摘要

Large language models have shown impressive capabilities across a variety of NLP tasks, yet their generating text autoregressively is time-consuming. One way to speed them up is speculative decoding, which generates candidate segments (a sequence of tokens) from a fast draft model that is then verified in parallel by the target model. However, the acceptance rate of candidate tokens from the draft model can be affected by several factors, such as the model, the dataset, and the decoding setup. This paper proposes to sample multiple candidates from a draft model and then organise them in batches for verification. We design algorithms for efficient multi-candidate verification while maintaining the distribution of the target model. Our approach shows significant improvements in acceptance rates across datasets, models, and decoding setups, consistently outperforming standard speculative decoding. Our code and data are available at https://github.com/NJUNLP/MCSD .