How does an AI actually produce that answer?
No prior AI or coding knowledge needed. Three steps, each with something to try: tokenize — split your text into pieces the model can handle — embed — place each piece in a "meaning space" — and predict — repeatedly rank what's likely to come next and pick one. The tokenize and embed steps below use simplified, hand-built examples. The predict step uses real word-transition statistics, counted from public-domain text — not invented — though still a simple model, nowhere near a real LLM's scale. None of this calls any real AI model.
Splitting text into pieces
Type a sentence below. This simple demo splits on whole words — real tokenizers usually split into smaller sub-word pieces instead, which is what trips people up first, so a few real-feeling examples are below it.
Placing each piece in a "meaning space"
Every token becomes a point in space — and words with related meaning end up near each other. Real embeddings use hundreds or thousands of dimensions; this is a simplified 2D version of the same idea, using a small hand-placed set of words. Type a word from the sentence box above that appears here, and watch it light up.
Build a sentence the way a model does
Pick a starting word, then keep choosing from the ranked candidates — that's the entire loop, repeated until you end the sentence. Prefer more freedom? Type your own next word instead of clicking one — the game will look up real continuation odds for it if it's in the demo vocabulary. The percentages here are real — counted from word-to-word transitions across roughly a million words of public-domain 19th-century novels, not picked by a person. It's still a simple frequency model, not a neural network, so watch for one authentic quirk: greedily picking the top choice every time can loop (e.g. "I am sure I am sure…") — that's a real, well-documented limitation of simple frequency-based prediction, and part of why real language models need more than "always pick the most likely word."
The real gap between this and an actual model, now that the percentages are genuine: this demo counts simple word-pairs (bigrams) across ~1 million tokens and a ~2,200-word vocabulary. A real model like Claude is a deep neural network trained on vastly more text, considers your entire conversation as context (not just the previous word), and chooses across tens of thousands of possible tokens every step — with far more sophisticated understanding of meaning than a frequency count can capture. The shape of the process (score everything, sample one, repeat) is genuinely similar. The scale and sophistication are not remotely close.