Token Playground
See how large language models tokenize text, assign next-token probabilities, and change sampling behavior with temperature.
LLMs generate text by repeatedly estimating probabilities for the next token, selecting one, appending it to the context, and repeating the process.
Choose decoding settings for structured output
Would you use the same temperature for creative copy and strict JSON? Explain the trade-off before opening the next lab.
How does next-token prediction work?
A large language model generates text by estimating a probability distribution over possible next tokens, selecting a token using a decoding strategy, adding the selected token to the current context, and repeating the process.
What is a token?
A token is a text unit used by the model. It can be a whole word, part of a word, punctuation, whitespace, or another fragment depending on the tokenizer.
What does temperature change?
Temperature changes the shape of the sampling distribution. Lower values concentrate probability around top candidates; higher values give lower-ranked candidates more chance to appear.
Why does this matter in engineering?
Decoding choices affect variability, deterministic behavior, structured-output reliability, and how an application balances creativity with control.
Common questions
No. Autoregressive language models generate incrementally, token by token.
No. Token boundaries depend on the tokenizer and can split words or include punctuation.
No. It changes sampling behavior, not the model weights or underlying knowledge.
No. This MVP uses deterministic educational values so the learning experience stays stable.