Manuscript Offprint
arXiv:2611.07025LowRAM: Low-Rank Keys and Amortised Values for Composable KV Cache Compression at Test-Time
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
ABSTRACT
Autoregressive decoding relies on the KV cache, whose memory footprint grows linearly with context length and caps batch size and throughput. Existing post-training methods exploit redundancy across tokens, layers, and feature dimensions, or lower numerical precision. We identify a complementary axis: within each attention head, values are largely predictable from their corresponding keys. We exploit this with value cache amortisation, which fits a lightweight per-head predictor at test time and stores residuals only for the tokens it reconstructs worst, giving near-lossless value compression. The predictor can be initialised by meta-learning for substantially reduced prefill overhead, or fitted from scratch in settings that allow a one-off cost, such as multi-query inference. We pair value amortisation with cross-layer low-rank key compression to produce LowRAM, an asymmetric compression pipeline that stays close to lossless across three model families. By reconstructing only a selected subset of KV pairs at each decoding step, LowRAM can keep decoding overhead minimal and achieve up to higher peak decode throughput at compression. LowRAM further composes with quantisation and eviction, reaching compression at 94.5% of baseline performance on long contexts. These results show that treating keys and values as structurally distinct enables efficient, aggressive, and composable KV cache compression.
1 INTRODUCTION
Transformers (Vaswani et al., 2017) have become the dominant architecture for language modelling, but their deployment at long context lengths is fundamentally constrained by the compute cost of autoregressive decoding. Modern inference stacks address this via a KV cache: the key and value projections of each preceding token are computed once and reused at every subsequent decoding step. This turns decoding from a quadratic to a linear operation in sequence length, but shifts the bottleneck from compute to memory: the cache grows linearly with context length and batch size, and at long contexts comes to dominate the model's activation footprint.
A wide range of architectural responses to this bottleneck have been proposed, including linear attention and state-space alternatives that replace the cache with a fixed-size recurrent hidden state (Katharopoulos et al., 2020; Gu & Dao, 2023; Dao & Gu, 2024), and sparse, sliding-window, grouped-query, and multi-head latent attention variants that reduce per-token cache size architecturally (Ainslie et al., 2023; DeepSeek-AI et al., 2024). However, these approaches require pretraining or substantial finetuning, and most open-weight models still rely on grouped-query attention with a full KV cache (Grattafiori et al., 2024; Jiang et al., 2023; Team et al., 2024; Yang et al., 2025a). This has motivated a parallel line of post-training KV cache compression methods operating on frozen pretrained models. Existing methods fall into three families: eviction, which discards unimportant entries (Xiao et al., 2024; Zhang et al., 2023; Li et al., 2024; Cai et al., 2025); quantisation, which lowers
*Equal contribution.


Figure 1: Mistral-7B compression on LongBench contexts longer than 10K tokens across different KV cache compression methods: eviction (adapted from Yang et al. (2025b)), quantisation (Zandieh et al., 2026), LowRAM (our proposed method), and LowRAM-EQ (LowRAM combined with eviction and quantisation). Left: recovered performance against compression ratio. Right: maximum evaluated compression retaining at least 90% of baseline performance. LowRAM-EQ combines LowRAM, eviction, and quantisation. See Appendix C for a description of how compression is computed.
the precision of stored entries (Liu et al., 2024; Hooper et al., 2024; Dong et al., 2024); and low-rank decomposition, which approximates KV matrices with smaller, factorised representations (Yu et al., 2024; Chang et al., 2025; Saxena et al., 2024). These families are largely orthogonal, exploiting redundancies along different axes of the cache. This leaves the redundancy between keys and values largely unexplored. Keys and values are computed from the same representation, and although they serve different functions, their shared origin induces a predictable relationship between them. We exploit this redundancy by using the keys as a source from which the value cache can be recovered.
We first compare several predictive relationships within and across layers under a matched memory budget and find that reconstructing current-layer values from current-layer keys best preserves downstream performance. Based on this finding, we introduce value cache amortisation: during prefill, we fit a lightweight per-head network to map cached keys to their associated values. We then rank tokens by reconstruction error and store residual corrections only for the least accurately predicted values. The resulting value cache consists of the network parameters and a sparse set of residuals. During decoding, values are recovered by applying the network to the keys and adding the stored corrections, as illustrated in Figure 2.
Amortising the values still requires keys to be retained, both for attention and as inputs to the learned map. A complete compression scheme must therefore reduce the key cache as well. Our source-target analysis suggests that applying the same predictive strategy to the keys leads to less downstream performance than for values. Instead, for keys, prior work points to low-rank decomposition: their energy is concentrated in a relatively small number of feature directions, producing a short spectral tail and correspondingly small approximation error at reduced rank (Saxena et al., 2024). These findings motivate an asymmetric design: values are reconstructed from keys, while the keys themselves are compressed according to their low-rank structure. LowRAM realises this design by pairing value cache amortisation with xKV (Chang et al., 2026), which shares a low-rank basis across layers within each group to exploit alignment between their dominant key-cache subspaces.
- We propose LowRAM, an asymmetric pipeline that combines amortised values with cross-layer low-rank key compression. LowRAM remains close to lossless at moderate compression across three model families and composes with quantisation and eviction, reaching compression while retaining 94.5% of baseline performance.

Figure 2: At inference, a per-head MLP learns to reconstruct values from keys, then is cached for decoding alongside residuals for the worst-reconstructed values.
- We reduce the computational overhead of LowRAM using a meta-learned initialisation and selective reconstruction. The former dramatically reduces prefill overhead introduced by amortisation, while the latter achieves up to 5× higher peak decode throughput.
2 RELATED WORKS
Low-Rank Decomposition of KVs. Training-free SVD-based KV compression largely targets per-layer redundancy, via activation-aware or grouped SVD on the KV projection weights (Yuan et al., 2025; Yu et al., 2024; Zhang et al., 2024; Chang et al., 2025; Yan et al., 2025), projecting attention into an offline-fitted eigen-subspace (Saxena et al., 2024), or direct channel pruning (Xu et al., 2025). Complementary learned-projection methods (Lin et al., 2025; Shi et al., 2025; Benfenati et al., 2026; Hao et al., 2026; Wang et al., 2026; Lesens et al., 2025; Zhu et al., 2025; Shaikh et al., 2026) reach similar ratios with trained or online-adapted projectors. xKV (Chang et al., 2026) instead exploits cross-layer redundancy, sharing a single SVD basis across contiguous layer groups since adjacent layers share dominant singular vectors.
Eviction. Eviction reduces KV cache memory by discarding unimportant tokens. Early methods keep attention sinks and a recent window (Xiao et al., 2024), or a mix of recent and high-attention tokens (Zhang et al., 2023). Later work selects tokens using an observation window (Li et al., 2024), or allocates budgets per layer (Cai et al., 2025) or per head (Ge et al., 2024; Feng et al., 2025; Tang et al., 2025). Query-agnostic methods instead score tokens by how well they support reconstructing the context (Kim et al., 2025; Jegou & Jeblick, 2026).
Quantisation. Quantisation compresses the KV cache by lowering the precision of stored keys and values. However, these exhibit channel-wise outliers (Dettmers et al., 2022; Xiao et al., 2023) that dominate a uniform quantisation grid, so naive quantisation degrades sharply below 4 bits (Liu et al., 2024; Hooper et al., 2024). Sub-4-bit methods therefore target these outliers by quantising keys channel-wise and values token-wise (Liu et al., 2024), allocating bit-widths per token (Yang et al., 2024a; He et al., 2024; Dong et al., 2024) or per layer (Li et al., 2025), inverting positional embeddings before quantisation (Hooper et al., 2024), or removing outliers with random rotations (Ashkboos et al., 2024; Han et al., 2026; Zandieh et al., 2026). AQUA-KV (Shutova et al., 2025) instead quantises a prediction residual, using linear adapters that exploit both inter-layer and intra-layer dependencies: keys are predicted from previous-layer keys, while values are predicted jointly from previous-layer values and current-layer keys. Our amortised value cache uses context-adapted prediction of values from keys within each attention head, storing residuals only for tokens that are hard to reconstruct.
3 METHODS
We propose LowRAM, an asymmetric compression pipeline that treats the key and value caches as structurally distinct objects. For keys, we adopt xKV (Chang et al., 2026), which exploits the

