KV Cache During Generation

Start Timer

0:00:00

Upvote
0
Downvote
Save question
View comments

A chatbot reads a 10,000-token report and starts streaming a summary. The first token of its reply, “Sales,” is already on screen. Your team wants the second token to appear sooner. Its current implementation sends the whole report plus “Sales” through the model again.

How would you use a key-value (KV) cache to make this next prediction, and which parts of the report would the model still need to consult?

Note: A token is a piece of text. Treat “Sales” as one token. Each position can attend to itself and earlier positions. Assume a fixed model that keeps its full history at the original precision.

.
.
.
.
.


Comments

Loading comments