An LLM predicts the next token again and again, using everything in its context window.
- TokensYour text is split into tokens.
- ContextPrompt and history fill a window of limited size.
- ProbabilitiesThe model scores every possible next token.
- SamplingTemperature decides how adventurous the pick is.
- LoopAppend the token and predict again.
Explain 1/6
Source: Hugging Face: Generation with LLMs