Module
Before the First Token
A model first processes the supplied prompt, a step called prefill. It then produces tokens one at a time in decode steps. A cache keeps intermediate calculations so later steps can reuse them.
- 1
Input instructions and source text
→ - 2
Prefill calculates prompt state; cache retains keys and values
→ - 3
Decode extends the context; first-token and total time differ
What you’ll learn
How prompt processing, token generation and cached calculations contribute to the time an answer takes.