Generating text token by token would be slow if the model reprocessed the whole conversation every time. The KV cache keeps intermediate results instead, trading memory for speed.

For long contexts the cache can take more GPU memory than the model weights, which is why serving systems manage it carefully, for example with paged memory.