the.ai

Inference / Serving

verified

Prefill and Decode

Serving a language model is two different jobs wearing one name. Reading the prompt processes every token at once and saturates the accelerator's arithmetic. Generating the reply produces one token at a time and spends nearly all of it waiting on memory. The same hardware is compute-bound in the first phase and memory-bound in the second.

Viz primitive · budget-splitprompt = 128

prompt holds 50% of the budget; rest holds the remaining 50%.

Share of a request's compute spent reading the prompt against writing the reply. Drag the prompt length to watch prefill take over.

128

Reviewed by opendroid · 2026-08-04

  • arXiv:2308.16369 — SARATHI: Efficient LLM Inference by Piggybacking Decodes with Chunked Prefills