Cross-layer key-value (KV) compression has been found to be effective in efficient inference of large language models (LLMs). Although they reduce the memory consumption of the KV cache, such methods usually introduce non-negligible performance degradation. In this work, we aim to enhance the performance of YOCO, a cross-layer KV compression method that shares the KVs of the middle layer with the top-half layers. We propose YOCO++, an enhanced YOCO that incorporates a weighted residual connection between the KVs of each bottom-half layer and the bottom layer. Compared to YOCO, YOCO++ increases model capacity while maintaining the same training and inference efficiency. Our experiments show that YOCO++ achieves state-of-the-art performance among the cross-layer KV compression methods at a 50% KV cache compression rate, outperforming the standard Transformer.
Figures & tables
Figure 1: Illustration of YOCO and YOCO++. KVs that need to be cached are indicated by red boxes. (a) YOCO caches the KVs of the bottom-half layers and shares the KVs of the middle layer with the top-half layers. (b) Based on YOCO, YOCO++ introduces a weighted residual connection between the KVs of each bottom-half layer and the bottom layer and caches the combined KVs.
Figure 2: Learned residual weights of a 22-layer YOCO++ model without (left) and with (right) the scaling factor.
Figure 3: Prefilling latency (left) and decoding throughput (right) on an NVIDIA H20 (96GB) GPU at different sequence lengths.
Model
HellaSwag
OBQA
WinoGrande
ARC-c
ARC-e
PIQA
Avg
Transformer
51.25
33.0
56.04
27.56
52.1
70.29
48.37
YOCO
51.21
32.0
53.59
29.01
51.43
70.62
47.98
FusedKV-Lite
52.28
32.8
54.93
28.24
52.19
70.13
48.43
FusedKV
52.04
32.0
55.48
28.67
51.98
70.35
48.42
YOCO++
52.30
34.0
55.48
27.90
53.11
71.16
48.99
Table 1: Zero-shot accuracy on commonsense reasoning tasks.
Figure 4: Training loss curves on a 100B subset of the SlimPajama dataset.
Model
Valid Loss
Transformer
2.4266
YOCO
2.4372
FusedKV-Lite
2.4258
FusedKV
2.4204
YOCO++
2.4194
w/o scaling
2.4333
Table 2: Ablations of YOCO++ trained on a 10B subset of the SlimPajama dataset. We report the validation loss on a 10M subset of the SlimPajama validation set.
LLM inference acceleration develops algorithms and systems that reduce language-model latency, memory use, and serving cost while preserving output quality.
The increasing memory demand of the Key-Value (KV) cache poses a significant bottleneck for Large Language Models (LLMs) in long-context applications. Existing low-rank KV compression methods reduce this footprint by modifying model projections, limiting the flexibility to switch back to standard full-cache inference when sufficient memory is available. In this paper, we propose EchoKV, a flexible KV cache compression framework that supports on-demand transitions from full KV caching to compressed caching. Unlike traditional compression-decompression paradigms, EchoKV utilizes a lightweight network to reconstruct the discarded KV components from a partial subset, exploiting intrinsic inter-layer and intra-layer similarities among attention heads. We further introduce a lightweight two-stage fine-tuning strategy, requiring only a few minutes on a single A100 GPU for a 7B model. Experimental results on LongBench and RULER demonstrate that EchoKV consistently outperforms existing methods across multiple compression ratios and backbone models while preserving the throughput of full-cache inference in short-context scenarios.
Shiyu Ji, Yixuan Wang, Yijun Liu +2
Research Center for Social Computing and Interactive Robotics, Harbin Institute of Technology, China
Long-context LLM inference is increasingly limited by the memory and bandwidth cost of KV caches, yet aggressive compression can remove the layer-specific evidence needed for retrieval and multi-step reasoning. We introduce FreqDepthKV, an inference-time cache compression method that factorizes adjacent-layer KV states into shared low-frequency depth components and sparse high-frequency residuals. A lightweight online probe assigns attention heads to shared-depth, residual-depth, or exact cache modes according to their contribution to reconstruction-sensitive attention logits, allowing the compression policy to adapt to prompt structure without retraining. Across long-context question answering, needle retrieval, summarization, and code generation benchmarks, FreqDepthKV preserves task accuracy under substantially smaller cache budgets. With a 32k-token prefill window, FreqDepthKV reaches 58.3 Exact Match, 63.0 F1, 32.5 ROUGE-L, and 48.1 pass@1, closely matching full KV while outperforming prior compressed-cache methods. It also improves decoding throughput to 70.4 tokens/s, reduces TTFT to 2.06 seconds, and lowers peak KV memory to 6.2 GB, achieving a 3.9x effective compression ratio.
Anna Córdoba, Adam Puente Tercero, Nerea Angulo Hijo +4
KV cache eviction methods typically use a single retention-rule family throughout a model, making eviction-method identity a model-level design choice. Yet Transformer layers differ substantially in their attention behavior, representations, and sensitivity to compression, suggesting that a uniform rule may overlook useful layer-wise structure. This raises a basic question: should eviction methods themselves vary across layers? We investigate this question by composing existing eviction methods across Transformer layers and systematically exploring the resulting layer-wise design space. Using simple offline profiles, we construct fixed routes and study how their quality varies with method placement and cache budget. On LongBench, heterogeneous routing improves performance on a majority of tasks over homogeneous policies at the same cache budget. Even when method counts are held fixed, the profile-guided placement ranks second among 100 evaluated assignments, demonstrating that routing quality depends strongly on where methods are placed. Moreover, the same fixed route outperforms the best of nine standalone baselines across all five tested cache budgets. Together, these results establish layer-wise method composition as an exploitable, placement-sensitive design dimension for KV cache compression.
Chao Fei, Kaihua Liang, Hanzhi Hu +4
King Abdullah University of Science and Technology · Fudan University