# KV cache

Canonical page: https://www.theglitch.ai/ai-glossary/kv-cache

Memory a model keeps of the tokens it has already processed, so it does not recompute them for every new token.

[KV cache, common card \#120 in The Glitch AI glossary: Memory a model keeps of the tokens it has already processed, so it does not recompute them for every new token.](https://www.theglitch.ai/images/cards/glossary/kv-cache.png?v=f5a70205b0c34858)

GLS 120 · common

Also called: Key-value cache.

For: Builders

## Why it matters

It makes generation fast, and it is the main memory cost of long conversations.

## In practice

Each new word in a reply reuses the cached work for everything written so far.

## Watch for

Long contexts mean big caches; that is part of why long-context calls cost more.

## Related terms

[Prompt caching](https://www.theglitch.ai/ai-glossary/prompt-caching) · [Long context](https://www.theglitch.ai/ai-glossary/long-context) · [Inference](https://www.theglitch.ai/ai-glossary/inference)

## Sources

- [Hugging Face: KV cache strategies](https://huggingface.co/docs/transformers/main/en/kv_cache)

Definition updated 2026-10-29.

[The Ultimate AI Glossary (2027): every term](https://www.theglitch.ai/ai-glossary)

---

Site: [The Glitch](https://www.theglitch.ai) · [About Rabin](https://www.theglitch.ai/about) · [Agent guide](https://www.theglitch.ai/agent.md)
