TL;DR
Serving large language models (LLMs) is a major bottleneck due to their massive memory footprint, largely driven by the KV cache. This paper provides a comprehensive survey of "system-aware KV infrastructure for serving LLMs" (sKis), categorizing existing optimization techniques across temporal, spatial, and structural system behaviors. By analyzing their impact and interdependencies, the authors offer a structured understanding and highlight crucial open challenges for efficient and trustworthy LLM serving.
What Problem Does This Paper Address?
Large Language Models (LLMs) have revolutionized AI, but deploying them efficiently for real-world applications is a significant challenge. A primary culprit is the KV cache, a crucial component for speeding up autoregressive decoding by storing intermediate key and value tensors. As LLMs handle longer contexts, this cache can balloon to millions of tokens, becoming a major memory bottleneck and driving up serving costs. While many techniques aim to optimize LLM efficiency, there's a need for a systematic understanding of how system-aware optimizations specifically targeting the KV cache can improve serving-time performance (latency, throughput, memory usage) without altering the LLM's core architecture or weights. This paper aims to fill that gap by providing a structured survey and taxonomy of these "sKis" methods.
Methods
The paper's core contribution is a novel taxonomy that categorizes KV cache optimization techniques based on three fundamental system behaviors:
- Temporal Behavior (Execution & Scheduling): How and when KV data is accessed, computed, or scheduled. This includes:
- KV-centric Scheduling (KVS): Prioritizing requests based on KV usage, reuse potential, or attention contributions.
- Pipelining & Overlapping (OVLP): Hiding KV-related latency by overlapping compute, I/O, and communication.
- Hardware-aware Execution (HAE): Adapting KV operations to heterogeneous hardware, including disaggregated inference and compute offloading.
- Spatial Behavior (Placement & Migration): Where KV data is placed or moved across memory tiers or devices. This covers:
- Memory Hierarchy KV Orchestration (MHO): Distributing KV caches across GPU HBM, CPU DRAM, or SSDs, often with importance-aware policies.
- Compute Device KV Orchestration (CDO): Placing and moving KV across compute-capable devices for distributed or heterogeneous serving.
- Structural Behavior (Representation & Retention): How KV data is compressed or managed. This includes:
- KV Cache Compression (KVCC): Reducing memory usage via quantization, low-rank approximation, or structural compression.
- KV Cache Retention Management (KVRM): Efficiently managing KV cache allocation, reuse, and eviction.
The authors then analyze the impact of these behaviors on serving objectives (latency, throughput, memory, etc.) and their co-design affinities.
Datasets
The paper is a survey and does not present new experimental results or introduce new datasets. It reviews existing work that typically evaluates methods on standard LLM benchmarks and real-world serving traces.
Key Insights and Ideas
- KV Cache is King for Serving Efficiency: The KV cache is identified as a primary target for optimization, crucial for achieving low-latency and high-throughput LLM inference.
- A Unified Behavioral Taxonomy: The temporal, spatial, and structural behavior framework provides a powerful lens to understand and compare diverse KV optimization techniques, moving beyond lifecycle or layer-based categorizations.
- Structural Optimizations Dominate Memory Savings: KV cache compression (KVCC) is the most studied area, directly reducing memory footprint. However, these savings don't always translate to system gains without co-design.
- Temporal Behaviors Directly Impact Latency/Throughput: KVS, OVLP, and HAE offer the most direct improvements to latency and throughput by reducing scheduling stalls, pipeline bubbles, and device under-utilization.
- HAE-CDO is a Strong Co-design Pattern: Combining hardware-aware execution with compute device orchestration is a prevalent and effective strategy, especially for exploiting device heterogeneity.
- KVCC is Isolated Despite Popularity: KV cache compression, while popular, is often developed in isolation, suggesting a missed opportunity for co-design with other behaviors.
- Energy Efficiency is Under-Explored: Despite the growing demand for energy-efficient AI, energy metrics are rarely reported or optimized in sKis methods.
- Quality Loss is Universal but Controllable: Most optimizations involve some form of quality degradation (e.g., reduced precision, missed context). The key challenge is ensuring this degradation is controllable and manageable.
- Benchmarking Needs Standardization: A fundamental challenge is the lack of unified benchmarks and consistent metric definitions, hindering reliable comparisons across research.
Key Results
The paper doesn't present new experimental results but synthesizes findings from a vast body of literature. Key "results" are the insights derived from this synthesis:
- Behavior-Objective Impact: Temporal behaviors (KVS, OVLP, HAE) most directly impact latency and throughput. Structural behaviors (KVCC, KVRM) primarily target memory savings. Spatial behaviors (MHO, CDO) address interconnect I/O.
- Co-occurrence Patterns: Hardware-aware execution (HAE) and Compute Device KV Orchestration (CDO) are frequently co-designed. KV cache compression (KVCC) is surprisingly isolated from other behaviors.
- Research Density: Structural optimizations (KVCC, KVRM) are the most studied, followed by temporal behaviors. Spatial behaviors are less explored but growing.
- Takeaways for Each Behavior Category: The paper provides detailed takeaways for each behavioral category, summarizing common strategies, effective techniques, and limitations observed in existing work.
Limitations and Future Work
Limitations:
- The survey is comprehensive but acknowledges that due to the rapidly evolving nature of the field, some valuable contributions might have been overlooked.
- The analysis synthesizes results from public papers and implementations, which may be constrained by specific platform and configuration choices.
Future Work (Open Challenges):
- SLO-driven Tail Control: Developing methods to reliably control tail latency and meet Service-Level Objectives (SLOs), especially under long contexts and bursty traffic, requiring cross-behavior co-design.
- Energy-Aware sKis: Integrating energy profiling and optimization into serving systems, moving beyond average quality to consider per-request energy costs.
- Trustworthy and Efficient sKis: Ensuring that efficiency gains do not compromise trustworthiness (reliability, privacy, safety), especially concerning worst-case failures and quality lower bounds.
- Generalizable HAE-CDO: Developing portable and adaptive HAE-CDO policies that work across diverse heterogeneous hardware topologies and multi-tenant settings.
- Co-optimization and Intermediate Semantics: Exploring co-optimization of behaviors (e.g., eviction, compression, migration) using intermediate semantics to bridge binary decisions and enable smoother transitions.
- Unified Benchmarks: Establishing standardized benchmarks with consistent metrics, workloads, and reporting standards to enable reliable comparisons and reproducibility.
Summary updated