Skip to content
HomeBriefFor youTrackersTopicsCompaniesGlossaryNewsletterSecurityHealth & medicineFinance & marketsRoboticsModels & researchPolicy & regulationEnterprise & businessDeveloper tools
Glossary

KV cache

The stored keys and values a transformer computes for every token in the context, kept in GPU memory so the model does not reprocess the whole prompt at each step.

When a model generates a token it attends to all previous tokens. Recomputing their representations every step would be quadratic, so serving systems keep the key and value tensors from each layer in memory: the KV cache. Its size grows with context length and is the main reason long-context inference is memory-bound. Prompt caching is the billing side of the same idea, and sparse-attention models shrink the problem by attending to a selected subset of cached positions, which is what DFly2's drafter borrows.

← All terms

Get the brief in your inbox

One email every morning: the stories that mattered in AI, each with a one-line "why it matters" for your role. Free, no ads, unsubscribe any time.

Published daily by AI Briefing. We never share your address.
Like this? Get tomorrow's brief by email, free.