LLM Next-Word Playground

Every ChatGPT-style model does one thing: predict the next word, over and over. Train a tiny predictor on any text right here, watch the probability bars, roll the dice yourself, and finally see what "temperature" means.

100% in your browser. Your text never leaves your device.

1 · Training text

2 · The dials

How many previous words the model looks at. More context means more coherent output, but it needs more training text to have seen those combinations.
Low: always pick the safest word. High: give unlikely words a real chance. Watch the bars reshape as you drag this.

3 · Generate

Or build the sentence yourself: click any probability bar on the right to choose that word.

The model writes…

Pick a sample text or paste your own, type a prompt, then click a bar or press Auto-write.
Blue words are your prompt. The highlighted word is the model's latest pick.

What comes next? The model's honest odds

Next-word prediction

About the LLM Next-Word Playground

Underneath all the magic, a large language model does exactly one job: given the words so far, estimate the probability of every possible next word, then pick one. Repeat that a few hundred times and you get an essay. This playground puts that loop in your hands with a model small enough to see through: it learns word patterns from whatever text you give it, and it shows you its honest odds for every next word before it commits.

Things worth trying

Why models make things up

Notice that the bars never contain "I don't know." The model must always produce a next word, and its odds come from patterns in training text, not from checking facts. When the pattern is strong but the fact is wrong, the model states the wrong thing with total fluency. That is hallucination, and having watched this little model confidently write nonsense, you now understand the mechanism: fluent continuation is what these systems do, and truth is not part of the loop unless something else adds it.

How this toy relates to the real thing

This model counts word patterns directly, so it can only continue sequences it has literally seen; a real LLM learns deeper statistical structure with billions of parameters, so it can generalize to word combinations that never appeared in training. But the generation loop (context in, probability distribution out, sample, repeat), the temperature dial, and the always-must-answer property are identical. The difference is scale and depth, not kind. For the training side of the story, see the Gradient Descent Visualizer, and for how models get scored, the ML Performance Metrics explorer.

Common questions

How does ChatGPT actually work?

At its core, it predicts the next word (token) from everything so far, then does it again, billions of parameters deep. This playground strips that to its essence: train a miniature predictor on any text and watch the live probability bars choose each next word.

What does the temperature setting do in AI models?

Temperature reshapes the probability distribution before sampling: low temperature concentrates on the likeliest word (careful, repetitive), high temperature flattens the odds (creative, chaotic). Drag the slider here and watch the same distribution sharpen and melt.

Why do AI models hallucinate?

Because prediction is not understanding: the model confidently emits plausible next words with no notion of what any of them mean or whether they are true. Watching this tiny model auto-write fluent nonsense makes the failure mode intuitive.

What is a context window?

How many previous words the model looks at when predicting. Slide this model's context from 1 to 3 words and watch predictions sharpen; production LLMs do the same trick across thousands of tokens.

Can I train it on my own text?

Yes, that is the fun part: paste anything (your writing, a speech, song lyrics) and the model learns those patterns in seconds, then writes in a statistical parody of that voice.

Related tools