LLM推論のKVキャッシュ必要量をオンライン推定
The KV Cache Working Set: Online Capacity Planning for LLM Inference Systems
この論文をやさしく読む
ひとことで言うと
目標のヒット率に必要なKVキャッシュ容量を、実行中のアクセスから見積もる方法。
何に役立つ?
LLM提供基盤でキャッシュを過不足なく用意するための容量計画に役立つと考えられる。
この研究の面白いところ
各容量を別々にシミュレーションせず、ページのLRUスタック距離から複数容量のヒット判定を行う。
どこまで分かった?
実運用トレースで推定値と実キャッシュ測定値が近いと報告する。要旨には具体的な誤差や対象システムの範囲は示されていない。
v1のアブストラクトに基づくAI解説。日本語訳とは別に、用途の解釈を含みます。
アブストラクトの日本語訳
接頭辞キャッシュは、大規模言語モデル(LLM)を効率よく提供するうえで重要であり、特に会話やツール使用の履歴が増えながらモデルを繰り返し呼ぶエージェント型の処理で役立つ。以前に処理した接頭辞のキー・バリュー(KV)状態を再利用し、同じ事前処理計算を避けられる。ただし効果は十分なKV状態を保持できるかに左右される。過去の全状態を保持する容量は高価で不要な場合も多く、容量不足はヒット率を大きく下げる。このため、目標ヒット率に必要な最小キャッシュ容量として定義する「KVキャッシュのワーキングセット」を求めることが重要になる。本論文は、LLM提供処理のワーキングセットをオンラインで推定する解析器KVSETを提案する。Mattsonのスタックアルゴリズムを使い、幅広い容量でのヒット率を効率的に見積もる。KVキャッシュの各ページについてLRUスタック距離を計算し、候補容量ごとのページ数と比較することで、容量ごとに個別のシミュレーションをせずにヒットするか判定する。これにより従来の容量別シミュレーションに比べ計算・メモリ負担を大幅に減らし、オンライン解析を実用的にする。さらに、目標ヒット率の達成に必要な接頭辞ページの最大LRU深さから最小容量を決める。実運用のLLM処理から収集したトレースで検証し、推定値が実際のキャッシュ環境での測定値に近いことを示す。公開実装はオンラインのリクエスト処理とオフラインのトレース再生の双方に対応する。
v1の要旨から自動生成。本文の精読・人による確認は未実施。
- 初稿
- 2026-09-23(UTC)
- 最新改訂
- 2026-09-23 · v1
- 査読・掲載
- 査読状況未確認
更新履歴
- v1 2026-09-23 この版を読む
取得できた版を表示。版の更新は査読済みを意味しません。過去版の本文差分は未解析です。
原文の要旨
Prefix caching is critical for efficient large language model (LLM) serving, particularly for agentic workloads that repeatedly invoke the model with a growing conversation and tool-use history. By reusing the key-value (KV) states of previously processed prefixes, prefix caching avoids redundant prefill computation. Its effectiveness, however, depends on retaining a sufficiently large set of KV cache states. Provisioning enough cache to preserve all historical KV states is prohibitively expensive and often unnecessary, whereas insufficient capacity can substantially degrade the cache hit rate. Determining the KV cache working set, defined as the minimum cache capacity required to achieve a target hit rate, is therefore essential for efficient cache provisioning and system design. We present KVSET, an online analyzer that estimates the KV cache working set of LLM serving workloads. KVSET uses the Mattson stack algorithm to efficiently estimate cache hit rates across a wide range of cache capacities. For each KV cache page, KVSET computes its LRU stack distance and compares it with the page number of each candidate capacity. This comparison determines whether the page would be a hit at each capacity without independently simulating every capacity configuration. KVSET therefore substantially reduces the computational and memory overhead of conventional capacity-by-capacity simulation and makes online working-set analysis practical. KVSET further determines the minimum cache capacity based on the maximum LRU depth among the prefix pages required to achieve the target hit rate. We validate KVSET using traces collected from production LLM workloads and show that its estimates closely match measurements from real cache deployments. The open-source implementation supports both online request processing and offline trace replay.
著者のコメント
9 pages, 4 figures
arXiv ID: 2609.27746 / 要約の誤りについて