AlgoViz

KV cache and prefix caching

medium 40 min

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.