- The paper introduces static headwise retention profiling to pre-allocate non-uniform KV cache budgets, preserving accuracy while reducing memory overhead.
- It details a novel grouping strategy that partitions attention heads for efficient memory reclamation, mitigating fragmentation and dynamic scheduling costs.
- The framework leverages ahead-of-time workload balancing to maximize GPU utilization and throughput under extreme multi-turn serving conditions.
Multi-turn LLM serving necessitates the persistent storage of growing attention-state historiesโformally, the Key-Value (KV) cacheโfor each user session. Unlike single-turn inference, this leads to linear growth in cache size with each conversational turn, rapidly saturating GPU memory and constraining throughput and scaling efficiency. While KV compression is an established mitigationโremoving less critical tokens to save memoryโuniform allocation across all attention heads is fundamentally mismatched with model-intrinsic retrieval patterns, causing unnecessary information loss for certain heads and degrading accuracy in complex multi-turn settings.
Non-uniform compression, which assigns differing retention lengths to each head based on importance scoring, solves much of the preservation challenge but cannot be practically deployed in high-throughput serving frameworks such as vLLM or SGLang due to three primary architectural mismatches:
- Page Fragmentation: Unified (monolithic) memory pages in current systems prevent effective reclamation of freed tokens from heads with low retention, causing significant waste.
- Dynamic Reclamation Bottleneck: Runtime compression decisions require complex, high-overhead page tracking and reclamation, stalling scheduling and prefill efficiency.
- GPU Workload Imbalance: Heterogeneous per-head retention disrupts thread block (KV-split) assignment, introduces stragglers, and causes severe underutilization in GPU backends optimized for regular workloads.
Empirical Motivation
The paper provides quantitative evidence that headwise retention rates in non-uniform compression are highly stable and model-intrinsic. Fine-grained analysis on models such as Qwen2.5-7B, Qwen3-4B, and LLaMA3.1-8B over diverse benchmarks shows that, while the absolute magnitude of required cache per head shifts across tasks, the relative distribution and ranking among heads is sharply preserved (Figure 1).
Figure 1: Per-head KV retention rates under non-uniform compression are highly stable across models and domains, motivating static group allocation.
This observation enables an offline profiling regime, wherein a modelโs headwise retention signature is determined a priori and then fixed per deployment, obviating the need for dynamic runtime adaptation and the associated system costs.
The Tangram Framework: System Components
Deterministic Budget Allocation
The first key technique is replacing runtime, input-dependent cache allocation with static per-head budgets derived from offline profiling (via FastKVzip or similar methods). The main process:
- Calibrate average and variance of per-head retention using a modest pilot set (n=50).
- Assign static budgets with a configurable safety margin factor (ฮฑ), ensuring no head is starved for context, preventing performance loss even on out-of-distribution tasks.
- Use these budgets to allocate exactly the required pages per head before execution, eliminating all runtime memory over-provisioning and dynamic compress-and-reclaim cycles.
The static allocation unlocks accurate resource planning and maximum batching aggressiveness, as the upper bound for GPU memory is now known before scheduling.
Figure 2: KV cache grows rapidly with session length, but non-uniform strategies more effectively preserve important information than uniform compression.
Head Group Page Management
To resolve the architectural inefficiency at the memory management layer, Tangram clusters attention heads with similar static retention profiles into Head Groups, each governed by an independent (vectorized) page table rather than a monolithic global one.
Ahead-of-Time (AOT) Workload Balancing
The final component leverages the fixed workload shape imposed by deterministic budgets to offline all GPU attention kernel scheduling:
Experimental Results
Tangramโs evaluation considers both accuracy and system-level metrics under extreme, realistic multi-turn serving conditions (100K+ context, concurrent requests):
- Accuracy: Under aggressive non-uniform compression, Tangramโs deterministic headwise allocations preserve benchmark accuracy at parity with SOTA methods such as KVzip, even as retention rate drops to 20%, outperforming uniformly allocated approaches especially on long-context tasks (Figure 5).
- Throughput: End-to-end throughput increases by up to 2.6ร compared to strong vLLM baselines, owing primarily to (i) elimination of all page reclaim overhead (Figure 6), (ii) fine-grained physical memory reclamation (Figure 7), and (iii) AOT-kernel partitioning (Figure 8, 13).
- Latency: Time-to-first-token (TTFT) remains flat under heavy load, showing that deterministic planning prevents the prefill and scheduling backoff that arises with dynamic schemes (Figure 9).
- Trade-off: Optimal head group sizes (G=4โ$8$) balance fragmentation and table management, universally maximizing effective throughput across tested hardware.
Figure 5: Tangramโs accuracy remains at parity with SOTA non-uniform methods over broad context scales despite aggressive cache reduction.
Figure 8: Throughput breakdown across benchmarks and methods reveals Tangramโs dominant gains under multi-turn, long-context conditions.
Figure 6: Page reclamation latency is eliminated in Tangram, a major bottleneck in prior systems.
Implications and Future Directions
Tangramโs findings have significant implications for LLM serving design:
- Non-uniform compression is algorithmically essential for long-context LLMs, but only when co-designed with system-level innovations to eliminate the fragmentation, scheduling, and kernel inefficiencies that heterogeneous memory brings.
- Static headwise retention profiles are stable and model-intrinsic, simplifying the control plane and enabling deterministic resource orchestration at all system stack layers.
- Grouping techniques generalize beyond compression: Future system designs for mixtures-of-experts models, hybrid architectures, or compressive memory systems can exploit similar grouping abstractions for partitioned management and scheduling.
Potential future work includes adaptive online adjustment for models that undergo continual pretraining or task-specific finetuning, hierarchical or context-aware clusterings for hybrid models, and integration with hardware that natively supports sub-block-level memory management or SMC parallelism.
Conclusion
Tangram represents a comprehensive co-design for practical, efficient non-uniform KV cache compression in multi-turn LLM serving. By statically profiling headwise retention, clustering heads for grouped memory management, and fully offlining workload partitioning, it translates the theoretical gains of compression into realized system throughput and preserves task accuracy under modern multi-session workloads. These design patterns offer promising avenues for scalable, production-grade deployment of increasingly context-hungry LLM architectures.
Figure 10: System overview of Tangram, highlighting the integration of deterministic allocation, head group paging, and AOT balancing.