Skip to content
AI Gate
🔮

Next-token prediction

Generation, sampling, temperature, and why models hallucinate.

14 min 100 XP🎓 Scholars
Step 1 of 9

At its core, an LLM does one thing: given the tokens so far, it outputs a probability for every token in its vocabulary to come next. To write a whole answer, it picks a token, appends it, and repeats. This is called autoregressive generation.