Speculative pre-positioning: off-path decode for stateful inference sessions
This paper introduces speculative pre-positioning, a novel technique that reduces latency in stateful large language model inference by decoding off the critical path. Instead of waiting for all previous tokens to be processed, the method speculatively pre-positions key-value cache entries, enabling parallel decoding and significantly improving throughput for interactive applications.
背景メモ
本稿で扱う「投機的プリポジショニング」は、大規模言語モデル(LLM)の推論を高速化する新たな手法。LLMはプロンプト全体を毎回処理する「プリフィル」→トークンを1つずつ生成する「デコード」の2段階を経るが、このうちデコードがボトルネックとなる。従来の「投機的デコード」は簡易モデルで下書き→本モデルで検証する方式。これに対し、提案手法はKVキャッシュ(過去の計算結果のキャッシュ)が存在する「ステートフル」なセッションにおいて、将来使われそうなパスの計算結果をあらかじめ別スレッドで準備しておく(off-path decode)ことで、応答待ち時間を削減する。論文はarXivプレプリント(2606.29565)。著者らは、Web検索エージェントや対話型コード編集など、同じコンテキストで複数回の推論が走る実用シナリオでの高速化を狙っている。