Skip to content
Artwork for Linear Digressions
Linear Digressions · Monday · 24 min

KV Cache Fundamentals

The unsung hero of every LLM conversation you've ever had? A clever optimization called the KV cache. Self-attention is computationally brutal — every token attending to every other token means costs that scale as N², and that blowup gets worse with every turn of a conversation. The KV cache is what keeps that from becoming completely intractable at scale. Today's episode goes deep on how it works, why inference is a harder and more interesting problem than it gets credit for, and what's really happening under the hood when you chat with an LLM.

0:00-24:16

transcript

No transcript — this publisher did not publish one.

show notes

The unsung hero of every LLM conversation you've ever had? A clever optimization called the KV cache. Self-attention is computationally brutal — every token attending to every other token means costs that scale as N², and that blowup gets worse with every turn of a conversation. The KV cache is what keeps that from becoming completely intractable at scale. Today's episode goes deep on how it works, why inference is a harder and more interesting problem than it gets credit for, and what's really happening under the hood when you chat with an LLM.

more episodes

All episodes