Prefill
The first phase of inference: in one pass the model processes the whole input prompt and computes the states for all of its tokens. After that the decoding phase begins — generating one token at a time.
Why It Matters
Prefill processes hundreds and thousands of tokens at once, thus hitting computational limits. The generation phase, on the other hand, generates tokens one by one and hits memory bandwidth limits.
Relation to Metrics
- Time to First Token is mainly determined by the duration of prefill;
- the longer the prompt, the longer the prefill.