You already know: the transformer block, attention and next-token prediction (D5 Transformer architecture); writing and sampling from your own small GPT (D5 Build an LLM from scratch); latency vs throughput and tail latency (D1 Networking, D11 Model deployment); and the D11 bridge's result that single-stream decoding keeps the GPU's arithmetic units idle more than 99% of the time.
Why this matters for Atlas. Every LLM product's speed, cost and capacity come from one fact: a response is produced in two very different phases. Prefill processes the whole prompt at once and is limited by arithmetic. Decode generates one token at a time and is limited by memory bandwidth. Almost every inference optimization in this domain (KV caching, batching, quantization, speculative decoding, disaggregation) targets one phase or the mismatch between them. This lesson builds both phases in NumPy, measures them with the roofline model, defines the latency metrics you'll use for the rest of the domain, and covers sampling.
1. Two phases: read the prompt, then write the answer
The question. Why does a long prompt make Atlas slow to start, while a busy server makes it slow to type?
Start from nothing. Generation is a loop. To produce token t+1, the model needs the attention keys and values of every earlier token.