Figure 3: Source-target analysis for predictive KV cache compression at a fixed 3× compression ratio for Mistral-7B. The left and centre panels show recovered LongBench performance when reconstructing current-layer keys and values , respectively, from alternative current- or previous-layer representations. The dotted line indicates uncompressed baseline performance. The right panel plots recovered performance against reconstruction mean-squared error for each source-target pair, showing that lower reconstruction error does not necessarily correspond to better downstream performance.
low-rank cross-layer redundancy of key states. For values, we introduce amortisation, a learned associative memory that predicts each token's value vector directly from its key, fit once per context, and retains residuals only for the values the predictor reconstructs poorly. Prior to both decomposition and prediction, we invert RoPE, following evidence that pre-RoPE representations are more amenable to compression (Hooper et al., 2024; Su et al., 2025; Sun et al., 2025a), with the rotation reapplied at attention time. Both predictor fitting and value reconstruction use the pre-RoPE keys reconstructed by xKV. During decoding, generated key-values are stored exactly in the cache.
3.1 IDENTIFYING THE PREDICTIVE STRUCTURE OF THE KV CACHE
Prior work has explored predictive compression of the KV cache using inter-layer and intra-layer dependencies (Shutova et al., 2025) or across tokens (Hao et al., 2026). Here, we focus on learning a mapping from keys to values within individual attention heads. To determine which representation is best suited to predictive compression within our framework, we perform a source-target analysis over the KV cache. For each layer, we train the same predictor to reconstruct either the current-layer keys or values while varying the available source representation. Specifically, we consider previous-layer keys (), previous-layer values (), their concatenation (), current-layer values (), and current-layer keys (). To match our proposed compression scheme, each predictor is paired with a residual store, with the residual budget fixed across all configurations. All configurations are evaluated under the same 3× compression budget using both reconstruction error and recovered LongBench performance.
Figure 3 shows that reconstructing values from current-layer keys, , achieves the highest recovered downstream performance among the configurations evaluated. This source-target pair therefore forms the basis of our proposed method. Our comparison revisits the probing configurations examined by AQUA-KV (Shutova et al., 2025) (Figure 2), evaluating them within our predictor and residual-storage framework using both reconstruction error and recovered LongBench performance. Under this setting, lower reconstruction error does not necessarily imply better preserved downstream performance.
Two further observations are worth noting. First, value reconstruction generally recovers more downstream performance than key reconstruction. Second, reconstruction error correlates only weakly with downstream performance: source-target pairs with similar reconstruction errors can exhibit significantly different recovered performance, and the differing scales of keys and values make their absolute error difficult to compare directly. We therefore base our design decisions primarily on recovered downstream performance rather than reconstruction error.
3.2 VALUE CACHE AMORTISATION
Having established as the preferred prediction direction, we model this relationship with a lightweight parametric function. Let and denote the key and value matrices for a single attention head over a sequence of length . We learn a mapping applied row-wise to the key cache, independently per layer and KV head . Concretely, is a two-layer MLP with a learned linear residual branch,
where is a ReLU nonlinearity and is initialised from the Slim Attention prior introduced below; Appendix B gives the full architecture and layer-wise prefill-fitting procedure. During prefill, the parameters are adapted to the current context by minimising the value reconstruction loss .
At decoding time, the value cache is reconstructed from the retained keys as . This prediction captures much of the value cache, but not all tokens are reconstructed equally well. Therefore, we store residual corrections only for the tokens with the largest prediction errors: for each token , the reconstruction error is .
Let denote the fraction of residuals retained. We select the top- fraction of tokens according to and define a binary gate
where larger rank corresponds to larger reconstruction error. Writing for the per-token residual, the reconstructed value cache is, in matrix form,
which replaces the original value cache in standard attention, . Algorithm 1 in Appendix B summarises this procedure end to end.
The parameter controls the memory-fidelity trade-off. Smaller stores fewer residuals and hence increases compression, while larger retains more of the original value cache. The total memory footprint consists of two terms: a sequence-independent term from the per-head MLP parameters and the linear residual , and a sequence-dependent term from the retained residuals and their indices. Figure 8 shows that the fixed parameter cost is amortised after the first few thousand tokens, after which memory grows at a fraction of the uncompressed value cache slope.
Initialisation from Slim Attention. Following Slim Attention (Graef & Wasielewski, 2025), we initialise the residual branch from the key and value projection matrices. When the key projection is square and invertible, values can be reconstructed exactly from keys via ; in GQA models is rectangular, so we instead use the Moore-Penrose pseudoinverse, . This gives the best linear approximation to the key-to-value mapping the model weights can offer, and a strong starting point for training, on top of which the MLP learns a non-linear correction that captures value components the Slim map cannot represent in GQA models.
Warm-starting the Amortised Value Cache MLP. Adapting from scratch on each context wastes gradient steps relearning shared structure. We instead split the work in two: a one-off offline stage that learns the general key-to-value mapping (one pass over 32 batches of 4096-token FineWeb-Edu sequences, 25 gradient steps, under five minutes on one GPU, run once per model), and an online stage that overfits this mapping to the current context. At inference, these weights initialise each layer's MLP before per-context adaptation, reducing the steps needed to reach a useful approximation.
3.3 EFFICIENT ADAPTATION AND SELECTIVE RECONSTRUCTION
Meta-learned initialisation. Even with warm-starting, fitting the value predictor requires many per-context gradient updates, making it costly when a context is queried only once. We therefore meta-learn an initialisation using First-Order MAML Nichol et al., 2018. Each sequence defines a meta-learning task consisting of its observed KV pairs, and the inner loop adapts the per-head predictor for gradient updates. At inference, the predictor is initialised from the learned parameters and adapted to the new context using the same -update budget. Appendix E gives the complete training procedure.
Selective reconstruction. Reconstructing the complete cache at every decoding step can offset the computational benefit of compression. Following landmark-guided retrieval (Sun et al., 2025a), we partition the prefix into chunks represented by mean-key landmarks, retain outlier chunks and a local window exactly, and reconstruct only the top- chunks selected by the current query. A persistent buffer reuses chunks selected across consecutive decoding steps. We additionally replace the exact key cache SVD with a randomised Cholesky-QR decomposition, giving a speedup with no loss in downstream quality (Chang et al., 2026). Appendix F describes the retrieval configuration, kernels, and memory accounting.
4 RESULTS
4.1 EXPERIMENTAL SETUP
Benchmarks. We evaluate on RULER (Hsieh et al., 2024) and LongBench (Bai et al., 2024), and additionally report LongBench filtered to sequences of at least 10K tokens. For this subset we exclude tasks with fewer than 20 samples meeting the length requirement. Appendix G gives per-task statistics. All results are reported as recovered performance relative to the uncompressed baseline. We evaluate across three model families: Mistral-7B-Instruct-v0.3 (Jiang et al., 2023), Llama-3.1-8B-Instruct (Grattafiori et al., 2024), and Qwen3.5-4B (Qwen Team, 2026). Qwen3.5-4B is a hybrid architecture that interleaves full attention with linear attention layers; only the full attention layers maintain a conventional KV cache, so LowRAM is applied to that subset of layers alone, and the compression ratios we report for Qwen3.5-4B are relative to that subset's cache rather than the whole model's.
Eviction. When combined with LowRAM, we apply eviction before fitting the map, discarding tokens unlikely to be attended to so the MLP need only reconstruct and store residuals for the tokens it retains. Importance is estimated with a small CNN predictor adapted from Yang et al. (2025b): during prefill, a pre-hook on each attention layer scores every token by predicted future attention (averaged across heads), and we retain the top- positions by this score, with attention sinks (first 8 tokens) and a local window (last 64 tokens) kept unconditionally.
Quantisation. We quantise with TurboQuant (Zandieh et al., 2026), omitting the 1-bit QJL (Zandieh et al., 2025) error-correction step. Although QJL debiases the inner product estimations, we found that its variance is amplified by Softmax, thus degrading both attention quality and downstream accuracy. For the key cache, xKV factorises the layer-grouped cache as , where holds the shared low-rank basis and is layer-specific; since only scales with context length , we quantise only , which captures most of the memory reduction (Appendix B gives the crossover analysis for when quantising too becomes worthwhile). We use asymmetric precision, 4-bit for the key factor and 2-bit for value residuals.
4.2 END-TO-END COMPRESSION
LowRAM retains near-baseline performance at moderate compression across all three model families (Table 1). Mistral-7B and Llama-3.1-8B retain 97.9-99.4% of baseline performance at compression. At , recovery remains 96.0-99.6% except for Llama-3.1-8B on RULER, where it falls to 93.9%. We attribute the performance drop at this compression ratio to the reduced residual budget. As for Qwen3.5-4B, its RULER performance matches the uncompressed baseline, while LongBench recovery varies between 94.4% and 97.8%.
4.3 EFFICIENCY
The results in Table 1 were obtained by fitting the value-cache MLP with 150 gradient updates per context (300 in Table 2, where performance has largely saturated, giving the strongest full-adaptation
| Model | RULER 4K (%) | LongBench (%) | ||||
|---|---|---|---|---|---|---|
| 2x | 3x | 4x | 2x | 3x | 4x | |
| Mistral-7B | 99.4 | 98.8 | 96.0 | 100.7 | 99.4 | 97.9 |
| Llama3.1-8B | 99.6 | 97.9 | 93.9 | 98.7 | 98.5 | 99.6 |
| Qwen3.5-4B | 100.0 | 100.0 | 100.1 | 97.8 | 95.0 | 94.4 |
Table 1: Recovered average performance of LowRAM on RULER 4K and LongBench. Scores are averaged across each benchmark and reported as a percentage of the corresponding uncompressed baseline. The compression ratio reported for Qwen3.5-4B concerns only the full attention layers.
| SR | Meta-init | RULER (%) | LongBench (%) | ||
|---|---|---|---|---|---|
| 16K | 32K | 64K | >10K | ||
| × | × | 96.9 | 100.0 | 95.8 | 95.3 |
| ✓ | × | 97.7 | 99.0 | 96.8 | 95.3 |
| ✓ | ✓ | 96.3 | 96.8 | 92.4 | 92.9 |
Table 2: Recovered LongBench (>10K) and RULER 16-64K performance of LowRAM on Llama-3.1-8B-Instruct at 4× compression, with and without selective reconstruction (SR) and a meta-learned initialisation (Meta-init). Rows without Meta-init use 300 gradient updates per context (vs. 150 in Table 1); Meta-init uses 2.
reference) and reconstructing the full cache at every decoding step, significantly increasing prefill and decoding cost, respectively. Section 3.3 introduced one mechanism targeting each; here we measure their effect on latency, throughput and accuracy.
Meta-learning the MLP initialisation reduces per-context adaptation to 2 gradient updates, lowering the time-to-first-token (TTFT) overhead of the amortised value cache to 1.3× that of the uncompressed baseline, down from 26.3× with 150 updates and 55.5× with 300 (Figure 6). Figure 4 compares the decode throughput of the baseline with that of LowRAM with selective reconstruction (LowRAM-SR) at 4× compression. The baseline is faster at small batch sizes, but it quickly becomes memory-bound and plateaus, while LowRAM-SR continues to scale. The crossover occurs earlier at longer contexts, and beyond it the gap widens until the baseline runs out of memory. LowRAM-SR supports a batch size of 28 at all three context lengths and, at 262K tokens, reaches roughly 5× the peak throughput of the baseline.
Table 2 reports the accuracy cost of each mechanism at 4× compression. Selective reconstruction matches full reconstruction on LongBench (>10K) and stays within 1 point of it, or above it, at every RULER context length. The remaining difference comes from meta-initialisation, which costs 1.4-4.4 points on RULER and 2.4 on LongBench (>10K) relative to 300-update adaptation, in exchange for the TTFT reduction above. With both mechanisms enabled, LowRAM recovers over 92.4-96.8% of baseline performance on RULER and 92.9% on LongBench (>10K). Meta-initialisation is therefore the natural choice when a context is queried once. When the same context serves many queries, the cost of full adaptation is paid only once, and its extra accuracy comes at little amortised cost.
4.4 STACKING WITH EVICTION AND QUANTISATION
Table 3 evaluates LowRAM in combination with eviction and quantisation, and Table 10 reports a full sweep in which both are applied on top of LowRAM at 2×, 3× and 4× compression. Quantisation combines particularly well with our method, increasing both the overall compression ratio and recovered performance. For Mistral on LongBench, for example, adding quantisation to the 4× LowRAM cache raises compression to 6.4× and recovery from 97.9% to 99.4%. The benefit is largest where LowRAM alone degrades most, e.g. raising recovery for Llama on RULER at 4× from 93.9% to 99.4%. We attribute this to two factors. First, storing residuals at lower precision reduces the memory each one requires, so LowRAM can retain more residuals within the same budget. Second, in most configurations quantisation alone introduces very little error, so the gain from additional residuals outweighs the error it adds. The exception is Llama on LongBench, where quantisation

