Abstract
Serving Large Language Models (LLMs) at scale is resource-intensive, often resulting in high latency and missed Service Level Objectives (SLOs). Traditional caching mechanisms, such as exact-match or LRU-based eviction, fail to capture the semantic nuances of natural language and the stable popularity of query clusters. This paper introduces SISO (Similar Input? Similar Output!), a novel semantic caching system designed for LLM serving. SISO employs centroid-based caching, semantic locality-aware replacement, and dynamic threshold adjustment. Experimental results demonstrate that SISO achieves up to 1.71× higher hit ratios and significantly improved SLO attainment compared to state-of-the-art systems like GPTCache.
Introduction
The rapid adoption of LLMs has placed immense pressure on serving infrastructure. While caching previously computed responses can mitigate load, traditional "exact-match" caches are brittle, failing when queries differ by even a single word (e.g., "What is AI?" vs. "Define AI"). Existing semantic caches attempt to address this using vector embeddings but often rely on outdated heuristics like Least Recently Used (LRU) eviction. These policies ignore the "clumpy" nature of semantic space, leading to inefficient memory usage and the premature eviction of valuable query clusters.
The SISO Architecture
SISO departs from traditional caching through three core design principles:
- Centroid-Based Caching: Instead of storing every individual query vector, SISO clusters similar historical queries and stores only the centroid (the mathematical center) of that cluster. This representative approach allows the cache to cover a wider range of potential queries using a fraction of the memory.
- Semantic Locality-Aware Replacement: Recognizing that semantic popularity is stable over time, SISO prioritizes keeping centroids that represent "dense" regions of the embedding space (high semantic locality) rather than relying on simple recency.
- Dynamic Threshold Adjustment: SISO balances accuracy and speed by adjusting similarity thresholds based on system load. Under heavy load (high RPS), the threshold is lowered to increase cache hits and protect the LLM; under light load, it is tightened to ensure high-quality responses.
Experimental Evaluation
SISO was evaluated across diverse datasets, including QQP, MRPC, MQP, MSMARCO, Reddit, and ShareGPT. The results indicate a significant performance boost over traditional heuristics. As shown in the evaluation against Quora and Reddit datasets, SISO's semantic-aware approach consistently yields higher hit ratios across various cache capacities compared to standard LRU and LFU policies.
Key Results
- Hit Ratio Boost: SISO delivered up to 1.71× higher hit ratios compared to GPTCache by better managing cache space through centroids.
- SLO Attainment: In high-intensity workloads (30 requests per second), SISO maintained high SLO attainment while baseline systems like vLLM and GPTCache saw performance collapse.
- Latency Reduction: SISO achieved 1.7× faster cache lookups than GPTCache by optimizing the HNSW search algorithm to prioritize high-locality centroids.
Key Insights
- Semantic Stability: Semantic popularity is more stable than data block access patterns in traditional systems. If a topic is popular today, it is likely to remain so, making aggressive LRU eviction counterproductive.
- Input-Output Correlation: The authors confirmed a strong linear relationship between input similarity and output similarity, validating the core premise of semantic caching.
- Memory Efficiency: By caching centroids, SISO can achieve the same hit ratio as a standard vector cache while using significantly less memory.
Conclusion and Future Work
SISO represents a significant advancement in LLM caching by moving beyond traditional heuristics. However, it currently focuses on single-turn queries and can be sensitive to small input changes in domains like code generation, where a single character can drastically alter the required output. Future work will explore extending the SISO architecture to handle the complexities of multi-turn conversations and integrating it with prefix caching techniques.
Summary updated