AI dictionary · LLMs and GenAI

What is KV cache?KV cache kya hai?

Also called: Key value cache

KV cache: Memory that stores past attention keys and values so an LLM doesn't recompute them for every new token.Memory jo purane attention keys aur values rakhti hai taaki LLM har naye token pe unhe dobara na nikaale.

🧸 Think of it likeAise samjho

Like keeping notes while reading a long story, so for each new page you don't have to reread the whole book.Lambi kahaani padhte waqt notes banaane jaisa, taaki har naye page ke liye poori kitaab dobara na padhni pade.

📘 ExplainedVistaar se

Generating text one token at a time would otherwise redo work for all earlier tokens at each step. The KV cache makes generation much faster but uses GPU memory that grows with context length and batch size, which inference engines manage with techniques like paged attention.Ek ek token generate karne mein warna har step pe pichhle saare tokens ka kaam dobara hota. KV cache generation kaafi tez karta hai par GPU memory leta hai jo context length aur batch size ke saath badhti hai, jise inference engines paged attention jaise tarikon se sambhaalte hain.

💡 Real exampleAsli example

Long chats use more GPU memory per user because the KV cache grows.Lambi chats mein har user ki zyaada GPU memory lagti hai kyunki KV cache badhta hai.

📖 Learn it step by stepStep by step seekho

🔗 Related termsJude hue shabd

Questions people ask

What is KV cache?

Memory that stores past attention keys and values so an LLM doesn't recompute them for every new token. Generating text one token at a time would otherwise redo work for all earlier tokens at each step. The KV cache makes generation much faster but uses GPU memory that grows with context length and batch size, which inference engines manage with techniques like paged attention.

How can I understand KV cache in simple words?

Like keeping notes while reading a long story, so for each new page you don't have to reread the whole book.

What is an example of KV cache?

Long chats use more GPU memory per user because the KV cache grows.

KV cache ka matlab kya hai?

Memory jo purane attention keys aur values rakhti hai taaki LLM har naye token pe unhe dobara na nikaale. Lambi kahaani padhte waqt notes banaane jaisa, taaki har naye page ke liye poori kitaab dobara na padhni pade.

See KV cache in the full A to Z dictionary · Start a free AI course