---
title: Describe the prefill and decode phases of inference. Which is compute-bound and which is memory-bandwidth-bound, and…
url: https://gurkanozkan.ai/learn/questions/applied-llm-fnd-10/
markdown: https://gurkanozkan.ai/learn/questions/applied-llm-fnd-10.md
kind: question
role: Applied LLM
stage: Technical
difficulty: Medium
json: https://gurkanozkan.ai/api/learn/questions/applied-llm-fnd-10.json
robots: noindex
---

# Describe the prefill and decode phases of inference. Which is compute-bound and which is memory-bandwidth-bound, and how does that show up in time-to-first-token and inter-token latency?

Applied LLM · Technical · Medium

Theme reported publicly: [Mistral AI](https://jobsbyculture.com/blog/mistral-interview-prep-2026), [Speechmatics](https://job-boards.eu.greenhouse.io/speechmatics/jobs/4996455101)

## Answer

*Model answer, written in a candidate's voice*

### In short

- Prefill: whole prompt processed in parallel; large matmuls; compute-bound; dominates TTFT with queueing
- Decode: one token per sequence per step; reads weights and KV cache; low arithmetic intensity; memory-bandwidth-bound; sets inter-token latency
- Single-stream ceiling ≈ bandwidth ÷ bytes read per step; e.g. ~16 GB weights on ~1 TB/s ≈ ~60 tokens/s; batching amortises weight reads
- Long prompts in a shared batch stall decodes; use chunked prefill or disaggregated prefill/decode
- Product: stream output, trim prompts, reuse cached prefixes

### In full

Prefill is the prompt-processing phase: the whole prompt is fed through the model in parallel, so it is dominated by large matmuls and is compute-bound, and it is the main driver of time-to-first-token together with queueing. Decode is the generation phase: each step produces one token per sequence and must read the weights and the KV cache, so arithmetic intensity is low and it is memory-bandwidth-bound, which sets inter-token latency. A rough single-stream ceiling is memory bandwidth divided by bytes read per step — for example, ~16 GB of weights on ~1 TB/s is on the order of ~60 tokens/s — and batching helps by amortising weight reads across many sequences, though it can add per-step work and latency. In a shared batch, long prompts can stall decodes, so systems use chunked prefill or disaggregated prefill/decode to keep decode steps short. Product-wise, that means stream output, trim prompts, and reuse cached prefixes rather than re-prefilling the same context.

*Checked against sources by an independent AI reviewer.*

## What a strong answer covers

- Prefill processes the whole prompt in parallel (large matmuls, compute-bound) and dominates TTFT together with queueing
- Decode produces one token per sequence per step and must read all weights and the cache — low arithmetic intensity, bandwidth-bound — and sets inter-token latency
- Rough single-stream ceiling ≈ memory bandwidth ÷ bytes read per step (e.g. ~16 GB of weights on ~1 TB/s → roughly 60 tokens/s); batching amortises weight reads
- Long prompts stall decodes in a shared batch → chunked prefill or disaggregated prefill/decode
- Product implications: stream output, trim prompts, reuse cached prefixes

## Common mistakes

- Assuming the GPU is fully utilised during single-stream decode
- ignoring queueing time inside TTFT

## Topic guides

- [LLM serving: latency, throughput and operations](https://gurkanozkan.ai/learn/topics/serving.md)
- [Long context and context management](https://gurkanozkan.ai/learn/topics/long-context.md)
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
