Step 1 of 6· Keep useful earlier work
Keep useful earlier work
A key/value cache stores earlier calculations so a language model can reuse them. Keys help match a new token to relevant earlier tokens; values carry the information retrieved from those matches.
- 1
Compute a prefix
→ - 2
Retain its keys and values
→ - 3
Append a token
→ - 4
Reuse only compatible state
A projection transforms a token’s numbers into a new set of numbers. The small decoder counts three projections for each position in each layer. Recomputing every prefix repeats this work; caching reuses the earlier keys and values.