Welcome back to the AI Essentials series! In our last lesson, we discovered that tools like ChatGPT and Claude are, at their core, next-word prediction engines โ built on the Transformer architecture and trained at such a staggering scale that prediction started to look like creativity.
We also left two questions hanging โ the ones that keep beginners up at night: if it’s all prediction, is the AI actually thinking, or just rolling very sophisticated dice? And why does it sometimes state complete nonsense with total confidence?
Today, we answer both. We are going to open the hood and watch an answer being built in slow motion, one token at a time. By the end of this lesson, you will understand three things almost nobody using AI can actually explain: what a token is, how a probability engine chooses every single word, and the three-stage training pipeline that turned a text-completion savant into a helpful assistant.
Still no math degree required. Grab your safety goggles.
1. Meet the Token: AI Doesn’t Read Words โ It Reads LEGO Bricks
Here is the first surprise: an LLM never sees words, and it never sees letters. It sees tokens โ chunks of text that sit somewhere between a letter and a word.
๐ก The LEGO Analogy: A LEGO set doesn’t contain a “castle piece” or a “spaceship piece.” It contains a finite set of standard bricks that can build anything. Tokens work the same way. Instead of storing every word in every language (impossible), the model uses a fixed vocabulary of roughly 50,000โ100,000 reusable text chunks that can assemble any sentence ever written โ including typos, slang, and words invented yesterday.
In practice, common words like “the,” “cat,” and “house” are usually one token each, while rare or long words get snapped apart into several bricks (something like “electroencephalography” becomes a small pile of them). A useful rule of thumb: 1,000 tokens โ 750 English words.
- Source: Sennrich, R., Haddow, B., & Birch, A. (2016). Neural Machine Translation of Rare Words with Subword Units. Association for Computational Linguistics (ACL).
- Why it matters: This paper popularized byte-pair encoding (BPE), the compression trick used to build modern token vocabularies โ the reason today’s models can handle any text without an “unknown word” meltdown.
Once you know about tokens, several everyday mysteries solve themselves:
- Why AI pricing is “per token”: you are literally paying per LEGO brick.
- What a “context window” is: the maximum number of bricks the model can hold in mind at once.
- Why models famously stumbled on “How many R’s are in strawberry?”: the model sees chunks, not individual letters โ one big reason letter-counting is unexpectedly hard for a machine that writes essays.
2. The Probability Engine: Watching One Word Get Chosen in Slow Motion
Now for the main event. Type this prompt: “The capital of France is” โ and here is what actually happens inside:
- Your text is converted into tokens.
- The neural network (the Transformer from Step 3) processes them and produces a score for every single token in its vocabulary.
- Those scores become a giant probability list: ” Paris” โ 96.1%, ” the” โ 1.2%, ” a” โ 0.6%, ” located” โ 0.5% โฆ all the way down to ” banana” โ 0.0000โฆ%.
- The model picks one token, appends it to the text, and then runs the entire loop again for the next token.
A 300-word answer is roughly 400 spins of this loop. And here is the part that rewires how you see chatbots: nothing is looked up. There is no database of answers, no saved essay being retrieved. The probabilities are computed fresh, every time, from patterns compressed into the model’s parameters during training.
This idea is much older than ChatGPT. In 1951, Claude Shannon โ the father of information theory โ ran a famous experiment where he had people guess the next letter of English text, one letter at a time, and measured how predictable language really is. His conclusion: human language has deep statistical structure, and that structure can be exploited by machines.
- Source: Shannon, C. E. (1951). Prediction and Entropy of Printed English. Bell System Technical Journal.
- Why it matters: Seventy years before ChatGPT, science had already established that “predicting language” is a measurable, mathematical craft โ not magic.
๐ The Dice Roll: Temperature, and Why the Same Question Gets Different Answers
You might assume the model should simply pick the #1 most probable token every time. Researchers tried that โ and got a surprise. Always taking the top choice (called greedy decoding) makes text spiral into dull repetition loops (“I’m happy to help. I’m happy to help. I’m happy toโฆ”), while picking tokens completely at random produces fluent-sounding gibberish. The sweet spot turned out to be weighted dice:
-
Temperature controls how adventurous the dice are. Low temperature โ the model almost always takes the top token (great for facts, code, extraction). High temperature โ underdog tokens get a real chance (great for brainstorming and stories).
-
Top-p (“nucleus”) sampling trims the table first: only tokens that together cover, say, the top 90% of probability stay in the game โ the long tail of nonsense is cut off before the dice roll.
-
Source: Holtzman, A., et al. (2020). The Curious Case of Neural Text Degeneration. International Conference on Learning Representations (ICLR).
-
Why it matters: This paper showed why controlled randomness produces the most human-like text โ and it explains a daily experience millions of users misread as a glitch: ask the same question twice, get two different (both sensible) answers. Not a bug. A design choice.
3. From Autocomplete Savant to Assistant: The Three-Stage Training Pipeline
In Step 3, we promised to dissect how a raw prediction engine becomes a polite assistant. Here is the twist: a freshly trained model is not a chatbot. Ask a raw, pretrained model “How do I bake sourdough?” and it might reply “How do I keep my starter active? How long should I proof the dough?” โ because on internet forums, questions are usually followed by more questions. It is completing text, not helping you.
Turning that savant into an assistant takes a three-stage pipeline. Think of training a chef:
- Pretraining (reading every cookbook on Earth): The model learns next-token prediction across a vast slice of the internet. Result: encyclopedic pattern knowledge โ and zero table manners.
- Instruction tuning (culinary school): The model is shown many thousands of examples of instruction โ ideal response, and learns the format of being helpful: answer the question, follow the requested style, stop when done.
- Human feedback training / RLHF (customer feedback cards): The model writes several candidate answers; human reviewers rank them; a “reward model” learns those preferences; the chatbot is then tuned to produce the kind of answers humans consistently rated higher.
- Source: Ouyang, L., et al. (2022). Training Language Models to Follow Instructions with Human Feedback. Advances in Neural Information Processing Systems (NeurIPS).
- Why it matters: This is the famous InstructGPT paper โ and it delivered a stunning result: human judges preferred a 1.3-billion-parameter model trained with feedback over the raw 175-billion-parameter GPT-3. In other words, how you train can beat how big you build. Alignment with human preferences turned out to be its own superpower.
4. Soโฆ Does It Actually Think? (The Honest Answer)
Time to face the question in this lesson’s title. The honest answer has three parts.
What the model is not doing: it is not searching a database of answers; it is not pasting a memorized essay (each reply is generated fresh, token by token); and it does not “know” whether it is right or wrong the way you do.
What the model is doing: computing, from scratch each time, the most plausible continuation of your text โ using patterns distilled from a huge share of human writing. As we saw in Step 3, predicting that well forced it to internalize grammar, facts, styles, and even the reasoning traces hidden inside human text. That is far more than “gluing words together.”
The mindset that matters: think of it as a smart prediction machine โ smarter than the word “autocomplete” suggests, but nothing like an all-knowing oracle. And here is the single sentence that sets up the rest of this series: the model is optimized for fluency; truth usually comes along for the ride โ but fluency is guaranteed, and truth is not. The gap between those two has a name โ hallucination โ and Step 7 is dedicated entirely to it.
๐ 5. Reader Q&A: Three People, Three Very Different Questions
(Real questions our readers keep sending in โ answered without the jargon.)
Q1 โ from a stay-at-home parent building a blogging side hustle: “I asked the exact same question twice and got two different answers. Is it broken? And which answer am I supposed to trust?”
Answer: Nothing is broken โ you just caught the dice roll from Section 2 in the act. By design, the model adds a controlled dash of randomness so its writing doesn’t sound like a broken record. For your creative work, this is free money: ask for a blog intro three times, and you get three genuinely different drafts to choose from โ regenerate, compare, keep the best. For facts, treat two differing answers as a yellow warning light: ask the model to list its checkable claims, then verify names, numbers, and dates yourself before anything goes on your blog. The rule of thumb: variety in style is a feature; variety in facts is an alarm.
Q2 โ from an AI-major university student: “In the API playground I keep seeing
temperatureandtop_p. What do they actually do to the probability distribution?”
Answer: After the network produces its scores over the whole vocabulary, temperature rescales the distribution before the sample is drawn: low values sharpen it so nearly all probability piles onto the top tokens (approaching greedy decoding as it nears zero), while high values flatten it so tail tokens get real odds. Top-p truncates instead of reshaping: sort tokens by probability, keep the smallest set whose probabilities sum to p (say, 0.9), renormalize, and sample only within that nucleus. Holtzman et al. (2020) is the paper to read on why this beats both extremes โ greedy/beam search collapses into repetition loops, naive sampling drifts into incoherence, and nucleus sampling lands closest to human-like text. Practical defaults: run low temperature for extraction, code, and factual Q&A; around 0.7โ1.0 for creative work. One caveat for your lab notebook: even at temperature 0, tiny numerical effects mean outputs are nearly identical across runs โ not cryptographically cloned.
Q3 โ from a solo startup founder who does everything alone: “I’m a one-person company. I don’t have time to fact-check every sentence. Where do I absolutely HAVE to verify?”
Answer: Verify wherever an error carries a price tag. Red zone (always check): anything with names, numbers, dates, prices, legal or medical claims, statistics, and citations โ plus anything that leaves the building: published posts, client emails, contracts, investor decks. Recent events belong here too, since models have training cutoffs. Green zone (light touch): brainstorming, outlines, rewording, tone changes, and summaries of documents you pasted in โ skim, but relax. The 30-second protocol that fits a founder’s calendar: ask “list the factual claims in your answer that I should verify, with sources,” then spot-check the two most consequential ones. Treat the model like a brilliant unpaid intern: endless ideas and tireless drafts, but you sign everything that leaves the building.
๐ 6. Myth vs. Reality: Quick Reference Table
| Common belief | What actually happens |
|---|---|
| “It searches a database of answers.” | It computes fresh token probabilities every single time โ nothing is looked up. |
| “It reads my words and letters.” | It reads tokens (word pieces); 1,000 tokens โ 750 words. |
| “The same question should give the same answer.” | Sampling (temperature) adds deliberate, controlled randomness. |
| “It sounds confident, so it must be correct.” | Fluency is guaranteed by design; accuracy is not. |
| “A bigger model always means better answers.” | Human-feedback training let a 1.3B model beat a 175B model in preference tests. |
โก 7. Try It Today: Watch the Machine Think (Three 2-Minute Experiments)
Theory becomes intuition the moment you see it move. Run these three quick experiments:
- See the bricks: Search for a free “LLM tokenizer” playground online, paste in your full name and the longest word you know, and watch the text snap into colored token chunks. (Notice how rare words shatter into pieces.)
- Catch the dice: Open two fresh chats and ask the identical creative question in both โ “Write a two-line poem about Mondays.” Compare. Then ask a factual question twice: the phrasing varies, but the core fact should hold still. You have just observed temperature.
- Grade the intern: Ask about a niche topic you know deeply โ your hometown, your hobby, your industry โ and score the answer like a teacher. You will feel, not just read, the gap between fluent and accurate.
๐ 8. Recap & What’s Next?
Today you looked inside the machine, and five ideas came out with you:
- Tokens are the LEGO bricks of language โ models read chunks, not words or letters.
- The loop: score every token in the vocabulary โ pick one โ append โ repeat, hundreds of times per answer.
- The dice: temperature and top-p are why identical questions produce different answers โ by design.
- The pipeline: pretraining โ instruction tuning โ human feedback; a small, well-aligned model can beat a giant raw one.
- The mindset: a smart prediction machine โ fluency guaranteed, truth not. That gap is where Step 7 lives.
So now you know how the engine works. But that raises the practical question every reader eventually asks: which car should you actually drive? ChatGPT, Claude, and Gemini are built on the same science, yet they behave very differently at the wheel. In the next lesson, we put the big three head-to-head โ task by task, strength by strength โ so you stop paying for the wrong subscription.
โฎ๏ธ Previous Lesson: [Step 3] Understanding Generative AI and Large Language Models (LLMs) Explained
โญ๏ธ Next Lesson: [Step 5] ChatGPT vs. Claude vs. Gemini: Which AI Should You Use? (coming soon)

