The short answer
This question was asked by my colleague, MAJ Taylor Wulff-Morrison, USMC. It is a great question because, in short, no, they are not all just predictive number generators — but some actually are. I'm going to walk through the nuances below so that you can put your finger on the exact step where chance enters one of these things, switch it off in your head, and say which kinds of AI have no die in them anywhere. A chat model, an image model and a speech model each end in a number generator. What the phrase hides is everything that had to be built to load it.
There are three steps in the box: the layers compute a score for every candidate word, softmax turns those scores into shares, and a sampler picks one. Chance enters only at the last step. Nothing below needs math past arithmetic, and every term is introduced before it is used.
Tokens in, numbers out: the box is deterministic
Start with what happens when you press send. Your text is chopped into tokens, each token is looked up as a list of numbers called its embedding, and those numbers pass through a long stack of multiplications and additions. Between those linear layers sit nonlinear operations, and they are the reason a deep stack can do more than a single multiplication could. Out the far end comes one score for every entry in the model's vocabulary: a number saying how well each candidate fits as the next token.
Probability is computed at softmax; chance enters at the sampler. The rest of the chapter hangs on that sentence. Everything up to and including softmax is a deterministic function. Feed the same tokens in twice and the same scores, and the same shares, come out twice, to the last digit. No dice-rolling inside the layers, no noise generator, no coin.
The bends still matter. Without them a stack of linear layers collapses into a single linear layer, and the whole deep network could do no more than one multiplication can. That is why they are in there, and it is a question of its own: why are the nonlinear operations the magic? People get one thing backward here. Those curves let the network bend, and they are deterministic while they do it. They are not the source of the randomness.
Shares become one pick: the die and the CDF
Three shares, and the model needs one word. This is the step people mean by "number generator," and almost nobody gets shown it.
Lay the three shares end to end along a strip running from 0 to 1. Mat gets 0 to 0.705. Floor starts where mat stopped and runs to $0.705 + 0.259 = 0.964$. Dragon takes the last sliver, 0.964 to 1.000. Those cut points, 0.705, 0.964 and 1.000, are the cumulative distribution, usually shortened to CDF. It is a running total, and it is what makes the strip possible: each candidate owns a piece of the line as wide as its share.
Then the machine asks its computer for a uniform draw, written $u$: a value between 0 and 1 with every part of the range equally likely. Whichever stretch $u$ lands in wins. Said as a rule: walk the running totals from the left and take the first candidate whose total is bigger than $u$. The running total is what makes this work. It turns three widths into three cut points that a single number can be compared against.
Three rolls on the same strip
$u = 0.31$. That is below 0.705, so it is still inside mat's stretch. The answer is mat.
$u = 0.80$. Past 0.705, not yet 0.964, so it is inside floor's stretch. The answer is floor.
$u = 0.97$. Past 0.964. The answer is dragon. The cat sat on the dragon.
In words: because $u$ is equally likely to land anywhere on the line, each candidate wins as often as its share is wide. Mat wins about seven times in ten. Dragon wins about once in twenty-nine, which is rare and is not never. The third roll above is there to show the tail is real.
Probability is computed at softmax; chance enters at the sampler, and that one uniform draw is the only random number in the reply. One draw per token, and everything else is fixed arithmetic. A thousand tokens is a thousand rolls, about seven hundred words of English, each roll on a die whose faces were computed fresh for it.
The off switch: temperature, and T = 0
Before softmax divides, the scores pass one dial: temperature, written $T$. Divide every score by $T$, then run softmax as before. Small $T$ stretches the gaps and sharpens the result; large $T$ shrinks them and flattens it.
$$p_i = \frac{e^{z_i / T}}{\sum_j e^{z_j / T}}$$In words: divide candidate $i$'s score by the temperature, raise $e$ to that, and divide by the same quantity summed over every candidate. The symbol $\sum_j$ is just "add this up over all the candidates," and $z$ is the score we called a logit.
| Temperature $T$ | mat | floor | dragon | Spread |
|---|---|---|---|---|
| 0.5 (cold) | 0.879 | 0.119 | 0.002 | 0.55 bits |
| 1 (as scored) | 0.705 | 0.259 | 0.035 | 1.03 bits |
| 2 (warm) | 0.547 | 0.331 | 0.122 | 1.37 bits |
| heading to 0 | 1 | 0 | 0 | 0 bits |
| heading to infinity | ⅓ | ⅓ | ⅓ | 1.58 bits |
Read the bottom row again, because it answers the question in the title. As $T$ heads to zero, softmax collapses onto the single highest score, the argmax. The die becomes a strip with one stretch in it, from 0 to 1, belonging to mat. Wherever the draw lands, mat wins, and the sampler has turned into a lookup. Same input, same output, every time. So "is it random?" is a setting you choose. The weights never changed; the die was trimmed to one face.
That is the off switch. The rest is management. The product sets $T$ for you: chat assistants run warm, code completion and extraction run cold. It also trims the tail before rolling, keeping only the few highest candidates (top-k) or the shortest leading group whose shares reach a set total such as 0.9 (top-p). Training loads the die, the serving software trims it, and only then is it rolled. For the desk version of these settings see How the model decides, and for a slower treatment of chance itself, Chance and Choice.
See it move
Why keep the randomness at all?
If it can be switched off, why is it on? Because of what the die looks like, which depends entirely on the context.
Those two numbers under the charts are entropy, in bits. One bit is one fair coin's worth of not-knowing. Near zero means nearly certain; bigger means undecided. The next chapter is about that number; here it is a label for what your eye already sees.
The randomness lives where the language is free. Where there is one right answer, training has loaded the die so heavily that the roll barely matters: Paris wins ninety-eight times in a hundred. Nobody set that per question; it fell out of the training text saying Paris over and over.
Three reasons to leave the die rolling. First, most of language has many right continuations, and a machine insisting on one would be lying about it. Second, a model pinned at $T = 0$ degenerates. It finds a phrasing it likes, and because that phrasing is now in the context, the pattern-copying machinery inside makes it the top-scoring continuation again:
The plan is to improve readiness. The plan is to improve readiness.
The plan is to improve readiness. The plan is to improve readiness.
Every one of those words was the most likely token given everything before it, which is the problem. A little warmth breaks the cycle on the first roll. Third, a warm die is why asking for three drafts gives you three drafts instead of the same paragraph three times. The reason to turn it down is the opposite one: facts, code, extraction, anything where "different each time" is a defect.
"Number generator" says nothing about what was built
"Predicts the next token" describes the exam the model was graded on and the shape of its output. It says nothing about what the network had to build to pass that exam.
Two examples. To predict the closing bracket in a page of code, something in there is keeping count of how many are open. To predict "she" rather than "he" three sentences after a name, something is tracking who is being talked about. Neither is a lookup. Both are structure that prediction pressure forced into existence, because there was no other way to score well.
This has been opened up and measured. Researchers at Anthropic described induction heads: small circuits that spot a repeat of something earlier in the context and copy what came after it. That is a large part of how a model learns a pattern from your prompt on the fly (Olsson et al., In-context Learning and Induction Heads, Transformer Circuits Thread, 2022). A team led from Harvard trained a model on nothing but lists of Othello moves, with no board, no rules and no pictures. They then read a picture of the board out of the model's internal numbers, and edited that picture to change the moves it proposed (Li et al., Emergent World Representations, ICLR 2023).
One analogy, then I will stop. You could describe a sonar operator as "someone who classifies waveforms." That is the whole job description, and it tells you nothing about what they had to learn to do it.
The phrase hides a second thing. These models are not archives of numbers to be queried. The weights encode how language connects, words to phrases to sentences to ideas, and facts fall out of that compression as a side effect, produced by the same sampling step as everything else. Recall is generation. Nothing is looked up.
The other AIs
Back to the first word of the question: all. Plenty of working AI has no learned distribution in it anywhere, and some has its chance somewhere else entirely.
| Kind | What it computes | Where the chance is | You have met it |
|---|---|---|---|
| Search and planning | A best path or schedule under hard constraints | None | Route planners, delivery scheduling |
| Solvers and provers | An assignment that satisfies every stated rule | None, unless random restarts are used | Crew rostering, chip verification |
| Rule-based expert systems | Conclusions from written-down rules | None | Tax software, triage checklists |
| Trained classifiers | One label, or a probability plus a cutoff | Training only; answering is fixed | Spam filters, credit scoring |
| Reinforcement learning with search | A move, chosen by a tree search a network guides | Exploration during self-play; the played move is the most-visited one | Chess and Go engines |
| Evolutionary methods | A good design found by mutate-and-select | In the search, not in reading out the answer | Antenna and wing shape optimization |
| Diffusion image models | The noise to subtract, as a list of numbers | In the sampler, which can be made repeatable | Image generators |
| Bayesian methods | A distribution, on purpose, as the answer | Probability is the representation, not a defect | Forecast cones, sensor fusion |
The same chat model appears twice, once in each column, separated only by a setting.
Where the description bites
The phrase is unfair about what was built, and right about one thing: a next-token predictor has no built-in notion of truth, only of plausibility under its training text. Fluent and false score the same at the draw.
That is the root of hallucination, of telling you what you wanted to hear (sycophancy), and of the confident fabricated citation. It is a big enough subject for its own chapter: Why It Makes Things Up, with the desk version in Trust and limits.
What you now know
- Everything from your tokens to the raw scores is fixed arithmetic: same input, same scores, every time.
- Probability is computed at softmax, which is arithmetic with a temperature dial and no chance in it; chance enters at the sampler, and nowhere else.
- The sampler stacks the shares along a strip from 0 to 1 using their running totals and takes whichever stretch one uniform draw lands in. That is one draw per token, and it is the only random number in the reply.
- Setting the temperature to zero collapses the die onto the highest-scoring candidate, which makes the whole system deterministic. Whether it is random is a setting you choose.
- The randomness is managed: training loads the die nearly certain wherever the language has one right continuation, and the product trims the tail before rolling.
- "Predicts the next token" names the objective and the output, and says nothing about the mechanism. The model is a language processor rather than an archive, and recall comes out of the same draw as everything else.
- Most AI is not this at all: planners, solvers, rule systems and trained classifiers answer with no chance in them anywhere.
Where we're headed
If you can say that in your own words, you can answer the question at the top: it is a die, loaded by training and trimmed by the product, and the interesting object is whatever loaded it. One word slipped past. I put "0.16 bits" and "2.23 bits" under two pictures, called it spread, and moved on. That word, entropy, is borrowed from thermodynamics, and so is "temperature," and so is "diffusion." Three borrowed words in one field is either sloppy marketing or one idea showing up three times. The next question is which. They are the same equations, borrowed three times.