Jeff Chunn

Token Slot Machine

Pull the lever to draw one token. Every token you add changes the odds for the next one.

One token at a time

Every pull adds one token

These two hold.This one draws.
Ready to draw 0 tokens added

Drag the handle down or click it. You can also choose a token from the odds.

Your sentence

Yellow tokens came from a draw or your choice.

This toy uses weighted word choices. Each word is one token. The odds use the whole sentence so far.

The next choice depends on what came before.

A language model builds text through repeated next-token choices. Each chosen token becomes part of the context for the next choice. A likely continuation is not a guarantee of a true statement.

See what is inside this machine

This toy uses preset weights for the word groups below. They form 2,364 possible sentences. Each group contains compatible choices with relative weights. The model combines those weights, finds sentences that match every word so far, and adds their weights for each possible next word. Dividing by the total matching weight gives the odds.

Real LLMs use learned neural networks and much richer context. Their tokens can be parts of words, punctuation, or other text units. This small model demonstrates repeated next-token choices. Its completed sentences follow the patterns below. It does not reproduce a Transformer.

The dot ends a sentence. A 24-token safety limit keeps the experiment short. Undo lets you explore another branch.

The weighted word groups

Each row shows a sentence pattern. The numbers beside words are their relative weights within that group. At the first draw, the model adds verb weights across matching rows. Higher weights give a choice more probability. After "quiet," the fox is more likely to find a garden. After "hidden," a path is more likely. Some connecting words still have one allowed continuation.