Block Verification Accelerates Speculative Decoding

要約

投機的デコードは、推論中に大規模な言語モデルをロスレスで高速化するための効果的な方法です。
高速モデルを使用してトークンのブロックを作成し、ターゲット モデルによって並行して検証され、出力がターゲット モデルからのサンプルと同一に配布されることが保証されます。
以前の作業では、ドラフト検証はトークンごとに独立して実行されていました。
驚くべきことに、このアプローチは最適ではないことがわかりました。
私たちは、ブロック全体を共同で検証し、実時間のさらなる高速化を実現する単純なドラフト検証アルゴリズムであるブロック検証を提案します。
私たちは、提案されたメカニズムが各反復で生成されるトークンの予想数において最適であり、具体的には標準のトークンレベルの検証よりも決して悪いものではないことを証明します。
経験的に、ブロック検証は、さまざまなタスクやデータセットにおいて、標準のトークン検証アルゴリズムよりもわずかではありますが一貫した実測速度の 5% ~ 8% の高速化を実現します。
ブロック検証がコードの複雑さを増やさず、標準の投機的復号化検証アルゴリズムの強力なロスレス保証を維持し、パフォーマンスを低下させることがなく、実際に一貫してパフォーマンスを向上させることを考えると、これは投機的復号化実装の適切なデフォルトとして使用できます。

要約(オリジナル)

Speculative decoding is an effective method for lossless acceleration of large language models during inference. It uses a fast model to draft a block of tokens which are then verified in parallel by the target model, and provides a guarantee that the output is distributed identically to a sample from the target model. In prior works, draft verification is performed independently token-by-token. Surprisingly, we show that this approach is not optimal. We propose Block Verification, a simple draft verification algorithm that verifies the entire block jointly and provides additional wall-clock speedup. We prove that the proposed mechanism is optimal in the expected number of tokens produced each iteration and specifically is never worse than the standard token-level verification. Empirically, block verification provides modest but consistent wall-clock speedups over the standard token verification algorithm of 5%-8% in a range of tasks and datasets. Given that block verification does not increase code complexity, maintains the strong lossless guarantee of the standard speculative decoding verification algorithm, cannot deteriorate performance, and, in fact, consistently improves it, it can be used as a good default in speculative decoding implementations.

arxiv情報

著者 Ziteng Sun,Uri Mendlovic,Yaniv Leviathan,Asaf Aharoni,Ahmad Beirami,Jae Hun Ro,Ananda Theertha Suresh
発行日 2024-07-25 17:51:50+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL, cs.DS, cs.IT, cs.LG, math.IT パーマリンク