KV-Caching: Why Autoregressive Action-Token Decoding Doesn't Recompute Everything

Part four of the transformer study notes: why causal masking guarantees a token's key/value is final once computed, what a KV cache actually saves versus what stays quadratic, its GPU memory cost, and how it differs from π0's key/value reuse across flow-matching denoising steps.

In this article

  • Naive autoregressive decoding recomputes everything
  • What causal masking guarantees never changes
  • The cache itself
  • What's actually being saved
  • The trade: GPU memory for compute
  • Not just for token position: π0's denoising reuse
  • Mistakes I made learning this
  • Glossary