AI systems 0/10

Lesson 1 of 10

How an LLM call works

Follow a prompt through tokenization, chat templates, the context window, prefill, decoding and sampling.

1,713 words · 8 min read Ultra Premium

In this lesson

  1. Tokens and prediction
  2. Context and attention
  3. Roles and chat templates
  4. Prefill and decoding
  5. Selecting a token
  6. Decode a toy sequence
  7. A minimal sampling loop
  8. What stays true
  9. Where the work goes
  10. Common mistakes
  11. Related topics and practice

Ultra Premium

Unlock this lesson

Ultra Premium opens the 10 premium lessons in AI systems, along with the rest of WhiteBox's premium lessons and problems.

Not ready yet? Read the free lesson: Backpressure