Part I · Turning Language into Space Chapter 01

The Next-Word Game

How a remarkably simple guessing game becomes the engine of modern AI.

7 min read · 3 interactive labs · Zero math required

Here is one of the strangest facts in modern technology. You can ask a Large Language Model to write a bedtime story in the style of a pirate, explain why the sky is blue, translate a poem into Japanese, or spot a subtle bug in a computer program. It feels like there must be a dozen different specialists hiding inside — a poet, a scientist, a translator, a coder.

There aren't. Underneath the surface, the entire machine is playing one absurdly simple game:

The Core Idea

Given a piece of text, guess the very next word. Not a whole paragraph. Not a whole sentence. Just the single most plausible next piece of text — ranked by how likely each candidate feels.

Your own brain plays this game effortlessly every second you read. Look at the unfinished sentence below: "The cat sat on the ___". Before you even consciously think about it, a shortlist of candidates lights up in your mind: mat, couch, floor, windowsill. Meanwhile, words like democracy or purple don't even make the cut.

An LLM does the exact same thing, except it assigns a glowing confidence score to every word in its vocabulary. Let's step into the model's shoes and play the game yourself.

Lab 1.1 Next-Word Probability Bars
Click any bar to grow the sentence
Notice how the bar lengths compare: on a factual prompt like "The capital of Japan is ___", one bar towers above the rest. On a creative prompt like "The cat sat on the ___", the glow spreads across several reasonable choices. Click any candidate bar — or press Sample Next — to watch the next set of probabilities shift in real time.

The Secret Loop: One Word at a Time

Okay, guessing one word is neat. But how does a single-word guesser write an entire essay, or hold a ten-minute conversation?

Through a brilliantly simple trick: it feeds its own guess right back into the prompt.

Suppose you type "The astronaut looked out at". The model predicts "the". Now the prompt is one word longer: "The astronaut looked out at the". The model reads the whole updated line and predicts "glowing". Then it reads that and predicts "blue". Word by word, loop by loop, a complete thought unfolds.

Researchers call this an autoregressive loop — a fancy phrase that simply means "using your own past outputs to predict the next step." Watch the loop in motion below.

Lab 1.2 The Autoregressive Loop
Step 0 / 5
Ready — press Step Forward to predict the first word.
Watch the glowing pulse travel from the Prompt through the Predictor to produce a single new word, then swing back along the feedback arc to become part of the input for the very next cycle. Every ChatGPT or Claude reply you have ever seen was built one trip around this loop at a time.

Wait — Why Would Guessing Create Understanding?

At this point, a healthy skeptic should raise a hand and ask: "Isn't this just glorified phone autocomplete? How could predicting the next word ever require real knowledge, grammar, or logic?"

This is the central "aha!" moment of modern AI. Try to imagine playing the next-word game on every book, article, textbook, and story ever written — and trying to get really, extraordinarily good at it.

At first, simple shortcuts work: after peanut butter and, guess jelly. But shortcuts hit a wall fast. To consistently guess the right next word in tricky sentences, the predictor is forced to build internal models of grammar, geography, physics, and even what characters in a story believe.

Test this yourself in the three mini-puzzles below. Try picking the right word, then illuminate the hidden clues that make the guess possible.

Lab 1.3 Why Guessing Forces Understanding
Switch puzzle types below
Each blank looks like a tiny fill-in-the-blank question — yet getting the top bar right requires tracking singular vs. plural across distractions, knowing seasons in the Northern Hemisphere, or following an object as a character moves it from one container to another. Prediction is compression of understanding.
Where We're Going Next

We now have the 30,000-foot view: an LLM is a next-word guessing machine running in a loop. In the next chapter, we zoom in on the very first step of that pipeline — because computers can't actually read English words directly. Before a model can guess anything, it has to slice your text into puzzle pieces.

Check Your Intuition

Suppose an AI writes a 200-word explanation of how volcanoes work. How did it actually generate that paragraph?