← Questions
Add a KV cache to GPT inference
0
I was asked this
No reports yet. Sign in to say where you were asked it.
You have a small GPT model with plain autoregressive generation that recomputes attention over the whole sequence for every new token. Add a key-value cache so each step only computes the new token's keys, queries and values and reuses the cached ones. Explain what is stored per layer, how the cache grows and is indexed with positions, how much memory it takes, and how much compute it saves.
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing
