What happens between a prompt and the next token: embeddings, transformer layers,
attention, the KV cache, logits and sampling. Every part uses Qwen2.5-0.5B as the reference model,
so the shapes and counts stay consistent: 24 layers, d_model 896 and a vocabulary of 151,936.
One token from input to output: tokenization, embeddings, twenty-four transformer layers, the LM head, temperature and sampling. CPU work is blue, GPU work is green, and two 3-D benches show the tensor moving through the pipeline.
Type a sentence and watch it stand up into a tensor: one row per token, through the ids, the embedding lookup and all 24 layers, until only the last row is left.
Parts 3–5 are drafted and under technical review.