Draw the timing boundary
Optional arithmetic and percentage refresher — return to this activity
A narrow benchmark can omit work users still experience. Validation, imports, preparation, rendering, serialization and storage may surround generation. A fair report states what the timer includes, what it omits and whether both alternatives produced equivalent outputs.
Instrumented generator: local teaching model contract
All people, records and numbers in this pack are authored teaching examples. They are not records or performance claims about real organizations.
- G1 · The downloadable Python generator uses four token IDs and fixed authored two-number embeddings with causal attention. It is untrained and is not a pretrained language model. It demonstrates execution and cache equivalence, not text quality.
- G2 · Input is 1–16 token IDs; output limit is 0–16 tokens. EOS is token 3. Greedy selection chooses the lowest ID on a tie. Reaching a limit and emitting EOS are reported separately.
- G3 · The clock starts after imports. Validation/token preparation, prefill, first-token selection, decode steps and total generation are timed with a monotonic high-resolution clock. Report serialization and disk writing are outside total generation. Loading/import/terminal display are not measured.
- G4 · Cached attention retains projected keys and values for exactly the prior token prefix. Changed prefixes require a fresh cache or rejection. Every step’s scores, not just chosen IDs, must agree with uncached execution within 1e-12.
- G5 · Timing varies by machine and run. Compare the same prompt, output limit and stopping behavior, repeat runs, report all outcomes and the measurement boundary. Projection and attention-term counts are not milliseconds.
Which interval are you measuring?
- Prepare: 0–2 ms.
- Prefill: 2–9 ms.
- First selection: 9–10 ms. The first token is available at 10 ms.
- Three later tokens: 10–16 ms. Generation ends at 16 ms.
Four tokens total: one first token and three later tokens. Convert 6 milliseconds to 0.006 seconds; 3 ÷ 0.006 = 500 later tokens/second. This hypothetical timeline omits overhead. Real reports include orchestration in total time; imports and writing the report remain outside that interval.
To summarize repeated durations, sort them. For hypothetical times [2, 2, 3, 5, 8] ms, the median is the middle value, 3 ms; the observed range runs from 2 to 8 ms. Keep all five reports, including the slow one. This is a descriptive summary, not a guarantee of future response times.
Worked example
G3 starts after imports and stops before serialization. Its total includes validation and generation orchestration; summing prefill and decode alone is not the whole elapsed interval. Cached and uncached paths still perform attention comparisons for each new query.
Check the boundary
The benchmark measures a bounded local execution path. It does not measure model loading, a network service or rendering. Keep those omissions visible even when a cache reduces projection counts.