[KongchangAI]
ConceptPrefix Caching / Prefix Cache

Prefix Caching

An LLM inference optimization technique that caches and reuses the KV Cache from requests sharing identical prefixes, thereby reducing redundant computation and improving processing efficiency for multi-turn conversations and batches of similar requests.

Core Facts

Timeline (last 90 days)

Nov 20

The approach of saving states on a coarse-grained grid wastes a large amount of reusable prefix, and the portions between checkpoints can only be recomputed.

Unverified50%
Nov 19

Cold resend limits the room for sustainable discounts, so discounts should be tied to cache state rather than promised unconditionally.

Unverified50%
Nov 19

At a context length of 65,536 tokens, cache hits reduced the computational cost of repeated prefixes by more than two orders of magnitude.

Unverified50%
Nov 13

The research team uses trajectory structure for trajectory-aware routing and scheduling to simultaneously promote prefix cache reuse and balance worker loads.

Unverified50%
Nov 11

Prefix caching only takes effect on parts that are identical from the very beginning, so stable formatting of the system prompt is a prerequisite for its effectiveness.

Unverified50%
Nov 11

After enabling aggressive prefix caching and state reuse, the time to first token on private inference nodes dropped from 1200ms on the cloud to under 340ms locally, with a cache hit rate above 90%.

Unverified50%
Nov 10

DeepSeek Harness's design notes call prefix cache hits "Corollary No. 1," i.e., it is a byproduct of the accounting rules rather than a specifically optimized goal.

Unverified50%
Nov 6

DeepSeek's caching mechanism is prefix caching: the server hashes the input token sequence of each request by prefix, and if the start of the current request exactly matches a previous request, the KV cache for that prefix can be reused directly.

Unverified50%
Nov 6

The key constraint of prefix caching is that the prefix must match token by token; even inserting a single character earlier in the text invalidates everything from that position onward.

Unverified50%
Nov 3

Standard prefix caching keeps historical visual tokens in a persistent KV cache whose capacity grows linearly with the number of interaction rounds, quickly exhausting the limited memory budget.

Unverified50%

37 more timeline events

All Facts (20)

Verified

The KV Cache mechanism can cache repeated prefix content, and the more concise the system prompt, the higher the cache hit rate.

90%
Verified

Prompt caching saves the KV state of reusable prefixes (the tokens at the beginning of a prompt that remain unchanged); if the next request starts with an identical prefix, the provider reuses the saved computation and only processes the new portion.

80%
Verified

Prefix caching improves inference efficiency by caching common prompt prefixes to reduce redundant computation.

75%
Verified

Caching means pre-storing recurring system prompts or long documents so that subsequent requests reuse them at a lower unit price, suitable for multi-turn Q&A or fixed knowledge base scenarios.

65%
Verified

Prompt cache validity typically ranges from only a few minutes to several hours, and discount rates and cache windows may be adjusted at any time.

65%
Unverified

When a prefix cache hit occurs, inference latency can drop from the second level to the millisecond level, and the cache-hit price offered by various vendors is typically one-tenth or even lower than the cache-miss price.

70%
Unverified

After using the KV cache, single-token latency remains essentially flat and no longer grows significantly with context length, indicating that the bottleneck is no longer matrix multiplication but fixed overheads such as CPU-side scheduling, kernel launch overhead or GPU memory bandwidth.

60%
Unverified

A prompt cache hit requires the request prefix to be byte-for-byte identical to what was written at cache time; mixing dynamic content such as timestamps or session IDs into system prompts will cause frequent cache invalidation.

60%
Unverified

Prefix caching is extremely sensitive to input stability; as long as any single token in the prefix is modified or inserted, the cache is invalidated and all subsequent content must be recomputed.

60%
Unverified

Mainstream inference frameworks such as vLLM already natively support automatic prefix caching.

60%
Unverified

The approach of saving states on a coarse-grained grid wastes a large amount of reusable prefix, and the portions between checkpoints can only be recomputed.

50%
Unverified

Cold resend limits the room for sustainable discounts, so discounts should be tied to cache state rather than promised unconditionally.

50%
Unverified

At a context length of 65,536 tokens, cache hits reduced the computational cost of repeated prefixes by more than two orders of magnitude.

50%
Unverified

The research team uses trajectory structure for trajectory-aware routing and scheduling to simultaneously promote prefix cache reuse and balance worker loads.

50%
Unverified

Prefix caching only takes effect on parts that are identical from the very beginning, so stable formatting of the system prompt is a prerequisite for its effectiveness.

50%
Unverified

After enabling aggressive prefix caching and state reuse, the time to first token on private inference nodes dropped from 1200ms on the cloud to under 340ms locally, with a cache hit rate above 90%.

50%
Unverified

DeepSeek Harness's design notes call prefix cache hits "Corollary No. 1," i.e., it is a byproduct of the accounting rules rather than a specifically optimized goal.

50%
Unverified

DeepSeek's caching mechanism is prefix caching: the server hashes the input token sequence of each request by prefix, and if the start of the current request exactly matches a previous request, the KV cache for that prefix can be reused directly.

50%
Unverified

The key constraint of prefix caching is that the prefix must match token by token; even inserting a single character earlier in the text invalidates everything from that position onward.

50%
Unverified

Standard prefix caching keeps historical visual tokens in a persistent KV cache whose capacity grows linearly with the number of interaction rounds, quickly exhausting the limited memory budget.

50%

Source Articles