Lesson 1 of 10
How an LLM call works
Follow a prompt through tokenization, chat templates, the context window, prefill, decoding and sampling.
In this lesson
- Tokens and prediction
- Context and attention
- Roles and chat templates
- Prefill and decoding
- Selecting a token
- Decode a toy sequence
- A minimal sampling loop
- What stays true
- Where the work goes
- Common mistakes
- 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