Put a Clock on Prefill and Decode
Elapsed time is a measured duration. Prefill processes the input; the first selection produces a token; decode processes newly appended tokens. Time to first token includes preparation, prefill and first selection here. Later-token rate uses only subsequent tokens and their measured decode duration.
Authored explanation · fixed examples, not a live experiment.
Request starts after imports
→Prepare → prefill → first selection: first-token boundary
→Later decode → finish: separate duration and rate
Which clock answers the user’s waiting question? Name the evidence for your answer.
By the end of this lesson
Measure phase boundaries and distinguish first-token delay from generation rate.
Inside the lesson
- Locate the timing boundaries
- Separate first token and finish
- Measure repeated runs
- Explain unavailable rates
- Check a streaming deadline
- Keep timing definitions
The reproducibility tasks require running the supplied Python starter. Setup instructions and examples are included.