EchoKV: Efficient KV Cache Compression via Similarity-Based Reconstruction

Shiyu Ji, Yixuan Wang, Yijun Liu, Qingfu Zhu, Wanxiang ChearXiv 2026

TL;DR

EchoKV introduces a highly flexible, on-demand Key-Value (KV) cache compression framework that avoids modifying the base model's parameters. By dropping a portion of the KV cache and using a lightweight linear network to reconstruct the missing components on the fly, EchoKV allows large language models (LLMs) to seamlessly switch between full-cache and compressed inference depending on available memory.

What Problem Does This Paper Address?

As Large Language Models (LLMs) scale to handle massive context windows for applications like repository-scale code generation and deep reasoning, the memory footprint of the Key-Value (KV) cache grows linearly, creating a severe hardware bottleneck.

To mitigate this, recent state-of-the-art approaches rely on low-rank matrix factorization (like SVD) to compress the KV cache dimensions. However, these methods permanently alter the model's projection weights. This parameter modification introduces a rigid trade-off: even when an application processes short contexts and memory is abundant, the model remains stuck in a compressed state, suffering from unnecessary throughput degradation. Online token-eviction methods offer some flexibility but introduce significant latency overhead and struggle under tight memory budgets.

EchoKV tackles this rigidity by decoupling compression from parameter modification, enabling on-demand runtime switching between standard full-cache inference and compressed inference.

Methods

Instead of compressing the entire KV cache uniformly via parameter decomposition, EchoKV simply discards a subset of the KV cache features at runtime and uses a lightweight network to predict the missing values from what remains.

Figure 1: Illustration of the differences between existing low-rank sharing approaches and EchoKV. Unlike the compression-decompression paradigm, EchoKV employs a lightweight network to recon- struct the discarded KV components from retained ones.

The framework exploits two types of inherent redundancies in LLM attention heads:

  1. Inter-layer Similarity (Global Inputs): Layers are partitioned into groups. The first layer in each group retains its full KV cache, serving as a "global" anchor to help predict the cache of subsequent layers in the same group.
  2. Intra-layer Similarity (Local Inputs): For the compressed layers, EchoKV retains a small, contiguous prefix subset of the flattened KV dimensions to preserve fine-grained, layer-specific details.

A simple linear layer ($W_i$) takes the concatenated global and local features of a token and reconstructs the evicted cache segments.

Two-Stage Training Strategy

To make this lightweight network effective and fast to train, the authors design a two-stage optimization process:

  • Stage 1 (Initialization): The network is trained using a standard Mean Squared Error (MSE) loss directly on the Key-Value pairs (KV-MSE) to quickly align the feature representations.
  • Stage 2 (Adaptation): The network is refined using an Output MSE (O-MSE) loss, which measures the difference in the final attention output. Crucially, O-MSE bypasses the need to materialize the massive $L \times L$ attention matrix, making it fully compatible with FlashAttention and nearly $3\times$ faster than standard KL-divergence training.

Datasets

  • Training: The reconstruction network is trained primarily on Long Alpaca (1.6K samples). To test data robustness, the authors also experimented with standard Alpaca, ShareGPT, and a subset of the C4 pre-training corpus.
  • Evaluation: Performance was validated using two rigorous long-context benchmarks:
  • LongBench: A benchmark composed of real-world long-context tasks (QA, summarization, etc.).
  • RULER: A synthetic long-context benchmark designed to test effective context window limits.
  • Backbone Models: Evaluated across multiple scales using Llama3.1-8B-Instruct, Mistral-7B-Instruct-v0.3, and Mistral-Small-24B-Instruct-2501.

Key Insights and Ideas

  • Asymmetric Reconstruction Difficulty: One of the paper's most compelling findings is that Values ($V$) are significantly easier to reconstruct via similarity than Keys ($K$). When the authors restricted compression to only one component, compressing Keys caused severe performance drops, whereas compressing Values remained highly stable. This suggests that future KV compression techniques should treat Keys and Values heterogeneously.
  • Data Insensitivity: The lightweight reconstruction network acts as a calibrator for model-specific structural similarities within the KV space rather than learning semantic features. As a result, training on noisy pre-training data (C4) yields virtually identical downstream performance to training on clean, long-context instruction data.
  • The Necessity of Two-Stage Loss: Training on attention space (O-MSE) from scratch fails because the optimization signal is too indirect before the network learns basic feature alignment. The initial KV-MSE step is essential to provide a stable starting point.

Key Results

  • Near-Lossless Performance: On both LongBench and RULER, EchoKV consistently outperformed strong SVD baselines (like Palu and CommonKV). At a 0.5 compression ratio, EchoKV achieved nearly lossless performance relative to the uncompressed baseline.
  • Throughput Preservation: Because EchoKV leaves the base model parameters untouched, it preserves the high throughput of standard full-cache inference for short-context inputs, avoiding the computational overhead that plagues SVD-modified models.
  • Ultra-Long Context Viability: In real-world serving scenarios (batch size 8 on a single A100 GPU), baseline SVD methods suffered from out-of-memory (OOM) errors beyond 16K tokens due to peak-memory overhead during the pre-fill phase. EchoKV successfully completed inference tasks up to 36K tokens by dynamically dropping unnecessary cache entries early on.
  • Highly Efficient Training: Due to the simplicity of the linear architecture (<50M parameters for a 7B model), training takes only a few minutes on a single A100 GPU.

Limitations and Future Work

  • Simple Selection Heuristics: EchoKV currently uses a straightforward, prefix-based contiguous rule to select which local dimensions to retain. While computationally efficient for memory access, the authors note that adaptive or learned dimension selection strategies could yield further performance gains.
  • Hybrid Architecture Complexity: While the asymmetry between Keys and Values opens the door for hybrid methods (e.g., combining low-rank compression for Keys with EchoKV reconstruction for Values), finding the optimal balance across different model architectures and memory budgets remains an open, complex challenge.

Summary updated

BibTeX
@misc{ji2026echokv,
  author = {Shiyu Ji and Yixuan Wang and Yijun Liu and Qingfu Zhu and Wanxiang Che},
  title = {{EchoKV: Efficient KV Cache Compression via Similarity-Based Reconstruction}},
  year = {2026},
  eprint = {2603.22910},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.22910},
}
Figure