Ask most people what happens inside ChatGPT, Claude, Gemini or Copilot when they type a question, and you get one of two answers. Either “it looks the answer up somewhere“, or “it thinks about it, a bit like a person“.

Both are wrong.

And because they are wrong, people trust these tools in exactly the situations where they should not, and underuse them in the situations where they shine.

Whenever I run AI training for teams, I spend the first twenty minutes on one idea, because everything else follows from it. A large language model (an LLM, the engine behind every generative text AI) does exactly one thing: it predicts the next small piece of text. It is a very, very good version of the text autocomplete feature on your phone. No database of facts. No plan for the whole answer. Just: given everything written so far, what word most likely comes next?

That sounds too simple to produce anything useful. It isn’t, and this article shows you why, step by step, with animations you can play with. By the end you will understand why these tools hallucinate, why they cannot count the letters in a word, why every answer comes out slightly different, and why a long chat quietly gets slower, more expensive and less reliable the longer it runs.

Step 1: it read a huge amount of text and turned words into numbers

An LLM starts life by reading. Not just a few books. A large slice of the public internet, plus books, articles, forums and code. Trillions of words. It is not memorising facts while it does this (that is the first myth). It is learning statistical relationships: which words tend to appear near which other words, in what order, in what kind of context.

Computers cannot calculate with words, so each word (or fragment of a word, more on that in a moment) is converted into a long list of numbers called a vector. Think of the vector as a set of mathematical coordinates. While we humans live in a 3 dimensional world, mathematical models use hundreds or thousands of dimensions, but the principle survives the simplification. Words that are used in similar ways end up close together in these multidimensional spaces. And, more remarkably, the directions between words carry meaning.

The classic demonstration: take the coordinates for “king”, subtract “man”, add “woman”, and the point you land on is almost exactly “queen”. The model was never told that a queen is a female king. It worked out that “the direction from male to female” is a consistent arrow in its number space, because that relationship is baked into how humans use those words.

Interactive animation (requires JavaScript).

Multiply that by hundreds of dimensions and millions of words, and you have a map in which “invoice” sits near “payment” and “due date”, “scaffolding” sits near “construction site” and “assembly”, and the arrow from “Germany” to “Berlin” is the same arrow as from “France” to “Paris”. This map is the model’s entire “knowledge”. It is not a list of facts. It is mathematical geometry.

Step 2: it doesn’t see words. It sees tokens

Here is a detail that explains a surprising number of odd AI behaviours. The model does not work with words or letters. It works with tokens: chunks of text, typically between one character and one whole word long. Common words are usually a single token. Rare or long words get chopped into pieces. Punctuation and spaces are tokens too. As a rule of thumb, 1,000 tokens is roughly 750 English words, and a bit fewer in German, because German compounds get split more often.

Interactive animation (requires JavaScript).

Why does this matter to you? Because the model never sees the individual letters inside a token. When you ask “how many r’s are in strawberry?”, the model is looking at something like straw + berry, two opaque chunks, and guessing. That is why a tool that can draft a contract clause in seconds can fail at a task a six-year-old manages. It is also why very long words, unusual names and product codes are handled less reliably: they get sliced into fragments the model has seen less often.

Tokens are also the unit everything is billed and limited in. Your “context window” (how much the model can consider at once) is a token count. API prices are per token. Keep that in mind for step 5.

Step 3: it only ever predicts the very next token

Now the core mechanism. Given the text so far, the model calculates a probability for every token in its vocabulary (roughly 100,000 to 200,000 of them) as a candidate for the next position. Then it picks one based on which is statistically likely to fit with what came before it. That’s it. There is no step where it plans the paragraph, checks a fact or decides what it “wants” to say. It picks the next token, then it starts again.

Try it. Finish this sentence in your head before the animation shows the answer:

Interactive animation (requires JavaScript).

Two things to notice. First, the winner is obvious to you and to the model, and for the same reason: in the trillions of words it read, “vanilla ice” was followed by “cream” far more often than by “cubes” or “breaker”, so consistently that almost nothing else gets a look in. Neither you nor the model needed to “understand” ice cream to get it right. Pattern based on what the model previously read was enough.

