[KongchangAI]
Other

KV Cache

Core Facts

Timeline (last 90 days)

Dec 3

Compressing visual tokens can directly reduce the input length of multimodal models; low-memory attention (such as chunked computation and KV cache compression) can alleviate memory usage under long sequences.

Unverified50%
Dec 2

In Transformer decoding, the KV cache stores already-computed key-value pairs so that subsequent generation only needs to process new tokens, thereby avoiding redundant computation.

Unverified50%
Dec 2

SpatialPaw's workflow is: the VLM prefills the video, question and text graph in a single pass, then reuses the KV cache to generate multiple answers in parallel and derives the final result via majority voting.

Unverified50%
Nov 30

For multimodal large models, the hundreds to thousands of visual tokens produced by the vision encoder from an image enter the KV cache together with the text tokens.

Unverified50%
Nov 30

The essential difference between the hidden state cache and the KV cache is that the cache is the training data, and compression leads to train-serving mismatch.

Unverified50%
Nov 28

In GLM 5.4's Loop Transformer, the second pass inherits the KV of distant positions selected from context in the first pass, and recomputes the KV of the local window using the second pass's state, with a local window size of 128 tokens.

Unverified50%
Nov 28

GLM-5.4's three engineering changes: gated progressive update (independent per-token gating each round, written back proportionally to the residual stream), hybrid KV cache (the second round reuses the first round's sparse KV, retaining only the sliding-window KV newly generated in the current round), and direct reuse of the first round's sparse attention indices.

Unverified50%
Nov 24

Traditional benchmarks often assume by default that the execution environment is neutral and transparent, but in actual deployment factors such as KV cache pressure, resource scheduling policies, and tool-call timing all intervene.

Unverified50%
Nov 24

Under KV cache pressure, the Star workflow's average latency ranking dropped from first to fourth, while the Chain workflow rose from fourth to first.

Unverified50%
Nov 24

In scenarios with many concurrent requests or multiple agents sharing a model service, the KV cache faces pressure from eviction and swapping, directly causing slower inference or even request timeouts.

Unverified50%

39 more timeline events

All Facts (20)

Verified

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%
Verified

KV Cache avoids redundant computation by caching already-computed Key and Value matrices, and advanced techniques such as PagedAttention further optimize cache memory management efficiency.

90%
Verified

In the KV Cache mechanism, reusing cached KV values is a cache hit, while context changes that invalidate the cache and require recomputation are a cache miss.

80%
Verified

KV Cache是Transformer架构的核心推理优化机制,其显存占用量会随序列长度和并发批次线性增长

80%
Verified

The KV cache mechanism saves the Key and Value matrices of historical tokens and reuses them in subsequent generation, thereby amortizing the per-unit cost of the input stage.

75%
Verified

The GPU memory occupied by the KV cache grows with context length and dialogue turns, and is the main source of memory usage and latency in long-context deployment.

75%
Verified

When generating each token, a Transformer model needs to compute the Key and Value vectors of all previous tokens, and these tensors are collectively called the KV cache.

75%
Verified

The longer the context, the more the KV cache grows linearly, making memory bandwidth and capacity the main bottleneck for inference throughput.

75%
Verified

The KV cache grows continuously with sequence length, delivering powerful long-range retrieval capability at the cost of memory that cannot be digested into the model itself.

75%
Verified

KV缓存将已计算的Key-Value矩阵存储在显存中实现增量计算,代价是显存占用随序列长度线性增长

75%
Verified

The VRAM consumption of the KV cache is proportional to context length, number of model layers, and number of attention heads; under an 8K context, a typical 27B model may consume an additional 2–4 GB of VRAM.

70%
Verified

KV Cache is a key data structure in autoregressive generation by large models: when generating each new token the model needs the Key and Value vectors of all previous tokens, and if these were recalculated every time the cost would grow quadratically with sequence length.

65%
Verified

KV cache is voluminous, potentially reaching several GB for a single request under long contexts, posing challenges for disk read/write and capacity management.

65%
Verified

KV cache size is proportional to the number of model layers, the number of attention heads, sequence length, and per-head dimension, and is the primary source of VRAM usage during large model inference.

65%
Verified

The size of the KV cache is determined by three multiplied dimensions: the size of each record, how many tokens are combined into one record, and whether layers can share caches with each other.

65%
Verified

The size of the KV cache grows linearly with context length, and VRAM consumption increases significantly when processing longer texts.

65%
Unverified

The prefill phase processes the complete input context, computes attention for all input tokens, and generates the KV cache; it is a compute-intensive operation whose time consumption is strongly correlated with input length.

70%
Unverified

Most companies keep prompt caches for only five minutes, whereas DeepSeek extends cache duration to several days: three days for agent traffic and seven days for chat.

60%
Unverified

Compressing visual tokens can directly reduce the input length of multimodal models; low-memory attention (such as chunked computation and KV cache compression) can alleviate memory usage under long sequences.

50%
Unverified

SpatialPaw's workflow is: the VLM prefills the video, question and text graph in a single pass, then reuses the KV cache to generate multiple answers in parallel and derives the final result via majority voting.

50%

Source Articles