Adaptieve semantische promptcaching met VectorQ
Adaptive Semantic Prompt Caching with VectorQ
February 6, 2025
Auteurs: Luis Gaspar Schroeder, Shu Liu, Alejandro Cuadron, Mark Zhao, Stephan Krusche, Alfons Kemper, Matei Zaharia, Joseph E. Gonzalez
cs.AI
Samenvatting
Semantische promptcaches verminderen de latentie en kosten van grote taalmodellen (LLM) door gecachte LLM-generieke reacties op semantisch vergelijkbare prompts te hergebruiken. Vectorgelijkheidsmetrieken kennen een numerieke score toe om de gelijkenis tussen een ingebedde prompt en zijn dichtstbijzijnde buur in de cache te kwantificeren. Bestaande systemen vertrouwen op een statische drempel om te classificeren of de gelijkenisscore voldoende hoog is om te resulteren in een cache-hit. We tonen aan dat deze one-size-fits-all drempel ontoereikend is voor verschillende prompts. We stellen VectorQ voor, een framework om inbeddingspecifieke drempelregio's te leren die zich aanpassen aan de complexiteit en onzekerheid van een inbedding. Door evaluaties op een combinatie van vier uiteenlopende datasets tonen we aan dat VectorQ consequent beter presteert dan state-of-the-art systemen over alle statische drempels, met een toename van de cache-hitrate tot wel 12x en een vermindering van de foutenpercentages tot wel 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