Second, look at what happens when you roll the dice. The model does not always take the top candidate. It samples from the probabilities, with a controllable amount of randomness (often called “temperature”). Most of the time it lands on the likely word. Occasionally it lands on “cubes”. This is deliberate: it is what makes the output feel natural rather than robotic, and it is why you get a different answer every time you ask the same question. It is also the seed of every AI hallucination: a low-probability but perfectly fluent continuation, delivered in the same confident tone as a correct one, because the model has no way of knowing the difference. Confidence in the tone tells you nothing about the truth of the content.

Step 4: one token at a time, round and round, with the whole text going through again

So the model produced one token. Now what? It appends that token to the text and runs the entire sequence through itself again to predict the next one. Then again. And again, until it predicts a special “stop” token. Every single token of your answer costs a full pass over everything that came before it, prompt included.

Interactive animation (requires JavaScript).

This is why answers appear on your screen word by word: you are literally watching the loop run. It is why a long answer takes longer than a short one, and why the model can “lose the thread” in a very long response, since each new token depends only on the statistics of what is already there. And it is why the whole thing has no plan. When it wrote the first word of a paragraph, it had not decided how the paragraph would end. The ending emerged, one probable token at a time.

Step 5: every message in a chat resends the entire conversation

The last piece is the one almost nobody outside the industry knows, and it has real consequences for cost and quality. The model has no memory. None. When you send your third message in a chat, the application quietly bundles up the system instructions, your first message, the first reply, your second message, the second reply and your third message, and sends all of it to the model as one long prompt. The model reads the whole conversation from the top and predicts the next token. Every time.

Interactive animation (requires JavaScript).

Watch the bars. Each request is bigger than the last, because it contains everything before it. The total amount of text the model has to churn through over the life of a chat snowballs, and so does the cost, whether you pay per token through an API or whether your provider absorbs it inside a subscription (until they hit the limits and slow you down). It also explains three things people experience but rarely connect:

  • Long chats get worse. Once the conversation approaches the model’s context window, the oldest parts get cut off or compressed. The model is no longer reading your original instructions. It is not “forgetting” in a human sense; the text has simply left the prompt.
  • Long chats get slower. More tokens to read on every turn means more computation before the first word of the reply appears.
  • System prompts are not free. The rules you (or your IT team) put in a custom GPT, a Copilot agent or a Claude project are re-sent with every single message. That is by design, and it is why they work, but it is worth knowing when you paste a 40-page policy into one.

What this means for how you use it at work

Once you have the mechanism, most of the “best practices” stop being rules to memorise and become common sense. Six that matter most:

  1. Confident is not the same as correct. The model produces plausible continuations, not verified facts. Anything you would be embarrassed to get wrong (a figure, a legal deadline, a quote, a name) needs a source. Our guide to AI hallucinations covers where this bites hardest in business.
  2. Give it the context you would give a new colleague. The prediction is only as good as the text it is conditioned on. Role, material, desired output, constraints. This is the whole of prompt engineering in one sentence.
  3. Do not ask it to count, spell backwards or do arithmetic in its head. Tokens, remember. Ask it to write and run a small program instead, or use a tool that does.
  4. Start a new chat when you start a new task. You get a smaller, cheaper, cleaner prompt and you stop dragging an unrelated conversation through the model on every turn.
  5. Put your standing instructions somewhere they get re-sent automatically. A system prompt, a project, a custom assistant. That is what those features are for.
  6. Same principle, every vendor. ChatGPT, Claude, Gemini, Copilot, Mistral, DeepSeek: different training data, different sizes, different fine-tuning, identical mechanism. If you understand this article, you understand all of them. Our model comparison covers what actually differs.

None of this makes the technology less impressive. If anything, it is more impressive that “predict the next token” gets you drafting, summarising, translating and structuring at the level it does. But it does make it less magical, and that is the point. People who think it is magic either trust it blindly or refuse to touch it. People who know it is a superb autocomplete use it for what it is good at, check what needs checking, and get on with their work.


This is the explanation I open every team session with, because staff who understand the mechanism make better decisions with the tools than staff who have only been shown which buttons to press. It also happens to be the foundation of the AI literacy the EU AI Act now requires of every company whose employees use these tools. If you want your team to have it, our AI Productivity Fundamentals workshop is built around exactly this, and our AI basics guide for non-technical people is the free place to start.