The KV cache: why long contexts cost what they cost
Generating each new token requires attending to every previous one. Rather than recomputing that work, models cache it — and that cache, growing linearly with context and multiplied by every concurrent request, is usually what limits how many users a serving system can hold at once.
In one sentence
The KV cache is the stored per-token key and value vectors from previous positions that a transformer reuses when generating each new token, sized in proportion to context length, model dimensions and the number of concurrent requests.
Without a cache, producing token number one thousand would mean recomputing the attention inputs for all nine hundred and ninety-nine before it. The cache removes that repetition, turning generation from quadratic into something manageable — at the price of holding a growing block of memory per request for its whole lifetime.
That memory is the real constraint in most deployments. It is why long-context requests are priced higher, why concurrency drops as contexts grow, and why several distinct architectural techniques exist purely to make the cache smaller.
How it works
What determines its size
Roughly: context length, times the number of layers, times the size of the attention state per layer, times two for keys and values, times the bytes per number. For a large model and a long context this reaches many gigabytes for a single request — which is why concurrency and context length trade directly against each other.
How architectures shrink it
Sharing key and value projections across several attention heads cuts the cache by a large factor at a small quality cost, and has become standard. Compressing the cached state into a smaller latent representation goes further. These are architecture decisions made at training time, not serving-time switches — the model has to be built for them.
Prefix reuse
Applications typically prepend the same long system prompt or document to many requests. Since the cached state for an identical prefix is identical, it can be computed once and shared across requests, or kept between turns of one conversation. For chat and agent workloads this is often the single largest saving available.
What this depends on
1 of these is marked as a chokepoint: a handful of qualified suppliers, a multi-year lead time, or a single geography.
Technology
Paged cache memory management
Sharing and freeing cache blocks on demand is what turns the theoretical saving into usable concurrency.
Prefixes worth keeping between turns outlive the accelerator memory available to hold them, so caches are spilled to host DRAM and back. Without that tier the cache is evicted and the prefix is recomputed.
What each company supplies at this step, and — where a public figure exists — its share of this specific market — with what that share measures, the period it covers and who published it. Some rows also show the company’s own reported revenue for the segment covering this step, which is a different thing: it says how much this business matters to that company, not how much of the market it holds. Not a ranking and not a recommendation.
Sells context caching as a priced feature, which made the cache something buyers reason about rather than an implementation detail.
OpenAIPrivate
Discounts cached input automatically, so prompt structure became a cost decision for every developer on it.
AnthropicPrivate
Prices cache writes and reads separately — the most explicit statement in the market of what this memory costs.
Moonshot AIPrivate
Published and open-sourced the disaggregated cache architecture much of the field's offloading work now follows.
DeepSeekPrivate
Ships latent attention that shrinks the cache rather than moving it, and prices disk-cached tokens separately.
MemVergePrivate
Supplies the memory pooling used to hold caches outside the accelerator without falling back to storage.
What would change the picture
Whether cache offloading to cheaper memory tiers becomes standard for long-context serving.
Whether new attention designs shrink the cache enough to change long-context pricing.
Whether prefix caching across users becomes a standard platform feature rather than an application-level optimisation.
Questions people ask about this
Why do long prompts cost more even before any output?
Two reasons. Processing the prompt is real arithmetic proportional to its length, and every token of it then occupies cache memory for the entire request, reducing how many other requests can be served concurrently. The second effect is often the larger one.
Can the cache be moved off the accelerator?
Yes, and systems increasingly do for inactive conversations — pushing the cache to host memory or flash and pulling it back when the user returns. It is cheaper than recomputing and far cheaper than keeping accelerator memory reserved for an idle session, but the transfer itself takes time.
Each page explains one technology in plain language, states what it depends on, and names companies by what they supply at that step. Company roles are described qualitatively and deliberately carry no market shares, revenue figures or rankings — those change faster than an explainer can, and a stale number is worse than none. Ticker links point at company pages on this site and are provided for reference only.
Nothing here is investment advice, a recommendation, or a forecast. A company named on a page about a technology is not thereby a good investment, and the chokepoints described are structural facts about supply chains rather than predictions about prices. Technology moves; where a page describes something as unresolved or in development, that was true when it was written.