Case & CodeA FIELD GUIDE TO AI
Start learning
Intermediate

Prefill

Also: prompt processing, prompt evaluation

In plain words

The model reading your question and documents all at once before it starts answering. Long documents mean a longer wait for the first word.

The fuller definition

Prefill is the first phase of running a model, in which it reads the whole prompt and any documents in one parallel pass. It is limited mainly by computing power and determines the wait before the first word appears.

How it fits together
  1. Prompt

    Documents and question

  2. Parallel read

    Mostly compute-bound

  3. First token

    Answer begins

A simplified relationship, not a screenshot or a complete design.

A concrete example

A 40-page document may take several seconds of prefill before the answer starts streaming.

The distinction that matters

Prefill speed and writing speed are different numbers with different bottlenecks.

Related terms

Where it is taught

How models learn from examples

Source and further reading

Hugging Face · LLM course

The definition and example are written for this library. The link gives background, official documentation or legal authority as labelled. Legal scope depends on the jurisdiction and current text; product features depend on release and settings.

Lessons, terms, practical guides and sources ESC