Figure 4: Decode throughput for Llama-3.1-8B at different batch sizes and sequence lengths at 4× compression, comparing exact KV attention against LowRAM-SR (LowRAM with selective reconstruction). Appendix F reports the full selective-reconstruction configuration.
alone recovers only 96.3%. In this case the additional error is not fully offset, and adding quantisation lowers recovery at every compression ratio.
| Model | Method | RULER (4K) | LongBench | ||
|---|---|---|---|---|---|
| CR | Score (%) | CR | Score (%) | ||
| Mistral-7B | Eviction | 2× | 99.9 | 2× | 99.4 |
| Quantisation | 5.1× | 99.5 | 5.1× | 98.9 | |
| LowRAM | 4× | 96.0 | 4× | 97.9 | |
| LowRAM-E | 8× | 91.8 | 8× | 96.6 | |
| LowRAM-Q | 4.8× | 99.6 | 6.4× | 99.4 | |
| LowRAM-EQ | 6.7× | 93.6 | 10.7× | 96.9 | |
| Llama-3.1-8B | Eviction | 2× | 99.6 | 2× | 98.8 |
| Quantisation | 5.1× | 99.8 | 5.1× | 96.3 | |
| LowRAM | 4× | 93.9 | 4× | 99.6 | |
| LowRAM-E | 8× | 79.9 | 8× | 90.6 | |
| LowRAM-Q | 4.8× | 99.4 | 6.1× | 95.8 | |
| LowRAM-EQ | 6.7× | 96.4 | 8.8× | 91.3 | |
Table 3: Recovered performance of LowRAM and LowRAM combined with eviction (LowRAM-E), quantisation (LowRAM-Q), and both (LowRAM-EQ). The achieved compression ratio varies across benchmarks because it depends on sequence length. CR refers to compression ratio.
Eviction introduces a clearer trade-off, since it shortens the effective sequence without reducing the fixed cost of the reconstruction network, leaving less memory for residuals. At moderate compression, stacking remains beneficial for Mistral, where LowRAM-E at 4× outperforms eviction alone on both RULER (99.2% vs. 98.0%) and LongBench (97.8% vs. 96.3%), though not for Llama. As compression increases, however, the fixed cost of the network becomes limiting: Figure 8 shows that at 4× amortisation it dominates below roughly 2-3K tokens, a regime that RULER's 4K-token sequences enter after moderate eviction. Accordingly, raising the LowRAM ratio from 2× to 4× while keeping eviction fixed at 2× reduces RULER recovery by 7.4 percentage points for Mistral and 17.4 for Llama (Table 10). LongBench is less affected, with reductions of 1.2 and 3.7 points, because although its shortest tasks (around 1K tokens) have little residual budget to begin with, its longer tasks (up to 18K tokens) remain well above this threshold even after eviction.
Therefore, to evaluate extreme compression without conflating compression error with the fixed overhead of the reconstruction network, we evaluate on LongBench samples longer than 10K tokens. Table 4 reports the maximum compression each method can achieve while retaining at least 90% of baseline performance (see Table 11 for a sweep over compression ratios). This subset provides a more representative setting for pushing compression further, as the network parameters are sufficiently
| Eviction | Quantisation | LowRAM | LowRAM-EQ | |
|---|---|---|---|---|
| CR | 10.0× | 7.5× | 9.0× | 26.9× |
| Score (%) | 91.6 | 92.3 | 90.7 | 94.5 |
Table 4: Maximum evaluated compression retaining at least 90% of Mistral-7B performance on LongBench contexts longer than 10K tokens. CR uses the byte-level accounting in Appendix C.
| Method | RULER 4K (%) | LongBench (%) | ||||
|---|---|---|---|---|---|---|
| 2× | 3× | 4× | 2× | 3× | 4× | |
| Amortisation | 100.0 | 99.6 | 98.2 | 100.4 | 100.4 | 99.3 |
| xKV | 99.9 | 99.7 | 99.3 | 95.0 | 95.3 | 95.8 |
Table 5: Recovered performance of amortisation and xKV applied to the value cache in isolation on Llama-3.1-8B, reported as a percentage of the uncompressed-cache baseline. The displayed configuration uses a two-layer per-head MLP with 300 per-context gradient updates, without warm-starting or . Table 8 provides the complete optimisation-budget and initialisation sweep.
amortised to leave a meaningful residual budget. The full stack achieves compression while recovering 94.5% of baseline performance, matching or exceeding the standalone methods despite substantially higher compression ratios.
4.5 VALUE CACHE AMORTISATION IN ISOLATION
To isolate value compression from key-compression error, we keep the keys exact and compare amortisation against xKV applied to the value cache (Table 5; Llama-3.1-8B, two-layer per-head MLP, 300 updates, no warm-starting or ). Value-cache amortisation remains close to lossless across the evaluated compression ratios, retaining 98.2% of RULER performance and 99.3% of LongBench performance at compression. xKV edges slightly ahead on RULER at higher compression ratios, but amortisation is consistently stronger on LongBench, where it stays ahead at every compression ratio. This is consistent with our motivation for treating keys and values asymmetrically. Appendix D (Table 8) reports the complete sweep over adaptation budgets and the effect of the Slim initialisation . Those results show that the Slim prior substantially improves performance under short adaptation budgets, but that its advantage narrows as the predictor converges.
5 DISCUSSION
Our results suggest that keys and values should be compressed differently. Within each attention head, values are largely predictable from their keys. A small per-head predictor fitted to the context, with exact residuals kept for the tokens it reconstructs worst, stays close to lossless at value compression and holds up better on LongBench than low-rank compression of the same cache (Table 5). Pairing it with low-rank keys gives LowRAM, which remains close to baseline at moderate compression and combines with quantisation and eviction to reach on long contexts.
The ablations suggest why prediction suits values. The key-to-value map appears strongly head-specific (sharing one predictor across a layer's heads costs almost 20 points, Table 7). Keys are harder to predict, and their errors are likely more harmful: a key error perturbs the attention logits and can shift attention onto the wrong tokens, whereas a value error enters only after the attention weights are fixed. This matches findings on asymmetric KV quantisation (Tao et al., 2025) and may explain why reconstruction error tracks downstream performance so poorly (Figure 3). Residual placement also matters: at a fixed budget, error-ranked selection recovers almost all accuracy, whereas random selection loses most of it (Figure 5).
LowRAM is best suited to long contexts. The predictor's parameters are a fixed cost that is only amortised after a few thousand tokens (Figure 8). This is why LowRAM degrades more on 4K RULER than on LongBench, and why it combines less cleanly with eviction, which shortens the sequence but leaves this cost unchanged. The choice of initialisation adds a second trade-off. Meta-learning brings prefill close to baseline speed at a small cost in accuracy, while full per-context fitting is slower but more accurate. Since both components of LowRAM depend only on the context, the slower option becomes attractive whenever a context is reused, as in document QA or shared-prefix serving, because the fitting cost is paid only once.
6 LIMITATIONS AND FUTURE WORK
We have not evaluated long generations, which would require periodically compressing the suffix of newly generated tokens (e.g. every tokens) rather than relying on a single prefill-time fit. It is also unclear how much of the learned parametrisation persists across contexts: gains from warm-starting and Slim Attention initialisation suggest part of the key-to-value relationship is shared, while gains from test-time adaptation indicate a remaining context-specific component. Understanding this split, and whether hard-to-predict tokens are stable across contexts, could enable more efficient allocation of memory and computation.
AI Use Statement. We used generative AI to edit text we had written ourselves and to write and edit code, all of which we reviewed and verified before use. We take responsibility for the final content of this work.
Reproducibility Statement. Reproduction settings are in the appendix: value-reconstruction network (B), eviction/quantisation (4.1), meta-learning (E), selective reconstruction (F), benchmarks (G).
REFERENCES
Joshua Ainslie, James Lee-Thorp, Michiel De Jong, Yury Zemlyanskiy, Federico Lebrón, and Sumit Sanghai. Gqa: Training generalized multi-query transformer models from multi-head checkpoints. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp. 4895–4901, 2023.
Saleh Ashkboos, Amirkeivan Mohtashami, Maximilian L. Croci, Bo Li, Pashmina Cameron, Martin Jaggi, Dan Alistarh, Torsten Hoefler, and James Hensman. Quarot: Outlier-free 4-bit inference in rotated LLMs. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024. URL https://openreview.net/forum?id=dfqsW38v1X.
Yushi Bai, Xin Lv, Jiajie Zhang, Hongchang Lyu, Jiankai Tang, Zhidian Huang, Zhengxiao Du, Xiao Liu, Aohan Zeng, Lei Hou, Yuxiao Dong, Jie Tang, and Juanzi Li. LongBench: A bilingual, multitask benchmark for long context understanding. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3119–3137, Bangkok, Thailand, August 2024. Association for Computational Linguistics. doi: 10.18653/v1/2024.acl-long.172. URL https://aclanthology.org/2024.acl-long.172/.
Ali Behrouz, Peilin Zhong, and Vahab Mirrokni. Titans: Learning to memorize at test time. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025. URL https://openreview.net/forum?id=8GjSf9Rh7Z.
Luca Benfenati, Matteo Risso, Andrea Vannozzi, Ahmet Caner Yüzügüler, Lukas Cavigelli, Enrico Macii, Daniele Jahier Pagliari, and Alessio Burrello. Don't be so Stief! learning KV cache low-rank approximation over the Stiefel manifold. arXiv preprint arXiv:2601.21686, 2026.
Zefan Cai, Yichi Zhang, Bofei Gao, Yuliang Liu, Tianyu Liu, Keming Lu, Wayne Xiong, Yue Dong, Junjie Hu, and Wen Xiao. PyramidKV: Dynamic KV cache compression based on pyramidal information funneling, 2025. URL https://openreview.net/forum?id=jZVNmDiU86.
Chi-Chih Chang, Wei-Cheng Lin, Chien-Yu Lin, Chong-Yan Chen, Yu-Fang Hu, Pei-Shuo Wang, Ning-Chi Huang, Luis Ceze, Mohamed S. Abdelfattah, and Kai-Chiang Wu. Palu: Compressing KV-cache with low-rank projection. In International Conference on Learning Representations (ICLR), 2025. arXiv:2407.21118.
Chi-Chih Chang, Wei-Cheng Lin, Chien-Yu Lin, Hung-Yueh Chiang, Yash Akhauri, Xilai Dai, Huiqiang Jiang, Yucheng Li, Luis Ceze, Kai-Chiang Wu, and Mohamed S. Abdelfattah. xKV: Cross-layer KV-cache compression via aligned singular vector extraction. In Forty-third International Conference on Machine Learning, 2026. URL https://openreview.net/forum?id=XDb69lykA8.
Tri Dao and Albert Gu. Transformers are SSMs: Generalized models and efficient algorithms through structured state space duality. In Forty-first International Conference on Machine Learning, 2024. URL https://openreview.net/forum?id=ztn8FCR1td.
DeepSeek-AI, Aixin Liu, Bei Feng, Bin Wang, Bingxuan Wang, Bo Liu, Chenggang Zhao, Chengqi Dengr, Chong Ruan, Damai Dai, Daya Guo, Dejian Yang, Deli Chen, Dongjie Ji, Erhang Li, Fangyun Lin, Fuli Luo, Guangbo Hao, Guanting Chen, Guowei Li, H. Zhang, Hanwei Xu, Hao Yang, Haowei Zhang, Honghui Ding, Huajian Xin, Huazuo Gao, Hui Li, Hui Qu, J. L. Cai, Jian Liang, Jianzhong Guo, Jiaqi Ni, Jiashi Li, Jin Chen, Jingyang Yuan, Junjie Qiu, Junxiao Song, Kai Dong, Kaige Gao, Kang Guan, Lean Wang, Lecong Zhang, Lei Xu, Leyi Xia, Liang Zhao, Liyue Zhang, Meng Li, Miaojun Wang, Mingchuan Zhang, Minghua Zhang, Minghui Tang, Mingming Li, Ning Tian, Panpan Huang, Peiyi Wang, Peng Zhang, Qihao Zhu, Qinyu Chen, Qiushi Du, R. J. Chen, R. L. Jin, Ruiqi Ge, Ruizhe Pan, Runxin Xu, Ruyi Chen, S. S. Li, Shanghai Lu, Shangyan Zhou, Shanhuang Chen, Shaoqing Wu, Shengfeng Ye, Shirong Ma, Shiyu Wang, Shuang Zhou, Shuiping Yu, Shunfeng Zhou, Size Zheng, T. Wang, Tian Pei, Tian Yuan, Tianyu Sun, W. L. Xiao, Wangding Zeng, Wei An, Wen Liu, Wenfeng Liang, Wenjun Gao, Wentao Zhang, X. Q. Li, Xiangyue Jin, Xianzu Wang, Xiao Bi, Xiaodong Liu, Xiaohan Wang, Xiaojin Shen, Xiaokang Chen, Xiaosha Chen, Xiaotao Nie, Xiaowen Sun, Xiaoxiang Wang, Xin Liu, Xin Xie, Xingkai Yu, Xinnan Song, Xinyi Zhou, Xinyu Yang, Xuan Lu, Xuecheng Su, Y. Wu, Y. K. Li, Y. X. Wei, Y. X. Zhu, Yanhong Xu, Yanping Huang, Yao Li, Yao Zhao, Yaofeng Sun, Yaohui Li, Yaohui Wang, Yi Zheng, Yichao Zhang, Yiliang Xiong, Yilong Zhao, Ying He, Ying Tang, Yishi Piao, Yixin Dong, Yixuan Tan, Yiyuan Liu, Yongji Wang, Yongqiang Guo, Yuchen Zhu, Yuduan Wang, Yuheng Zou, Yukun Zha, Yunxian Ma, Yuting Yan, Yuxiang You, Yuxuan Liu, Z. Z. Ren, Zehui Ren, Zhangli Sha, Zhe Fu, Zhen Huang, Zhen Zhang, Zhenda Xie, Zhewen Hao, Zhihong Shao, Zhiniu Wen, Zhipeng Xu, Zhongyu Zhang, Zhuoshu Li, Zihan Wang, Zihui Gu, Zilin Li, and Ziwei Xie. Deepseek-v2: A strong, economical, and efficient mixture-of-experts language model, 2024. URL https://arxiv.org/abs/2405.04434.
Tim Dettmers, Mike Lewis, Younes Belkada, and Luke Zettlemoyer. GPT3.int8(): 8-bit matrix multiplication for transformers at scale. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (eds.), Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=dxiaXiGWqBoxaD.
Shichen Dong, Wen Cheng, Jiayu Qin, and Wei Wang. Qaq: Quality adaptive quantization for llm kv cache. arXiv preprint arXiv:2403.04643, 2024.
Yuan Feng, Junlin Lv, Yukun Cao, Xike Xie, and S Kevin Zhou. Ada-KV: Optimizing KV cache eviction by adaptive budget allocation for efficient LLM inference. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025. URL https://openreview.net/forum?id=tcisuhGsQZ.
Suyu Ge, Yunan Zhang, Liyuan Liu, Minjia Zhang, Jiawei Han, and Jianfeng Gao. Model tells you what to discard: Adaptive KV cache compression for LLMs. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=uNrFpDPMyo.
Nils Graef and Andrew Wasielewski. Slim attention: cut your context memory in half without loss – k-cache is all you need for mha, 2025. URL https://arxiv.org/abs/2503.05840.
Aaron Grattafori, Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Alex Vaughan, et al. The llama 3 herd of models. arXiv preprint arXiv:2407.21783, 2024.
Albert Gu and Tri Dao. Mamba: Linear-time sequence modeling with selective state spaces. arXiv preprint arXiv:2312.00752, 2023.
Insu Han, Praneeth Kacham, Amin Karbasi, Vahab Mirrokni, and Amir Zandieh. Polarquant: Vector quantization with polar transformation. In The 29th International Conference on Artificial Intelligence and Statistics, 2026. URL https://openreview.net/forum?id=Igzjw1Pkds.
Jitai Hao, Qiang Huang, Yaowei Wang, Min Zhang, and Jun Yu. DeltaKV: Residual-based KV cache compression via long-range similarity. arXiv preprint arXiv:2602.08005, 2026.
Yefei He, Luoming Zhang, Weijia Wu, Jing Liu, Hong Zhou, and Bohan Zhuang. Zipcache: Accurate and efficient KV cache quantization with salient token identification. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024. URL https://openreview.net/forum?id=5t4ZAkPiJs.
Coleman Richard Charles Hooper, Sehoon Kim, Hiva Mohammadzadeh, Michael W. Mahoney, Sophia Shao, Kurt Keutzer, and Amir Gholami. KVQuant: Towards 10 million context length LLM inference with KV cache quantization. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024. URL https://openreview.net/forum?id=0LXotew9Du.
Cheng-Ping Hsieh, Simeng Sun, Samuel Kriman, Shantanu Acharya, Dima Rekesh, Fei Jia, and Boris Ginsburg. RULER: What's the real context size of your long-context language models? In First Conference on Language Modeling, 2024. URL https://openreview.net/forum?id=kIoBbc76Sy.
Simon Jegou and Maximilian Jeblick. Kvzap: Fast, adaptive, and faithful kv cache pruning. arXiv preprint arXiv:2601.07891, 2026.
Albert Q. Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, Lélio Renard Lavaud, Marie-Anne Lachaux, Pierre Stock, Teven Le Scao, Thibaut Lavril, Thomas Wang, Timothée Lacroix, and William El Sayed. Mistral 7b, 2023. URL https://arxiv.org/abs/2310.06825.
Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and François Fleuret. Transformers are RNNs: Fast autoregressive transformers with linear attention. In Hal Daumé III and Aarti Singh (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 5156–5165. PMLR, 13–18 Jul 2020. URL https://proceedings.mlr.press/v119/katharopoulos20a.html.
Jang-Hyun Kim, Jinuk Kim, Sangwoo Kwon, Jae W. Lee, Sangdoo Yun, and Hyun Oh Song. KVzip: Query-agnostic KV cache compression with context reconstruction. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025. URL https://openreview.net/forum?id=JFygzwx8SJ.
Damien Lesens, Beheshteh Tolouei Rakhshan, and Guillaume Rabusseau. KQ-SVD: Compressing the KV cache with provable guarantees on attention fidelity. arXiv preprint arXiv:2512.05916, 2025.
Xing Li, Zeyu XING, Yiming Li, Linping Qu, Hui-Ling Zhen, Yiwu Yao, Wulong Liu, Sinno Jialin Pan, and Mingxuan Yuan. KVTuner: Sensitivity-aware layer-wise mixed-precision KV cache quantization for efficient and nearly lossless LLM inference. In Forty-second International Conference on Machine Learning, 2025. URL https://openreview.net/forum?id=zDwipF6h06.
Yuhong Li, Yingbing Huang, Bowen Yang, Bharat Venkitesh, Acyr Locatelli, Hanchen Ye, Tianle Cai, Patrick Lewis, and Deming Chen. SnapKV: LLM knows what you are looking for before generation. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024. URL https://openreview.net/forum?id=poE54G0q2l.
Bokai Lin, Zihao Zeng, Zipeng Xiao, Siqi Kou, Tianqi Hou, Xiaofeng Gao, Hao Zhang, and Zhijie Deng. MatryoshkaKV: Adaptive KV compression via trainable orthogonal projection. In International Conference on Learning Representations (ICLR), 2025. arXiv:2410.14731.
Zirui Liu, Jiayi Yuan, Hongye Jin, Shaochen Zhong, Zhaozhuo Xu, Vladimir Braverman, Beidi Chen, and Xia Hu. KIVI: A tuning-free asymmetric 2bit quantization for KV cache. In Forty-first International Conference on Machine Learning, 2024. URL https://openreview.net/forum?id=L057s2Rq80.
Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999, 2018.
Qwen Team. Qwen3.5: Towards native multimodal agents, February 2026. URL https://qwen.ai/blog?id=qwen3.5.
Utkarsh Saxena, Gobinda Saha, Sakshi Choudhary, and Kaushik Roy. Eigen attention: Attention in low-rank space for KV cache compression. In Findings of the Association for Computational Linguistics: EMNLP 2024, 2024. arXiv:2408.05646.
Imanol Schlag, Kazuki Irie, and Jürgen Schmidhuber. Linear transformers are secretly fast weight programmers. In Marina Meila and Tong Zhang (eds.), Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 9355–9366. PMLR, 18–24 Jul 2021. URL https://proceedings.mlr.press/v139/schlag21a.html.
Jürgen Schmidhuber. Reducing the ratio between learning complexity and number of time varying variables in fully recurrent nets. In International Conference on Artificial Neural Networks, pp. 460–463. Springer, 1993.
Jürgen Schmidhuber. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. Neural Computation, 4(1):131–139, 1992. doi: 10.1162/neco.1992.4.1.131.
Khalid Shaikh, Asmit Kumar Singh, Rebecca Christopher Dsouza, and Shikhar Shiromani. Linear predictability of attention heads in large language models. arXiv preprint arXiv:2603.13314, 2026.
Luohe Shi, Zuchao Li, Lefei Zhang, Baoyuan Qi, Liu Guoming, and Hai Zhao. KV-Latent: Dimensional-level KV cache reduction with frequency-aware rotary positional embedding. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (ACL), 2025. arXiv:2507.11273.
Alina Shutova, Vladimir Malinovskii, Vage Egiazarian, Denis Kuznedev, Denis Mazur, Surkov Nikita, Ivan Ermakov, and Dan Alistarh. Cache me if you must: Adaptive key-value quantization for large language models. In Forty-second International Conference on Machine Learning, 2025. URL https://openreview.net/forum?id=COowwJOAZi.
Zunhai Su, Zhe Chen, Wang Shen, Hanyu Wei, Linge Li, Huangqi Yu, and Kehong Yuan. Rotatekv: Accurate and robust 2-bit kv cache quantization for llms via outlier-aware adaptive rotations, 2025. URL https://arxiv.org/abs/2501.16383.
Hanshi Sun, Li-Wen Chang, Wenlei Bao, Size Zheng, Ningxin Zheng, Xin Liu, Harry Dong, Yuejie Chi, and Beidi Chen. ShadowKV: KV cache in shadows for high-throughput long-context LLM inference. In Forty-second International Conference on Machine Learning, 2025a. URL https://openreview.net/forum?id=oa7MYA06h6.
Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei Efros, and Moritz Hardt. Test-time training with self-supervision for generalization under distribution shifts. In Hal Daumé III and Aarti Singh (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 9229–9248. PMLR, 13–18 Jul 2020. URL https://proceedings.mlr.press/v119/sun20b.html.
Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, and Carlos Guestrin. Learning to (learn at test time): Rnns with expressive hidden states, 2025b. URL https://arxiv.org/abs/2407.04620.
Hanlin Tang, Yang Lin, Jing Lin, Qingsen Han, Danning Ke, Shikuan Hong, Yiwu Yao, and Gongyi Wang. Razorattention: Efficient KV cache compression through retrieval heads. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=tkiZQL04w.
Qian Tao, Wenyuan Yu, and Jingren Zhou. AsymKV: Enabling 1-bit quantization of KV cache with layer-wise asymmetric quantization configurations. In Owen Rambow, Leo Wanner, Marianna Apidianaki, Hend Al-Khalifa, Barbara Di Eugenio, and Steven Schockaert (eds.), Proceedings of the 31st International Conference on Computational Linguistics, pp. 2316–2328, Abu Dhabi, UAE, January 2025. Association for Computational Linguistics. URL https://aclanthology.org/2025.coling-main.158/.
Gemma Team, Morgane Riviere, Shreya Pathak, Pier Giuseppe Sessa, Cassidy Hardin, Surya Bhupatiraju, Léonard Hussenot, Thomas Mesnard, Bobak Shahriari, Alexandre Ramé, Johan Ferret, Peter Liu, Pouya Tafti, Abe Friesen, Michelle Casbon, Sabela Ramos, Ravin Kumar, Charline Le Lan, Sammy Jerome, Anton Tsitsulin, Nino Vieillard, Piotr Stanczyk, Sertan Girgin, Nikola Momchev, Matt Hoffman, Shantanu Thakoor, Jean-Bastien Grill, Behnam Neyshabur, Olivier Bachem, Alanna Walton, Aliaksei Severyn, Alicia Parrish, Aliya Ahmad, Allen Hutchison, Alvin Abdagic, Amanda Carl, Amy Shen, Andy Brock, Andy Coenen, Anthony Laforge, Antonia Paterson, Ben Bastian, Bilal Piot, Bo Wu, Brandon Royal, Charlie Chen, Chintu Kumar, Chris Perry, Chris Welty, Christopher A. Choquette-Choo, Danila Sinopalnikov, David Weinberger, Dimple Vijaykumar, Dominika Rogozińska, Dustin Herbison, Elisa Bandy, Emma Wang, Eric Noland, Erica Moreira, Evan Senter, Evgenii Eltyshev, Francesco Visin, Gabriel Rasskin, Gary Wei, Glenn Cameron, Gus Martins, Hadi Hashemi, Hanna Klimczak-Plucińska, Harleen Batra, Harsh Dhand, Ivan Nardini, Jacinda Mein, Jack Zhou, James Svensson, Jeff Stanway, Jetha Chan, Jin Peng Zhou, Joana Carrasqueira, Joana Iljazi, Jocelyn Becker, Joe Fernandez, Joost van Amersfoort, Josh Gordon, Josh Lipschultz, Josh Newlan, Ju yeong Ji, Kareem Mohamed, Kartikeya Badola, Kat Black, Katie Millican, Keelin McDonell, Kelvin Nguyen, Kiranbir Sodhia, Kish Greene, Lars Lowe Sjoesund, Lauren Usui, Laurent Sifre, Lena Heuermann, Leticia Lago, Lilly McNealus, Livio Baldini Soares, Logan Kilpatrick, Lucas Dixon, Luciano Martins, Machel Reid, Manvinder Singh, Mark Iverson, Martin Görner, Mat Velloso, Mateo Wirth, Matt Davidow, Matt Miller, Matthew Rahtz, Matthew Watson, Meg Risdal, Mehran Kazemi, Michael Moynihan, Ming Zhang, Minsuk Kahng, Minwoo Park, Mofi Rahman, Mohit Khatwani, Natalie Dao, Nenshad Bardoliwalla, Nesh Devanathan, Neta Dumai, Nilay Chauhan, Oscar Wahltinez, Pankil Botarda, Parker Barnes, Paul Barham, Paul Michel, Pengchong Jin, Petko Georgiev, Phil Culliton, Pradeep Kuppala, Ramona Comanescu, Ramona Merhej, Reena Jana, Reza Ardeshir Rokni, Rishabh Agarwal, Ryan Mullins, Samaneh Saadat, Sara Mc Carthy, Sarah Cogan, Sarah Perrin, Sébastien M. R. Arnold, Sebastian Krause, Shengyang Dai, Shruti Garg, Shruti Sheth, Sue Ronstrom, Susan Chan, Timothy Jordan, Ting Yu, Tom Eccles, Tom Hennigan, Tomas Kocisky, Tulsee Doshi, Vihan Jain, Vikas Yadav, Vilobh Meshram, Vishal Dharmadhikari, Warren Barkley, Wei Wei, Wenming Ye, Woohyun Han, Woosuk Kwon, Xiang Xu, Zhe Shen, Zhitao Gong, Zichuan Wei, Victor Cotruta, Phoebe Kirk, Anand Rao, Minh Giang, Ludovic Peran, Tris Warkentin, Eli Collins, Joelle Barral, Zoubin Ghahramani, Raia Hadsell, D. Sculley, Jeanine Banks, Anca Dragan, Slav Petrov, Oriol Vinyals, Jeff Dean, Demis Hassabis, Koray Kavukcuoglu, Clement Farabet, Elena Buchatskaya, Sebastian Borgeaud, Noah Fiedel, Armand Joulin, Kathleen Kenealy, Robert Dadashi, and Alek Andreev. Gemma 2: Improving open language models at a practical size, 2024. URL https://arxiv.org/abs/2408.00118.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
Yixuan Wang, Shiyu Ji, Yijun Liu, Qingfu Zhu, and Wanxiang Che. EchoKV: Efficient KV cache compression via similarity-based reconstruction. arXiv preprint arXiv:2603.22910, 2026.
Guangxuan Xiao, Ji Lin, Mickael Seznec, Hao Wu, Julien Demouth, and Song Han. Smoothquant: Accurate and efficient post-training quantization for large language models. In International conference on machine learning, pp. 38087–38099. PMLR, 2023.
Guangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han, and Mike Lewis. Efficient streaming language models with attention sinks. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=NG7sS51zVF.
Yuhui Xu, Zhanming Jie, Hanze Dong, Lei Wang, Xudong Lu, Aojun Zhou, Amrita Saha, Caiming Xiong, and Doyen Sahoo. ThinK: Thinner key cache by query-driven pruning. In International Conference on Learning Representations (ICLR), 2025. arXiv:2407.21018.
Xianglong Yan, Zhiteng Li, Tianao Zhang, Linghe Kong, Yulun Zhang, and Xiaokang Yang. Re-CalKV: Low-rank KV cache compression via head reordering and offline calibration. arXiv preprint arXiv:2505.24357, 2025.
An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, Chujie Zheng, Dayiheng Liu, Fan Zhou, Fei Huang, Feng Hu, Hao Ge, Haoran Wei, Huan Lin, Jialong Tang, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Yang, Jiaxi Yang, Jing Zhou, Jingren Zhou, Junyang Lin, Kai Dang, Keqin Bao, Kexin Yang, Le Yu, Lianghao Deng, Mei Li, Mingfeng Xue, Mingze Li, Pei Zhang, Peng Wang, Qin Zhu, Rui Men, Ruize Gao, Shixuan Liu, Shuang Luo, Tianhao Li, Tianyi Tang, Wenbiao Yin, Xingzhang Ren, Xinyu Wang, Xinyu Zhang, Xuancheng Ren, Yang Fan, Yang Su, Yichang Zhang, Yinger Zhang, Yu Wan, Yuqiong Liu, Zekun Wang, Zeyu Cui, Zhenru Zhang, Zhipeng Zhou, and Zihan Qiu. Qwen3 technical report, 2025a. URL https://arxiv.org/abs/2505.09388.
June Yong Yang, Byeongwook Kim, Jeongin Bae, Beomseok Kwon, Gunho Park, Eunho Yang, Se Jung Kwon, and Dongsoo Lee. No token left behind: Reliable kv cache compression via importance-aware mixed precision quantization. CoRR, abs/2402.18096, 2024a. URL https://doi.org/10.48550/arXiv.2402.18096.
Qingyue Yang, Jie Wang, Xing Li, Zhihai Wang, Chen Chen, Lei Chen, Xianzhi Yu, Wulong Liu, Jianye HAO, Mingxuan Yuan, and Bin Li. Attentionpredictor: Temporal patterns matter for KV cache compression. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025b. URL https://openreview.net/forum?id=Guar1tumDr.
Songlin Yang, Bailin Wang, Yikang Shen, Rameswar Panda, and Yoon Kim. Gated linear attention transformers with hardware-efficient training. In Forty-first International Conference on Machine Learning, 2024b. URL https://openreview.net/forum?id=ia5XvxFUJT.
Songlin Yang, Bailin Wang, Yu Zhang, Yikang Shen, and Yoon Kim. Parallelizing linear transformers with the delta rule over sequence length. In A. Globerson, L. Mackey, D. Belgrave, A. Fan, U. Paquet, J. Tomczak, and C. Zhang (eds.), Advances in Neural Information Processing Systems, volume 37, pp. 115491–115522. Curran Associates, Inc., 2024c. doi: 10.52202/079017-3668. URL https://proceedings.neurips.cc/paper_files/paper/2024/file/d13a3eae72366e61dfdc7eea82eeb685-Paper-Conference.pdf.
Songlin Yang, Jan Kautz, and Ali Hatamizadeh. Gated delta networks: Improving mamba2 with delta rule. In The Thirteenth International Conference on Learning Representations, 2025c. URL https://openreview.net/forum?id=r8H7xhYPwz.
Hao Yu, Zelan Yang, Shen Li, Yong Li, and Jianxin Wu. Effectively compress KV heads for LLM. arXiv preprint arXiv:2406.07056, 2024.
Zhihang Yuan, Yuzhang Shang, Yue Song, Dawei Yang, Qiang Wu, Yan Yan, and Guangyu Sun. Asvd: Activation-aware singular value decomposition for compressing large language models, 2025. URL https://arxiv.org/abs/2312.05821.
Amir Zandieh, Majid Daliri, and Insu Han. Qjl: 1-bit quantized jl transform for kv cache quantization with zero overhead. In Proceedings of the Thirty-Ninth AAAI Conference on Artificial Intelligence and Thirty-Seventh Conference on Innovative Applications of Artificial Intelligence and Fifteenth Symposium on Educational Advances in Artificial Intelligence, AAAI'25/IAAI'25/EAAI'25. AAAI Press, 2025. ISBN 978-1-57735-897-8. doi: 10.1609/aaai.v39i24.34773. URL https://doi.org/10.1609/aaai.v39i24.34773.
Amir Zandieh, Majid Daliri, Majid Hadian, and Vahab Mirrokni. Turboquant: Online vector quantization with near-optimal distortion rate. In The Fourteenth International Conference on Learning Representations, 2026. URL https://openreview.net/forum?id=tO3ASKZlok.
Rongzhi Zhang, Kuang Wang, Liyuan Liu, Shuohang Wang, Hao Cheng, Chao Zhang, and Yelong Shen. LoRC: Low-rank compression for LLMs KV cache with a progressive compression strategy. In NeurIPS 2024 Workshop on Efficient Natural Language and Speech Processing (ENLSP), 2024. arXiv:2410.03111.
Zhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen, Lianmin Zheng, Ruisi Cai, Zhao Song, Yuandong Tian, Christopher Re, Clark Barrett, Zhangyang Wang, and Beidi Chen. H2o: Heavy-hitter oracle for efficient generative inference of large language models. In Thirty-seventh Conference on Neural Information Processing Systems, 2023. URL https://openreview.net/forum?id=RkRrPp7GKO.
Yuxuan Zhu, David H. Yang, Mohammad Mohammadi Amiri, Keerthiram Murugesan, Tejaswini Pedapati, and Pin-Yu Chen. OjaKV: Context-aware online low-rank KV cache compression with Oja's rule. arXiv preprint arXiv:2509.21623, 2025.
A EXTENDED RELATED WORKS
A.1 TEST-TIME ADAPTATION AND LEARNED ASSOCIATIVE MEMORY
A separate line of work reframes sequence modelling itself as online learning at inference. The motivating observation is that the distribution of sequences encountered at test time differs substantially from the training distribution, and that a model which can fit itself to the stream it is currently processing should enjoy better in-context performance.
Test-time training (Sun et al., 2020) gives this idea a concrete architectural form. Rather than maintaining a fixed memory state, Sun et al. (2025b) treat the state itself as the parameters of a small predictive model, updated during inference by a self-supervised reconstruction loss over the incoming tokens. This makes the memory a sequence-specific map learned online, rather than a hand-specified accumulation rule or a static summary of the past. Titans (Behrouz et al., 2025) similarly add a neural long-term memory trained at test time, using a surprise-based gradient update and adaptive forgetting mechanism, and combine it with short-window attention for longer-range storage.
This view has roots in Fast Weight Programmers (Schmidhuber, 1992; 1993), where a slow controller network writes key-value associations into fast weights. Schlag et al. (2021) later showed that linear attention (Katharopoulos et al., 2020) can be interpreted as such a fast-weight memory, with later variants improving the write rule using delta-style corrections and gates (Yang et al., 2024b;c; 2025c). We inherit the core abstraction of this line (a map from keys to values trained by a reconstruction loss) but not its deployment regime: the map is fit once, after prefill, to the completed KV cache of a pretrained Transformer, and neither the base model nor the attention computation is modified at inference.
B RECONSTRUCTION NETWORK AND OPTIMISATION DETAILS
Architecture. For each Transformer layer and KV head , we fit an independent reconstruction network that maps keys to values, repeated here from Equation (1) in Section 3 with the hidden-width factor made explicit. The predictor is a two-layer MLP with hidden width , where is the hidden-width factor, and uses ReLU as the activation function :
The linear branch is initialised from the Slim Attention prior, , while the MLP learns a non-linear correction to this mapping. Although each head has separate parameters, all heads within a layer are evaluated and optimised in parallel by storing their parameters with the head dimension as an additional batch dimension. This preserves head-specific key-value mappings without requiring a separate training loop for every head.
Algorithm 1 Value Cache Amortisation
1: Input KV cache , residual budget 2: Initialise from warm-started parameters 3: Train on using MSE loss 4: 5: (per-token error) 6: Select top- fraction of tokens with largest errors 7: Store residuals only for selected tokens 8: for each decoding step 9: Reconstruct values 10: Add stored residuals to selected tokens 11: Compute attention using 12: end for
Layer-wise Fitting during Prefill. We train the reconstruction networks sequentially as the model progresses through prefill. Once attention layer has produced its key and value states, we fit the
| Hyperparameter | Setting |
|---|---|
| Number of MLP layers | 2 |
| Hidden-width factor | 1 |
| Activation | ReLU |
| Loss | MSE |
| Optimiser | Adam |
| Learning rate | 0.001 |
Table 6: Hyperparameters used to train the value-reconstruction networks used for value cache amortisation.
reconstruction networks for that layer before continuing to layer . The base-model parameters remain frozen throughout.
For a layer with KV heads, we minimise the head-averaged reconstruction objective
The sequence dimension is processed in a single batch, while the head dimension is always batched. After optimisation, we compute the reconstruction error of every token, retain residual corrections for the highest-error tokens under the specified residual budget, and discard the dense value targets and optimiser state before processing the next layer. Consequently, dense value targets and reconstruction-network optimiser states are required for only one layer at a time, substantially reducing peak memory relative to fitting all layers simultaneously.
Key-cache quantisation crossover. xKV factorises the layer-grouped key cache as , where is a layer-specific reconstruction matrix and holds the left singular vectors of the shared low-rank subspace. With layer-group size , this stores in memory and in , where is the context length, the decomposition rank, and the flattened key width of one layer. Since only scales with , quantising it captures most of the memory reduction at long context. The basis is independent of : quantising it would save only while injecting error into every reconstructed key, and with the crossover is roughly , beyond which quantising is not worth its cost – this is why we quantise only in the main experiments.
C COMPRESSION RATIO CALCULATION
since uncompressed key bytes = uncompressed value bytes, we can write the compression ratio as the harmonic mean:
Keys are compressed across layers. Groups of adjacent attention layers are flattened and horizontally concatenated into one token-by-feature matrix, which is factorised as at a rank chosen to hit a target ratio. What is stored is and . is the bytes per element.
where
so
The rank is chosen to meet compression ratio by solving
Values are compressed within a layer. The value cache stores the MLP's parameters plus the residuals and indices for the hard to predict values. For a single layer, with values, each of size ,
where , is the parameter count, is the cost of a residual ( is the bytes per residual index), and is the number of residuals.
The number of residuals is chosen based on the target compression ratio ,
Quantisation, when applied, reduces the storage cost of the factor for the decomposed keys and the residual for the amortised value cache. For , each of the rows becomes bytes of packed indices plus one norm,
and for the residual count,
Eviction, when applied, index-selects the key and value states down to the retained positions before either cache sees them. For layer , the predictor's value-importance scores select
positions, with the first 8 (attention sinks) and the last 64 (local window) forced in and the remainder filled by top importance. The total compression ratio becomes
D EXTENDED RESULTS
D.1 ABLATION STUDIES
To better understand which factors drive the performance of the amortised value cache, we perform a series of ablation studies. We first quantify the contribution of each component of the proposed method, including residual storage, Slim initialisation, warm-starting, and per-head modelling. We then compare alternative Slim initialisation schemes to determine how best to exploit the pretrained key-value relationship.
Architecture Variants. To examine the contribution of each component in the amortised value cache to performance, we remove or vary each individually while keeping all others fixed. The results of this ablation can be seen in Table 7. The residual store and the per-head MLP are by far the most important. Removing residual corrections drops recovered performance from 99.0% to 64.9% (34.1 points), confirming that a small subset of tokens contributes disproportionately to reconstruction error and needs explicit storage. Using a linear predictor instead of an MLP leads to a recovered performance of 57.5%, a performance drop even greater than not having a residual store. The linear map is fitted by least squares, , where denotes the pseudoinverse of the unrotated key matrix. Values are reconstructed as , retaining the same residual-storage mechanism and target compression budget. Per-head reconstruction is the second most important choice: replacing per-head MLPs with a shared per-layer model costs 19.5 points, suggesting different heads learn distinct key-value geometries.
| Method | LongBench (%) | Δ |
|---|---|---|
| Amortisation | 99.0 | |
| w/o error-residual store | 64.9 | -34.1 |
| w/o slim initialisation | 97.2 | -1.8 |
| w/o warm start | 97.1 | -1.9 |
| w per-layer MLP | 79.5 | -19.5 |
| w linear predictor | 57.5 | -41.5 |
Table 7: Ablation of the main components of the amortised value cache method for Mistral-7B at 3× value cache compression. LongBench scores are reported as percentages of the uncompressed KV cache baseline, and Δ denotes the absolute change in recovered performance relative to the full amortisation method.

Figure 5: Residual selection strategies at equal residual budgets on RULER NIAH-Multikey-1 for Llama-3.1-8B-Instruct, using the full LowRAM pipeline at 4× compression with the meta-learned initialisation (2 gradient updates). Left: mean squared error between attention outputs computed with the compressed and exact KV caches (n=16). Right: NIAH accuracy (n=200). + 8 sinks forces residuals for the first 8 tokens within the same budget. All strategies share the same compressed key cache and are evaluated on the same sequences.
Residual Selection. To test whether the choice of which tokens receive residuals matters beyond the residual budget itself, we compare four selection strategies at equal budgets on RULER NIAH-Multikey-1 (4K tokens) with Llama-3.1-8B-Instruct. We apply the full LowRAM pipeline at 4× compression with the meta-learned initialisation (2 gradient updates). This is the regime in which the predictor is least converged, and in which residual selection should therefore matter most. Random assigns residuals to uniformly sampled tokens. MSE is our default, which ranks tokens by reconstruction error. The + 8 sinks variants additionally force residuals for the first 8 tokens (attention sinks) within the same budget. All strategies share the same compressed key cache and are evaluated on the same sequences, so differences between them isolate the effect of residual selection. We report NIAH accuracy over 200 samples and, on 16 of them, the mean squared error between attention outputs computed with the compressed and the exact KV cache.
Figure 5 shows that error-ranked selection is necessary. Random selection scores less than 40%, with or without sinks, whereas MSE-ranked selection recovers 98%. Forcing residuals for attention sinks reduces attention-output error for both random and MSE-ranked selection but does not positively affect accuracy. This observation is consistent with Section 3.1 in which we show that reconstruction error is an imperfect proxy for downstream performance for values.
Optimisation Budget and Slim Attention Initialisation. We examine how the fidelity of value cache amortisation changes with the per-context optimisation budget and with the Slim Attention
| Predictor | Updates | RULER 4K (%) | LongBench (%) | ||||
|---|---|---|---|---|---|---|---|
| 2× | 3× | 4× | 2× | 3× | 4× | ||
| MLP | 10 | 90.8 | 78.0 | 61.5 | 76.2 | 69.0 | 59.0 |
| MLP + | 10 | 98.4 | 94.4 | 79.0 | 84.9 | 82.3 | 78.1 |
| MLP | 100 | 99.4 | 97.6 | 88.9 | 93.6 | 91.7 | 88.9 |
| MLP + | 100 | 99.9 | 99.1 | 95.1 | 94.4 | 93.8 | 91.5 |
| MLP | 200 | 99.9 | 99.2 | 97.1 | 98.1 | 98.7 | 97.9 |
| MLP + | 200 | 99.9 | 99.5 | 97.3 | 98.8 | 98.4 | 97.3 |
| MLP | 300 | 100.0 | 99.6 | 98.2 | 100.4 | 100.4 | 99.3 |
Table 8: Recovered performance of value cache amortisation on Llama-3.1-8B as a function of the per-context optimisation budget and Slim Attention initialisation. Keys are retained exactly, and results are reported relative to the uncompressed-cache baseline. All predictors are two-layer per-head MLPs trained without warm-starting. The 300-update configuration is the high-fidelity result summarised in Table 5.
initialisation. These experiments isolate value compression by retaining the key cache exactly. We use Llama-3.1-8B throughout. Warm-starting is disabled so that the effect of can be measured independently.
The plain MLP configuration learns the key-to-value map entirely from the current context. In the + configuration, the predictor additionally contains a trainable linear residual branch initialised using the Slim Attention prior,
where denotes the Moore-Penrose pseudoinverse of the key projection. The residual branch is jointly optimised with the MLP during per-context adaptation.
Increasing the optimisation budget consistently improves the fidelity of the amortised value cache. At 4× compression, the plain MLP improves from 61.5% to 98.2% on RULER and from 59.0% to 99.3% on LongBench as the budget increases from 10 to 300 updates. Performance is largely saturated after 200-300 updates.
The Slim prior is most useful when the adaptation budget is small. With only 10 updates, improves 4× recovery by 17.5 percentage points on RULER and 19.1 points on LongBench. Its effect becomes much smaller after 200 updates, where the plain MLP has sufficient time to learn a comparable mapping directly from the context. This indicates that primarily accelerates adaptation rather than improving the converged solution.
Slim Attention Initialisation. We consider two parameterisations. In the joint variant, all KV heads are concatenated and a single mapping is estimated. This map may use key dimensions from any KV head to reconstruct the value dimensions of any other KV head. In the per-head variant, we instead estimate one independent map per KV head, which prohibits cross-head mixing,
For the MLP in the amortised value cache, the linear map is incorporated as a residual branch:
where is the learned MLP predictor. In the per-head setting, the residual is applied independently to each head: . In the joint setting, the MLP remains head-wise, but its residual branch can mix information across KV heads. The joint and per-head rows use the linear reconstruction alone, without the learned MLP correction.
Table 9 shows that the linear-only joint initialisation is substantially more accurate than its per-head counterpart, but requires considerably more storage. For the 8-KV-head, configuration used by both models, the joint map contains parameters per layer, whereas
| Model | Value Predictor | shape | CR | LongBench (%) |
|---|---|---|---|---|
| Mistral-7B | Joint | 39.7 | ||
| Per-head | 9.7 | |||
| 9.5 | ||||
| 84.7 | ||||
| Llama-3.1-8B | Joint | 67.8 | ||
| Per-head | 20.3 | |||
| 18.5 | ||||
| 82.3 |
Table 9: Ablation of joint and per-head initialisation for value cache amortisation on LongBench. Joint permits mixing across KV heads, whereas per-head applies an independent map to each KV head. LongBench scores are percentages of the uncompressed baseline. CR refers to compression ratio. Differences in achieved compression ratio between Mistral and Llama reflect model-specific effective context lengths induced by their different tokenizers.
the per-head map contains . This accounts for the much higher compression of per-head relative to joint .
When is added as a residual branch and jointly optimised (10 gradient updates) with the MLP, the per-head residual consistently outperforms the joint residual. This difference may reflect both the more constrained head-wise parameterisation and the compression budget: at a fixed target compression ratio, the smaller per-head leaves more memory available for storing exact value residuals, which correct the largest reconstruction errors.
D.2 SWEEP OVER COMPRESSION RATIOS
Table 10 provides the full compression-performance sweep underlying Table 3. It reports results for LowRAM, eviction, and quantisation, both individually and in combination, across models and benchmarks. Table 11 similarly expands Table 4, showing how performance varies across compression ratios on the subset of LongBench examples exceeding 10K tokens.
E META-LEARNING
We reduce the cost of fitting the value cache MLP by meta-learning an initialisation from which the reconstruction network can rapidly memorise the key-to-value mapping of a previously unseen sequence. This differs from the generalisation-after-adaptation objective typically considered in meta-learning. During prefill, all key-value pairs are observed, and the adapted predictor is evaluated on its ability to reconstruct those same values. Our objective is therefore rapid fitting of the observed context rather than generalisation to a held-out query set.
We use First-Order Model-Agnostic Meta-Learning (FOMAML). Let
denote one meta-learning task, consisting of the key-value pairs from a single sequence. We omit layer and head indices for clarity; the same procedure is applied to each per-head reconstruction network. The reconstruction loss for is
| Model | Method | RULER (4K) | LongBench | ||
|---|---|---|---|---|---|
| CR | % | CR | % | ||
| Mistral-7B | Eviction | 2× | 99.9 | 2× | 99.4 |
| 3× | 99.3 | 3× | 97.6 | ||
| 4× | 98.0 | 4× | 96.3 | ||
| Quantisation | 5.1× | 99.5 | 5.1× | 98.9 | |
| LowRAM | 2× | 99.4 | 2× | 100.7 | |
| 3× | 98.8 | 3× | 99.4 | ||
| 4× | 96.0 | 4× | 97.9 | ||
| LowRAM-E | 4× | 99.2 | 4× | 97.8 | |
| 6× | 97.3 | 6× | 97.5 | ||
| 8× | 91.8 | 8× | 96.6 | ||
| LowRAM-Q | 3.3× | 99.8 | 4.5× | 99.9 | |
| 4.1× | 99.6 | 5.6× | 99.5 | ||
| 4.8× | 99.6 | 6.4× | 99.4 | ||
| LowRAM-EQ | 5.13× | 99.1 | 7.5× | 97.7 | |
| 6.7× | 93.6 | 9.3× | 97.4 | ||
| 8.7× | 89.1 | 10.7× | 96.9 | ||
| Llama-3.1-8B | Eviction | 2× | 99.6 | 2× | 98.8 |
| 3× | 98.8 | 3× | 96.6 | ||
| 4× | 98.1 | 4× | 95.4 | ||
| Quantisation | 5.1× | 99.8 | 5.1× | 96.3 | |
| LowRAM | 2× | 99.6 | 2× | 98.7 | |
| 3× | 97.9 | 3× | 98.5 | ||
| 4× | 93.9 | 4× | 99.6 | ||
| LowRAM-E | 4× | 97.3 | 4× | 94.3 | |
| 6× | 90.0 | 6× | 92.4 | ||
| 8× | 79.9 | 8× | 90.6 | ||
| LowRAM-Q | 3.4× | 99.9 | 4.4× | 96.5 | |
| 4.2× | 99.7 | 5.3× | 95.8 | ||
| 4.8× | 99.4 | 6.1× | 95.8 | ||
| LowRAM-EQ | 5.2× | 98.2 | 7.1× | 93.5 | |
| 6.7× | 96.4 | 8.8× | 91.3 | ||
| 8.8× | 82.7 | 10.2× | 89.4 | ||
Table 10: Recovered performance of LowRAM, used alone or combined with eviction and quantisation, across a range of compression settings for Mistral-7B and Llama-3.1-8B. Results are reported as percentages of the corresponding uncompressed baseline on RULER 4K and LongBench. Grey rows show eviction and quantisation applied independently, blue rows show LowRAM alone, and unshaded rows show LowRAM combined with eviction (LowRAM-E), quantisation (LowRAM-Q), or both (LowRAM-EQ). CR denotes the total compression ratio achieved on each benchmark; for combined methods, it accounts for the composition of the individual compression components and may differ between benchmarks because of sequence-length variation and across models due to model-specific effective context lengths induced by their different tokenizers.
Starting from the shared initialisation , the task-specific parameters are adapted for inner-loop updates:
| Method | LongBench (>10K) | |
|---|---|---|
| CR | Score (%) | |
| Eviction | 3.0× | 98.1 |
| 4.0× | 97.8 | |
| 8.0× | 93.9 | |
| 10.0× | 91.6 | |
| Quantisation | 3.9× | 100.0 |
| 5.1× | 99.3 | |
| 7.5× | 92.3 | |
| 14.2× | 33.4 | |
| LowRAM | 3.0× | 99.6 |
| 4.0× | 97.2 | |
| 6.0× | 95.2 | |
| 7.0× | 93.4 | |
| 8.0× | 91.9 | |
| 9.0× | 90.7 | |
| 10.0× | 89.0 | |
| LowRAM-EQ | 9.2× | 99.2 |
| 17.8× | 98.0 | |
| 22.1× | 96.2 | |
| 26.9× | 94.5 | |
Table 11: Compression ratio and recovered performance for Mistral-7B using different KV cache compression methods, evaluated on the subset of LongBench examples with sequence lengths exceeding 10k tokens. Scores are reported as percentages of the uncompressed baseline. CR refers to compression ratio and is calculated from the byte-level key and value footprints described in Appendix C
where denotes one update of the inner optimiser with learning rate . The same sequence is used in the inner and outer loops because the desired behaviour is rapid memorisation of the observed key-value pairs.
The meta-loss is evaluated only after the final inner-loop update:
Following FOMAML, we ignore derivatives through the inner-loop optimisation trajectory. For a sequence , its first-order contribution to the meta-gradient is therefore
This avoids the second-order derivatives that would otherwise arise when differentiating the final adapted parameters with respect to .
During meta-training, we process one sequence at a time. For each sequence , the reconstruction network is independently initialised from the current shared parameters and adapted for inner-loop updates. We compute its final-step meta-gradient and accumulate this gradient without performing an outer update. After processing sequences, we average the accumulated gradients:
and use to perform one outer-optimiser update of . Because no outer update occurs during the accumulation window, all sequences begin their inner-loop adaptation from the same current
| Component | Hyperparameter | Setting |
|---|---|---|
| Meta-optimisation | Algorithm | FOMAML |
| Inner-loop updates, | 2 | |
| Inner optimiser | Adam | |
| Inner learning rate, | ||
| Outer optimiser | AdamW | |
| Outer learning rate, | ||
| Outer-loop gradient accumulation | 8 | |
| Inner-loop batch size | 4 | |
| Predictor | Number of layers | 2 |
| Hidden-width factor, | 1 | |
| Activation | ReLU | |
| Objective | MSE |
Table 12: Hyperparameters used to meta-learn the value-predictor initialisation. The inner and outer objectives use the same key-value pairs because the desired behaviour is rapid memorisation of the observed context.
initialisation. The effective meta-batch size is therefore sequences, although only one sequence and its adapted reconstruction network are processed at a time.
At inference time, each reconstruction network is initialised from the learned parameters and adapted to the new sequence for updates using its complete set of key-value pairs. Meta-training is performed offline and therefore does not contribute to TTFT.
| RULER 4K (%) | LongBench (%) | ||||
|---|---|---|---|---|---|
| 98.4 (-1.2) | 96.1 (-1.8) | 91.2 (-2.7) | 93.6 (-5.1) | 93.0 (-5.5) | 91.1 (-8.5) |
Table 13: Recovered performance of LowRAM when the amortised value cache is initialised from meta-learned weights and adapted with only 2 gradient steps for Llama-3.1-8B. Scores are reported as percentages of the uncompressed baseline; values in parentheses give the drop in percentage points relative to vanilla LowRAM (Table 1), which uses 150 gradient steps per context.
F SELECTIVE RECONSTRUCTION
To reduce decode-time compute, we adopt landmark-guided selective reconstruction, following ShadowKV (Sun et al., 2025a): rather than reconstructing the full key/value cache at every decode step, we retrieve and reconstruct only a query-dependent subset of tokens, using inexpensive per-chunk landmarks as a cheap proxy for full attention when deciding which tokens to retrieve.
Prefill: landmark construction and exact retention. During prefill, keys are partitioned into fixed-size chunks of tokens, and a landmark is computed for each chunk as the mean of its keys. Two subsets of chunks are then set aside and kept exact (both keys and values, uncompressed) rather than represented by their landmark: the chunks whose keys are least similar to their own landmark (outlier chunks, as in ShadowKV), and the chunks overlapping the most recent tokens (a local window; unlike the landmark and outlier mechanism, this is not part of ShadowKV's original design). The remaining chunks form the landmark pool used for query-time retrieval at decode time.
This exact retention is not free: the landmarks, their chunk indices, and the outlier/local exact keys and values are all additional persistent state on top of the compressed key cache itself. Rather than reporting a compression ratio that ignores this, we account for it directly in rank selection. Because xKV shares one low-rank factor across every layer in a group rather than factorising each layer independently, this overhead is measured per layer but spent per group: at the point a group's decomposition is triggered, we sum the selective-reconstruction overhead of every layer in the group and subtract it from the byte budget implied by the group's target compression ratio before choosing
| Parameter | Value |
|---|---|
| Chunk size | 8 tokens |
| Token budget | 2048 tokens |
| Local window | 32 tokens |
| Outlier chunks | 48 chunks (384 tokens) |
| Max. tokens attended per step | 2464 tokens |
Table 14: Selective reconstruction configuration.
the shared rank, so the group's realised ratio (low-rank factors plus the combined overhead of its member layers) matches the configured target.
We additionally accelerate the low-rank key decomposition using a custom randomised SVD kernel adapted from xKV (Chang et al., 2026, Appendix C.2), which executes power iterations in 16-bit precision and replaces Householder QR with a parallelisable shifted Cholesky-QR factorisation, in place of exact SVD when factorising the key matrices. This modification leads to a 4× speedup over exact SVD without harming performance.
Decoding: landmark-guided retrieval. Landmarks are computed per key/value head, so under grouped-query attention we pool scores across each group of query heads sharing a head by taking the max, before selecting chunks. At each decode step, the incoming query is scored against every landmark in the pool, and the top- chunks (a chunk budget , equal to the token budget in Table 14 divided by chunk size ) are retrieved and expanded back into token positions. The retrieved positions are combined with the exact outlier and local positions; keys and values, though compressed independently, are reconstructed at this shared set of positions.
Persistent reconstruction cache. Following ShadowKV, we avoid redundant reconstruction work across decode steps by keeping a persistent buffer of the most recently reconstructed chunks (capacity tokens). At each step, the newly selected chunk set is diffed against what the buffer already holds: chunks selected again are reused as-is, and only chunks newly entering the selection are reconstructed and written into the buffer. This is implemented via fused CUDA kernels adapted from ShadowKV/xKV.
Figure 4 presents the results for decode throughput, comparing LowRAM-SR (LowRAM with landmark-guided selective retrieval) at 4× compression against the uncompressed baseline at the same context length and batch size.
G BENCHMARKS

Figure 6: TTFT overhead of value cache amortisation alone versus the number of gradient updates used to fit the MLP, at a 4K-token sequence length with batch size 4. Keys are left uncompressed, so this isolates the cost of fitting the value predictor. Bars show raw TTFT; annotations give the overhead relative to the uncompressed baseline. See Figure 7 for the full LowRAM pipeline, including key factorisation.

Figure 7: TTFT of the uncompressed baseline (exact KV) and the full LowRAM pipeline at 4× compression across context lengths and batch sizes. LowRAM timings include both value cache amortisation (2 gradient updates) and low-rank factorisation of the keys via randomised Cholesky-QR, so overheads exceed those of the value cache alone (Figure 6). Annotations give the overhead relative to the baseline; OOM marks configurations where the baseline runs out of memory.

Figure 8: Analytical memory footprint of the amortised value cache as a function of sequence length. Left: total value cache memory for the uncompressed baseline against value cache amortisation at 4× compression. Right: decomposition of our footprint on a logarithmic scale. The MLP parameters and the linear residual are constant in sequence length, while only the stored residuals and their indices scale with T. The fixed parameter cost dominates only at short contexts (below 2–3k tokens), and is quickly amortised as the context grows.
| Dataset | Source | Avg len | Metric | Language | #data | #data (>10K) | |
|---|---|---|---|---|---|---|---|
| Mistral | Llama | ||||||
| Single-Document QA | |||||||
| NarrativeQA | Literature, Film | 18,409 | F1 | English | 200 | 181 | 181 |
| Qasper | Science | 3,619 | F1 | English | 200 | 11 (excl.) | 7 (excl.) |
| MultiFieldQA-en | Multi-field | 4,559 | F1 | English | 150 | 46 | 24 |
| Multi-Document QA | |||||||
| HotpotQA | Wikipedia | 9,151 | F1 | English | 200 | 171 | 158 |
| 2WikiMultihopQA | Wikipedia | 4,887 | F1 | English | 200 | 49 | 38 |
| MuSiQue | Wikipedia | 11,214 | F1 | English | 200 | 197 | 195 |
| Summarization | |||||||
| GovReport | Government report | 8,734 | Rouge-L | English | 200 | 99 | 88 |
| QMSum | Meeting | 10,614 | Rouge-L | English | 200 | 160 | 153 |
| MultiNews | News | 2,113 | Rouge-L | English | 200 | 5 (excl.) | 4 (excl.) |
| Few-shot Learning | |||||||
| TREC | Web question | 5,177 | Accuracy (CLS) | English | 200 | 59 | 36 |
| TriviaQA | Wikipedia, Web | 8,209 | F1 | English | 200 | 136 | 123 |
| SAMSum | Dialogue | 6,258 | Rouge-L | English | 200 | 111 | 90 |
| Synthetic Task | |||||||
| PassageRetrieval-en | Wikipedia | 9,289 | Accuracy (EM) | English | 200 | 200 | 200 |
| Code Completion | |||||||
| LCC | Github | 1,235 | Edit Sim | Python/C#/Java | 500 | 26 | 14 (excl.) |
| RepoBench-P | Github repository | 4,206 | Edit Sim | Python/Java | 500 | 307 | 229 |
| Total | 3,550 | 1,742 | 1,515 | ||||
Table 15: LongBench datasets used for evaluation. #data (>10K) gives the number of samples in the long-context subset used in Tables 4 and 11, i.e. samples whose prompt exceeds 10K tokens under the Mistral-7B and Llama tokenizers, respectively. Qasper and MultiNews (and LCC for Llama) are excluded from this subset because less than 20 of their samples meet the length requirement. Avg len is reported in words, following the original LongBench statistics.