Checking your account

You can read the lesson while its saved answers and constructions load. Learning controls will open once that work is ready.

The Same Manual Can Be Read Once, Until Its Prefix Changes

The Same Beginning Was Being Calculated Again

BOTIE

An attention layer calculates arrays called keys and values for the tokens it has processed. Later tokens use those arrays when attending to the earlier context. Keeping them avoids recalculating the entire earlier sequence for every generated token. This saved working information is the key/value cache, usually shortened to KV cache. Its memory grows as requests retain more tokens.

The 2023 PagedAttention work addressed how to manage that growing memory without requiring one large continuous allocation for each sequence. It used smaller blocks. vLLM is a language-model serving system; its prefix-caching design also lets compatible requests reuse blocks for an unchanged beginning. A prefix is that beginning, up to the first changed token. Our workshop makes this decision visible with token lists and an explicit compatibility check. The runtime’s full memory manager is outside this example.

Sources for this history