Little Inference

Why does this work?

A diagram, not a running LLM

A decoder-only language model, shown as a spatial teaching diagram. No model is downloaded or trained. Token boundaries, numbers and candidate probabilities are illustrative, not the output of a real tokenizer or language model.

Prefill handles the prompt and predicts the first new token. Later decode steps process the newest token using cached keys and values. Weights stay fixed. Cache reuse saves repeated work, not all work, and costs memory.

Attention internals, batching, GPUs, quantization and speculative decoding are outside this small model. Timing is for teaching, not a benchmark.

Teaching sources