벡터 큐를 사용한 적응형 의미 프롬프트 캐싱
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) 생성 응답을 재사용하여 의미적으로 유사한 프롬프트에 대한 대기 시간과 비용을 줄입니다. 벡터 유사성 메트릭은 임베디드 프롬프트와 캐시 내 가장 가까운 이웃 간 유사성을 양적으로 평가하는 숫자 점수를 할당합니다. 기존 시스템은 유사성 점수가 캐시 히트로 이어질 충분히 높은지를 분류하기 위해 정적 임계값에 의존합니다. 우리는 이 일률적 임계값이 다른 프롬프트에서는 충분하지 않음을 보여줍니다. 우리는 임베딩의 복잡성과 불확실성에 적응하는 임베딩별 임계값 영역을 학습하는 VectorQ 프레임워크를 제안합니다. 네 가지 다양한 데이터셋의 결합을 통한 평가를 통해, 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