KV cache and prefix caching
medium 40 minWhile a model writes, it saves the key and value vectors of every token it has already seen, so each new token costs one small step instead of a pass over the whole text.
While a model writes, it saves the key and value vectors of every token it has already seen, so each new token costs one small step instead of a pass over the whole text.