Prefill and decode
Two requests hit your server. One sends a 20,000-token document and asks for a one-line summary. The other sends one line and asks for a 2,000-word story. At typical prices, where output costs about five times input, they cost about the same in dollars, yet they stress completely different parts of the GPU, and tuning for one can hurt the other.
In this lesson you'll learn to
- Describe the two phases of inference, prefill and decode, and what each one does.
- Explain why prefill is compute-bound and decode is memory-bound, and how each shows up in latency.
- Distinguish throughput from goodput, and define goodput against latency targets.
- Explain how servers handle the two phases together, with chunked prefill and disaggregation.
Create a free account to open this lesson
It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.