LLM Explained

Welcome & The Big Picture 0.1

What happens when you press Enter

The full trip of a prompt: text → tokens → model → one token at a time → your screen.

Video coming soon. The full transcript is below.

The loop

You type a question, and press Enter. A split second later, words start appearing, right here. But where does that very first word actually come from?

Most people imagine something like a search engine. Your question goes off to a giant store of answers, the right one is found, and it's sent back to you.

But there is no store of answers inside. Nothing gets looked up. What actually happens is stranger, and in a way, much simpler.

It writes the answer one small piece at a time.

For the very first piece, it gives a score to every option it could write next.

Then it picks one. Adds it to the end. And does the whole thing again, for the next piece.

Score, pick, add. Score, pick, add. Over and over, until the answer is done.

If that sounds familiar, it's because your phone's keyboard does a tiny version of this. It looks at your last few words and offers three suggestions.

A chatbot scores every possible next piece, more than a hundred thousand of them, and it looks at the whole conversation so far.

One more thing. The pick isn't always the top score. It's more like rolling weighted dice. Likely pieces come up most often, but not every time.

That's why asking the same question twice can give you two different answers.

Pieces and numbers

So what are these pieces? They're not quite words. Common words are usually one piece each.

Longer or rarer words get split. Unbreakable becomes three pieces. And hippopotamus splits in places that don't mean anything at all.

These pieces are called tokens.

Computers only work with numbers. So every token gets an ID number, like a locker number.

There are a hundred thousand or more of them. And the number itself means nothing. It's just a label.

So the model never sees your letters. It sees this.

Where the knowledge comes from

Here's the surprise. A model like this is basically two files. A small program, and one gigantic file of numbers.

Billions of them. Think of each number as a dial.

Take the cat sat on the. The model scores every possible next piece, as before.

Turn a few dials, and the scores change. Everything the model does lives in where these dials are set.

Nobody chose these settings by hand. They started out completely random. And a random model writes nonsense.

Training fixes that. It shows the model real text, with the next word hidden, and the model makes a guess.

Then the answer is revealed. After each big batch of guesses, every dial gets nudged a tiny bit, toward making the right words more likely.

Repeat that across trillions of words, with millions of rounds of nudges, and the gibberish slowly turns into language.

How much text is that? If you read it day and night, without ever stopping, it would take you more than eighty thousand years.

To guess the next word well across all of that, the dials have to soak up grammar, facts, even patterns of reasoning.

Not as copies of pages. More like a vague memory.

And when the memory isn't there, the loop still writes something that sounds right.

That's why chatbots sometimes make things up.

Finally, a second, smaller round of training. The model practises on example conversations, and people rate its answers, so it learns which replies people prefer.

That's what turns a text predictor into a helpful assistant.

Putting it together

So let's go back to that first moment. You press Enter.

Your words are split into tokens. The tokens become numbers.

Billions of dials turn those numbers into a score for every possible next piece.

One piece is picked, added to the end, and the whole thing runs again.

Piece by piece, that's where your answer comes from.

Next time: AI, machine learning, deep learning, and large language models.

Four terms everyone mixes up, and how they actually fit together.

Sources and fact-check What was checked, what was corrected, and where it comes from.

Checked 2026-11-30. Tokenizer results were run with tiktoken.

Verified tokenizer facts

  • "What is the capital of France?"

    • cl100k_base (GPT-4): [3923, 374, 279, 6864, 315, 9822, 30], split as What | is | the | capital | of | France | ?. These are real GPT-4 IDs.
    • o200k_base (GPT-4o): [4827, 382, 290, 9029, 328, 10128, 30], with the same split.
  • "unbelievable"

    • With a leading space (mid-sentence), it is one token in both tokenizers. Without the space it splits as un|belie|vable (cl100k) or un|bel|ievable (o200k).
    • Don't use it as the example.
  • " unbreakable" splits as un | break | able in both cl100k and o200k. Use this one.

  • " hippopotamus" splits as hipp | opot | amus. This is good evidence that pieces aren't always meaningful word parts.

  • Vocabulary sizes:

    Model Vocabulary
    GPT-2 50,257
    GPT-4 (cl100k) 100,277
    Llama 3 128,256
    GPT-4o (o200k) 200,019
    Gemma about 256k

    Say "a hundred thousand or more".

Claim verdicts and fixes

Claim in script Verdict Fix
A chatbot does "the very same thing" as a phone keyboard Overstated: a keyboard model is about 1.4M params with a 10k-word vocab (arxiv.org/abs/1811.03604) "Same basic idea, just vastly bigger. It reads the whole conversation, not just your last few words."
Common words = 1 piece; rare words split Accurate (help.openai.com/en/articles/4936856) Optionally add "pieces don't always match real word parts".
unbelievable → un/believ/able Wrong Use unbreakable → un · break · able.
Hallway of about 100,000 lockers Right for GPT-4, low for newer models Say "a hundred thousand or more". On screen: "100,000+".
Billions of knobs, each just a number Accurate (GPT-3 175B; Llama 3 up to 405B) Fine.
"Every time it guessed wrong, all the knobs got nudged" Simplified and partly misleading. Updates are batched (Llama 3 used batches of 4M to 16M tokens, arxiv.org/pdf/2407.21783), and the model is also nudged when it's right but unsure. "After each big batch of guesses, the knobs got nudged a tiny bit, toward making the right words more likely."
"After trillions of these tiny nudges" Wrong order of magnitude. More than 15T tokens at about 16M per batch is only about 1M steps. "After reading trillions of words, and millions of rounds of nudges…". Any on-screen counter must count words read.
Practiced on example conversations Fair (SFT), but leaves out RLHF (arxiv.org/abs/2203.02155) Add: "…and people rated its answers, so it learned which replies people prefer."
Doesn't look the answer up True of the model; ChatGPT has had web search since Oct 2024 Add a caveat: even with search, results are just added to the text, and it still writes one guess at a time.
Scores every possible next token Accurate (logits → softmax) Fine.
Picks one of the top choices Simplified. In reality it samples by probability, and temperature controls how much. "Usually a top choice, like a weighted dice roll. That's why the same question can get different answers."
Paris high, "The" lower Plausible, but chat models often start "The capital of France is…" "Paris gets a high score. So does The…"
Stops at a special "I'm done" token Accurate but incomplete (it can also hit a length limit or the user presses stop) "…or hits a length limit". This is optional for beginners.
Streams word by word because you watch it guess live Accurate Optionally "piece by piece".