Chapter 2 of 23 · Level 1 · Foundations: How LLMs WorkHow Models Generate TextLogits to probabilities, temperature and sampling, the prefill/decode phases, and why models hallucinate.2.1A Language Model Is a Probability MachineHow a language model works comes down to one fact: it predicts the next token. Tokens, embeddings, attention, context, and every sampling knob you touch all live inside that single trick.8 min read→