# The Residual Stream Is All You Need: On the Redundancy of the KV Cache in Transformer Inference

Source: [The Residual Stream Is All You Need: On the Redundancy of the KV Cache in Transformer Inference](<https://www.sota2.com/research/paper/69c0c8d90636e5bf4afc3967>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2026-03-24T05:00:03.763Z

Authors: Kaleem Ullah Qasim, Jiashu Zhang, Muhammad Kafeel Shaheen, Razan Alharith, Heying Zhang

Published: 2026-03-20T05:59:50.000Z

## Abstract

The key-value (KV) cache is widely treated as essential state in transformer inference, and a large body of work engineers policies to compress, evict, or approximate its entries. We prove that this state is entirely redundant: keys and values at every layer are deterministic projections of the residual stream, and recomputing them from a single residual vector per token incurs exactly zero reconstruction error, not approximately, but bit-identically. We verify this across six models from four architecture families (135M to 4B parameters). Cross-task residual patching at every layer produces D\_KL = 0 between patched and original output distributions, confirming that the residual stream satisfies a Markov property and is the sole information-carrying state. Removing the cache entirely and recomputing from scratch yields token-identical output under greedy decoding on all models tested. We build on this result with KV-Direct, a bounded-memory inference scheme that checkpoints residual vectors (5 KB per token on Gemma 3-4B) instead of full KV pairs (136 KB), recomputing keys and values on demand. Over 20 conversation turns, KV-Direct holds peak memory at 42 MB while the standard cache grows past 103 MB. Against five eviction baselines (H2O, StreamingLLM, SnapKV, TOVA, window-only), KV-Direct maintains 100% token match at every cache budget; all baselines degrade to 5-28%. A per-operation latency analysis shows recomputation runs up to 5x faster than reading cached tensors at moderate batch sizes. Code is available at https://github.com/Kaleemullahqasim/KV-Direct.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Zero-shot Task Completion on HellaSwag 0-shot (N=500)](<https://www.sota2.com/research/sota/zero-shot-task-completion-on-hellaswag-0-shot-n-500.md>): Zero-shot Task Completion; HellaSwag 0-shot (N=500); Accuracy: 47.5.

- [Language Modeling on WikiText-2 (test)](<https://www.sota2.com/research/sota/language-modeling-on-wikitext-2-test.md>): Language Modeling; WikiText-2 (test); PPL: 17.04.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2603.19664>)

[PDF](<https://arxiv.org/pdf/2603.19664.pdf>)
