KV-cache
KV cache is a technique used during Transformer model inference to store key-value pairs in order to accelerate autoregressive generation, reducing redundant computation.
Core Facts
The KV cache is a core data structure in Transformer autoregressive inference, and its size is approximately 2 × number of layers × number of attention heads × head dimension × sequence length × precision bytes.
The longer the context, the more the KV cache grows linearly, making memory bandwidth and capacity the main bottleneck for inference throughput.
KVCache is a mechanism in the Transformer architecture that caches the Key and Value vectors of all previous tokens to avoid redundant computation, with its memory footprint growing linearly with context length.
Timeline (last 90 days)
For autoregressive policies, early-half fusion reduces the storage requirements of the historical KV-cache, because the second half no longer needs to maintain cross-expert caches.
Common approaches to compressing the KV-cache include quantization, low-rank decomposition, sparsification, and selective dropping by head or layer.
As context grows, KV-cache memory usage rises linearly, becoming one of the main bottlenecks in long-context inference.
On the KV-cache compression task, Claude Opus 5.5 raised the average compression rate from 6.82% for the human-designed Quant-VideoGen codec to 19.86%.
In LLM inference, FP8 is commonly used for weight and activation quantization, while FP8 quantization of the KV-cache can directly increase the number of cacheable tokens.
KV-Surgeon is an offline KV-cache compression method that uses calibration data to account for interactions among cache entries, deriving a quadratic surrogate model to make joint greedy deletion decisions and performing compensation among the remaining entries.
KV-cache reuse presupposes a stable prefix, and GraphRAG flattens the graph structure into linear text, so the context prefix differs almost every query and the cache hit rate is extremely low.
KV-cache size is proportional to the number of sequence tokens and directly determines the number of concurrent requests a single card can handle; more tokens mean a larger KV-cache per user, and the number of concurrent users on the same GPU shrinks proportionally.
HSQ-A uses a lightweight scoring network to select about 15% of high-impact keys and stores the remaining values in FP8 format, thereby compressing the KV-cache from the 0.8 GB/k common in dense 70B models to 0.12 GB/k, a compression ratio of about 85%.
Implementing instant cancellation of LLM streaming responses requires an unbroken signal propagation chain: the client's AbortController.abort() triggers HTTP fetch teardown, the gateway detects the socket close via the server context and cancels the upstream request context, and the model inference runtime catches the disconnection, stops autoregressive generation, and releases the KV-cache.
3 more timeline events
All Facts (15)
The KV cache is a core data structure in Transformer autoregressive inference, and its size is approximately 2 × number of layers × number of attention heads × head dimension × sequence length × precision bytes.
90%VerifiedThe longer the context, the more the KV cache grows linearly, making memory bandwidth and capacity the main bottleneck for inference throughput.
75%VerifiedKVCache is a mechanism in the Transformer architecture that caches the Key and Value vectors of all previous tokens to avoid redundant computation, with its memory footprint growing linearly with context length.
75%VerifiedDuring autoregressive decoding, each newly generated token requires reading the full KV Cache, making the decoding stage almost always memory-bandwidth-bound rather than compute-bound.
75%UnverifiedFor autoregressive policies, early-half fusion reduces the storage requirements of the historical KV-cache, because the second half no longer needs to maintain cross-expert caches.
50%UnverifiedCommon approaches to compressing the KV-cache include quantization, low-rank decomposition, sparsification, and selective dropping by head or layer.
50%UnverifiedOn the KV-cache compression task, Claude Opus 5.5 raised the average compression rate from 6.82% for the human-designed Quant-VideoGen codec to 19.86%.
50%UnverifiedAs context grows, KV-cache memory usage rises linearly, becoming one of the main bottlenecks in long-context inference.
50%UnverifiedIn LLM inference, FP8 is commonly used for weight and activation quantization, while FP8 quantization of the KV-cache can directly increase the number of cacheable tokens.
50%UnverifiedKV-Surgeon is an offline KV-cache compression method that uses calibration data to account for interactions among cache entries, deriving a quadratic surrogate model to make joint greedy deletion decisions and performing compensation among the remaining entries.
50%UnverifiedKV-cache reuse presupposes a stable prefix, and GraphRAG flattens the graph structure into linear text, so the context prefix differs almost every query and the cache hit rate is extremely low.
50%UnverifiedKV-cache size is proportional to the number of sequence tokens and directly determines the number of concurrent requests a single card can handle; more tokens mean a larger KV-cache per user, and the number of concurrent users on the same GPU shrinks proportionally.
50%UnverifiedHSQ-A uses a lightweight scoring network to select about 15% of high-impact keys and stores the remaining values in FP8 format, thereby compressing the KV-cache from the 0.8 GB/k common in dense 70B models to 0.12 GB/k, a compression ratio of about 85%.
50%UnverifiedImplementing instant cancellation of LLM streaming responses requires an unbroken signal propagation chain: the client's AbortController.abort() triggers HTTP fetch teardown, the gateway detects the socket close via the server context and cancels the upstream request context, and the model inference runtime catches the disconnection, stops autoregressive generation, and releases the KV-cache.
50%UnverifiedNormalizing flows share with large language models the same causal mask, KV-cache mechanism, and a consistent left-to-right sequence generation structure.
50%