Abstract
AdaptCache is a novel storage system designed to optimize Large Language Model (LLM) serving by intelligently managing Key-Value (KV) caches across a hierarchy of DRAM and SSD. By adaptively selecting compression algorithms and storage locations based on a "marginal utility" metric, AdaptCache reduces Time to First Token (TTFT) by up to 2.4x while maintaining significantly higher generation quality compared to static compression methods.
Introduction
As Large Language Models (LLMs) scale to handle massive documents and long conversation histories, the resulting Key-Value (KV) caches—mathematical representations of context used to avoid redundant computation—can reach terabytes in size. This creates a "memory wall": high-speed DRAM is too small to store these caches, forcing offloading to slower SSDs. The resulting loading delays often negate the benefits of caching. Existing solutions typically rely on "one-size-fits-all" compression or simple eviction policies (like LRU) that fail to account for how different text segments respond to compression, leading to either poor performance or degraded model accuracy.
System Design and Methods
AdaptCache introduces the first hierarchical KV cache storage system leveraging adaptive lossy compression. Instead of uniform treatment, the system makes fine-grained decisions for every cache entry regarding the compression algorithm (e.g., Token Dropping vs. Quantization), the compression rate, and the physical device placement (DRAM vs. SSD).
These decisions are guided by a Utility Metric, framing cache management as a Multi-Choice Knapsack Problem (MCKP). The system calculates the "marginal utility" of each entry—a weighted sum of expected reuse frequency, quality loss from compression, and latency savings from faster storage. The architecture comprises three main components:
- Estimator: Profiles quality-delay trade-offs for various tasks offline.
- Policy Optimizer: Employs a greedy algorithm to select strategies with the highest marginal utility.
- Executor: Performs the actual compression and data movement.
Evaluation
The researchers evaluated AdaptCache using the Llama-3.1-8B-Instruct model across six datasets from the LongBench benchmark, representing three task types: Summarization (qmsum, samsum), Question Answering (triviaqa, hotpotqa), and Coding (lcc_e, repobench_p_e).
Key Results
AdaptCache demonstrates a superior Pareto frontier across all tested domains, balancing generation quality and system latency more effectively than fixed-compression baselines.
- Latency Reduction: AdaptCache achieved a 1.43x to 2.4x lower TTFT compared to the strongest fixed-compression baselines.
- Quality Preservation: At equivalent delay levels, AdaptCache provided 6% to 55% higher generation quality (measured via ROUGE-L, F1, or CodeBLEU scores).
- Storage Efficiency: By compressing intelligently, AdaptCache significantly increased DRAM hit rates—for instance, from 38% to 81% in coding tasks—allowing more "valuable" data to remain in fast storage.
Discussion and Future Work
A key insight of this work is that KV caches are not created equal; context-aware compression is vital. Critical segments (like the beginning or end of a document) are protected from heavy compression, while more resilient middle sections are shrunk to save space. Furthermore, high-frequency reuse justifies aggressive compression to keep data in DRAM, trading minor quality loss for massive speed gains.
While highly effective, the current greedy optimization approach may not reach the theoretical global optimum. Future work includes refining the profiling overhead of the Estimator and extending the adaptive logic to multi-node distributed clusters where network latency introduces additional complexity.
Summary updated