AI Tech News HubDaily Updates
AI TechnologyNovember 13, 2026

Guess the Next Word, Billions of Times — This One Thing Is the Core of LLMs

A
AI 觀察家
Columnist · 3011 words
Guess the Next Word, Billions of Times — This One Thing Is the Core of LLMs

Key Takeaways

  • The core mechanism behind LLM text generation is singular: predicting the next most probable token based on the probability distribution of everything that came before
  • The act of "guessing the next word" isn't the hard part — the hard part is training a model capable of learning "what word naturally follows what" across trillions of tokens of data
  • Parameters like temperature and top-p are, at their core, tools for reshaping the "contour" of this probability distribution — determining whether the model responds conservatively or creatively

One Thing Underpins the Entire AI Revolution

Have you ever considered that ChatGPT, Claude, Gemini — at the most fundamental level, these models only ever do one thing: guess the next word?

Not plan out entire passages in advance. Not "think it through before speaking." Just this — given all the text seen so far, calculate the most probable next token, output it, and repeat.

Sounds almost trivial, doesn't it? Yet the entire LLM revolution — including the AI assistants you use daily, coding tools like Copilot, and even AI frameworks running various agentic tasks — is built on exactly this operation.

What "Predicting the Next Word" Actually Means

In plain terms, it works like this: the model looks at "The weather today is really" and calculates the probability that the next word is "nice," the probability it's "hot," the probability it's "terrible"... It maintains a probability distribution across the entire vocabulary, then samples one word from that distribution.

Think of it as an extraordinarily precise game of word association. Except the "player" in this game has, during training, processed a volume of text roughly hundreds of thousands of times greater than everything you'll read in your entire lifetime.

Technically, that "word" doesn't map perfectly to a single Chinese character or English word — it's a token, which might be a character, a partial word, or even a punctuation mark. GPT-4's vocabulary contains roughly 100,000 tokens, and each generation step is a probability computation across all 100,000 candidates.

Why This Costs Hundreds of Millions of Dollars

If the core task is just "guessing words," why does training a top-tier LLM cost so much?

The answer is that "what word follows what word" encodes the entirety of human knowledge structures. For a model to produce coherent physics content after "Based on the principles of quantum entanglement, we can infer...", it must compress physics knowledge, linguistic structure, and contextual logic — all of it — into tens of billions of parameters during training.

That's why larger models trained on more data produce better predictions — not because they are "smarter," but because they have encountered more word-to-word relationships and have more accurate probability estimates.

The arms race from GPUs to custom silicon across every major player ultimately comes down to making this "guessing" operation faster and cheaper.

Breaking It Down: The Complete Generation Pipeline

1. Tokenization Input text is first segmented into a sequence of tokens. A phrase like "large language model" may be split into three or four tokens — not one per word as you might expect.

2. Embedding Each token is converted into a high-dimensional vector that captures its semantic position. Words with similar meanings end up with vectors close to one another in this space.

3. Attention Computation in Transformer Layers This is the core. Through the self-attention mechanism, each token "attends to" every preceding token, dynamically computing relevance weights between them.

4. Output Probability Distribution (logits → softmax) The final layer outputs raw scores (logits) for each token, which are then converted by softmax into probabilities between 0 and 1, summing to exactly 1.

5. Sampling The next token is selected according to this probability distribution. Several tunable parameters govern this step:

  • Temperature: Turning it up "flattens" the probability distribution — the model becomes more willing to select lower-probability tokens, producing more creative and less predictable responses. Turning it down pushes the model to consistently pick the highest-probability option, yielding conservative outputs.
  • Top-p (nucleus sampling): Sampling is restricted to only the top candidates whose cumulative probability exceeds a given threshold, preventing the selection of wildly improbable tokens.

Common Misconceptions: What LLMs Are Not Doing

Misconception 1: The model "understands" your question and then retrieves an answer Not quite. There's no search operation happening (unless a retrieval tool has been explicitly integrated). The model simply computes the highest-probability token sequence based on patterns seen during training. When it appears to "look something up," it's because that answer appeared frequently enough in training data to establish a strong probability signal.

Misconception 2: The model "thinks through" the entire response before outputting it No. Generation is strictly token-by-token. Each time a token is emitted, it gets appended to the context, and the next token is predicted from there. The text appearing character by character in ChatGPT isn't a visual flourish — it's the actual generation process unfolding in real time.

Misconception 3: Hallucination is a bug that will eventually be fixed Hallucination is a structural consequence of this mechanism. The model outputs the "highest-probability token sequence," not "factually verified statements." When training data is insufficient or a question falls outside the distribution, the model still selects whatever word "seems linguistically plausible" — and the result is confidently stated misinformation. This is not a bug; it is a fundamental constraint of this architecture. Current mainstream approaches — RAG (retrieval-augmented generation) and reinforcement learning from human feedback — can mitigate it, but none can eliminate it entirely.

How to Think About "Guessing Words" Going Forward

Once you internalize this underlying logic, many things suddenly click into place.

Why does a well-crafted prompt produce dramatically better responses? Because the preceding context determines the probability distribution. The clearer the context, the more the model's next-token predictions trend toward what you actually want.

Why does asking the same question twice produce slightly different answers? Because sampling introduces randomness — when temperature is nonzero, lower-probability candidates still have a chance of being selected.

Why do models have a knowledge cutoff date? Because their "word-guessing ability" derives entirely from training data. For anything absent from that data, there's no corresponding probability pattern to draw on.

What AI can and cannot do — and how to categorize the various associated risks — can largely be reasoned through from this foundational architecture. The next time you encounter an article claiming LLMs "truly understand" language, or dismissing them as "mere statistics," you'll know exactly how to dissect the argument.

Frequently Asked Questions

Does an LLM output an entire passage at once, or generate word by word?

Token by token. Each time a token is generated, the model appends it to the existing context and predicts the next one from scratch. The text appearing incrementally in ChatGPT is not a visual effect — it is the literal generation process as it happens.

What's the practical difference between a higher and lower temperature setting?

Temperature controls how concentrated or spread out the probability distribution is. Set it low (approaching 0) and the model almost exclusively selects the highest-probability token, producing conservative and consistent outputs. Set it high (e.g., 1.5) and the distribution flattens out, giving lower-probability options a real chance of being selected — more varied, but also less stable. In practice, higher temperatures suit creative writing; lower temperatures suit data summarization.

Why do LLMs hallucinate — confidently stating things that simply aren't true?

Because the model outputs "the highest-probability token sequence," not "a factually verified statement." When a question falls outside the coverage of its training data, it still selects whatever next token looks linguistically plausible — and the result is a confident, coherent-sounding falsehood. This is a structural limitation of the prediction architecture, not a simple bug to be patched.

Does the quality of a prompt really affect model output that significantly?

Yes — profoundly so. The prompt you provide directly determines the initial probability distribution the model operates from when predicting the next token. The clearer and more contextually precise your input, the more the resulting token sequence trends toward what you're after. This is precisely why prompt engineering is a genuine technical discipline.

Are tokens and "words" the same thing?

Not exactly. A token is the smallest unit the model actually operates on — it might be a single character, half a word, or a punctuation mark, depending on the tokenizer's design. GPT-4's vocabulary contains approximately 100,000 tokens. The same sentence will typically produce a different token count in English versus Chinese, which also affects how context window limits are calculated in practice.

Share

Related articles