Lesson 1 · Unit 01
Tokens and time
Prefill, decode and the two numbers users feel
What you practise
- Reading the prompt (prefill) against writing the answer (decode), time to first token and tokens per second, why output tokens cost more than input tokens
Try a question from this lesson
Pick one
You send a 6,000-token document and ask for a summary. Nothing appears for 1.5 seconds, then words stream out steadily. What was the model doing in the silence?
Correct answer
Reading the 6,000 prompt tokens in one pass
Why
The prompt must be processed before any token can be predicted. That first pass over the whole prompt is called prefill. The steady stream after it is decode: one new token per pass. Two phases, two very different speeds.
The idea
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
Prefill and decode
A request has two phases.
Prefill reads every prompt token in a single pass and yields the first output token. Its wait is the time to first token.
Decode then runs one pass per new token. Its speed is the tokens per second you watch streaming by.
prefill all prompt tokens, 1 pass
decode 1 new token per pass10 more exercises in the app
- 3× type the answer
- 3× multiple choice
- 1× true or false
- 1× fill the blanks
- 1× match the pairs
- 1× order the lines
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.