ベクトルQを用いた適応型セマンティックプロンプトキャッシング
Adaptive Semantic Prompt Caching with VectorQ
February 6, 2025
著者: Luis Gaspar Schroeder, Shu Liu, Alejandro Cuadron, Mark Zhao, Stephan Krusche, Alfons Kemper, Matei Zaharia, Joseph E. Gonzalez
cs.AI
要旨
意味的なプロンプトキャッシュは、類似の意味を持つプロンプトに対してキャッシュされた大規模言語モデル(LLM)生成応答を再利用することで、LLM推論の遅延とコストを削減します。ベクトル類似度メトリクスは、埋め込まれたプロンプトとキャッシュ内の最近傍の間の類似性を数量化する数値スコアを割り当てます。既存のシステムは、類似性スコアが十分に高いかどうかを判定するために静的な閾値に依存しています。私たちは、このワンサイズフィットオールの閾値が異なるプロンプト間で不十分であることを示します。私たちは、埋め込みの複雑さと不確実性に適応する埋め込み固有の閾値領域を学習するためのVectorQフレームワークを提案します。4つの異なるデータセットの組み合わせでの評価を通じて、VectorQがすべての静的閾値で最先端のシステムを一貫して上回り、キャッシュヒット率が最大12倍向上し、エラーレートが最大92%削減されることを示します。
English
Semantic prompt caches reduce the latency and cost of large language model
(LLM) inference by reusing cached LLM-generated responses for semantically
similar prompts. Vector similarity metrics assign a numerical score to quantify
the similarity between an embedded prompt and its nearest neighbor in the
cache. Existing systems rely on a static threshold to classify whether the
similarity score is sufficiently high to result in a cache hit. We show that
this one-size-fits-all threshold is insufficient across different prompts. We
propose VectorQ, a framework to learn embedding-specific threshold regions that
adapt to the complexity and uncertainty of an embedding. Through evaluations on
a combination of four diverse datasets, we show that VectorQ consistently
outperforms state-of-the-art systems across all static thresholds, achieving up
to 12x increases in cache hit rate and error rate reductions up to 92%.Summary
AI-Generated Summary