Why does a KV cache make text generation faster, and what does it cost?
EasyConcept10 minSWERERSMLE
The question
In a short screening call: explain what a KV cache is in a decoder-only transformer, why it speeds up generation, and what it costs you.
Give a rough estimate of the cache size for one long request on a mid-sized model.
What the interviewer is looking for
- Explains that past keys and values do not change, so they can be reused
- States that decoding then only computes attention for the new token
- Knows the cache grows linearly with sequence length, layers and heads
- Can do a rough memory estimate with the right formula
- Mentions a mitigation such as grouped-query attention, paging or quantised caches
Your answer
Saved in this browser only. Nobody else sees it.
Why this question
Reported in: x.ai, aced.io, designgurus.io
Practice question written by BlogLLM based on publicly reported interview formats. Not an official xAI question.