TL;DR
DynSplit-KV introduces a dynamic semantic splitting framework for Key-Value (KV) cache compression to handle long-context LLM inference efficiently. By dynamically identifying context-dependent semantic delimiters and mapping variable-length blocks into uniform formats, it eliminates the severe accuracy drops of rigid splitting methods while delivering up to a 2.2× inference speedup and a 2.6× reduction in peak memory.
What Problem Does This Paper Address?
As Large Language Models (LLMs) scale to handle massive context windows (from 100K to over 1M tokens), the Key-Value (KV) cache becomes a massive memory bottleneck. To mitigate this, researchers use KV cache compression, which typically involves splitting the cache into blocks and evicting or archiving less important ones.
However, existing approaches rely on rigid splitting strategies:
- Fixed intervals: Splitting text every $N$ tokens, which completely ignores semantic boundaries.
- Pre-defined delimiters: Splitting based on static punctuation (like periods or commas).
The authors reveal that these rigid strategies cause severe accuracy degradation (ranging from 5.5% to 55.1%) because semantic boundaries are highly dependent on the specific scenario (e.g., natural language vs. source code). Static punctuation fails to adapt to diverse text types, while variable-length semantic blocks introduce massive parallelization overhead (over 73.1% extra latency) during hardware execution.
Methods
To solve these challenges, the authors propose DynSplit-KV, which consists of two core components:
1. Dynamic Importance-Aware Delimiter Selection (DD-Select)
Instead of treating all punctuation equally, DD-Select dynamically scores potential delimiters during the prefill stage. It uses an attention-dependency metric to evaluate how much future tokens rely on the context immediately preceding a delimiter versus more distant context. The algorithm balances this semantic importance score with a length regularization factor to ensure chunks don't become excessively long or short.
2. Variable-to-Fixed Block Mapping Strategy (V2F)
Splitting text dynamically results in variable-length blocks, which are notoriously inefficient for GPU parallelization. V2F compresses these variable-length blocks into fixed-length representations using element-wise maximum and minimum pooling across the tokens within each block. It then maps block-level importance scores back to token-level scores, enabling highly efficient, parallelized top-$k$ token selection without per-token scoring overhead.
Datasets
The authors evaluated DynSplit-KV across several long-context benchmarks:
- LongBench: A comprehensive benchmark covering single-document QA (NarrativeQA, Qasper), multi-document QA (HotpotQA, 2WikiMQA), summarization (Gov-R, MultiNews), few-shot learning (TriviaQA), and code tasks (Lcc, RepoBench-P).
- LongBench v2: Used to test ultra-long context capabilities (>64K tokens).
- Passkey Retrieval: A synthetic task designed to evaluate long-range dependency by hiding a needle-in-a-haystack passkey at varying depths within a large body of text.
Key Insights and Ideas
- Delimiters are Context-Dependent: The importance of a delimiter changes drastically based on the task. For instance, the normalized importance of characters like brackets
[or parentheses(varies by up to 45% between code and natural language, and up to 24% across different models. - Order Matters: Reversing the estimated importance order of delimiters while keeping all other compression parameters identical led to an accuracy drop of up to 28.6%, proving that identifying the correct semantic boundaries is critical to preserving model intelligence.
- Prefill Convergence: Delimiter importance scores stabilize very early during the prefill stage, converging within 0.1 using only a few tokens. This makes real-time dynamic splitting computationally viable for production deployment.
Key Results
DynSplit-KV was evaluated against state-of-the-art baselines including H2O, StreamingLLM, InfLLM, Quest, ChunkKV, and SentenceKV using models like Mistral-7B, LongChat-7b, and DeepSeek-R1-Distill-Llama-8B.
- Accuracy Preservation: At just 10% KV cache usage, DynSplit-KV consistently outperformed all baselines, achieving an average accuracy of 42.64% across LongBench—nearly matching the full attention baseline (42.72%) and recovering up to 49.9% accuracy over static methods.
- Inference Speedup: When integrated with FlashAttention, DynSplit-KV achieved up to a 2.2× speedup over full attention at an output length of 4096 tokens.
- Memory Efficiency: In memory-constrained CPU-GPU offloading setups, the framework delivered a 2.4× maximum speedup and reduced peak GPU memory consumption by up to 2.64× under heavy batch sizes.
Limitations and Future Work
While DynSplit-KV demonstrates impressive efficiency gains, the authors note that the current implementation introduces a minor computational overhead during the initial delimiter scoring step (Step 1 of the V2F pipeline). Although this overhead represents a tiny fraction of total inference time, future work will focus on further optimizing KVCache compression frameworks based on dynamic semantic splitting to achieve even lower latency.
Summary updated