Ask it the easiest question you can think of
Type "What is the capital of France?" into ChatGPT and it answers "Paris" before you have finished blinking.
It feels like a lookup. Somewhere, you assume, there is a giant table with "France" in one column and "Paris" in the other.
There isn't. There is no table, no database of facts, and no search happening unless the app deliberately runs one. ChatGPT produced "Paris" the same way it produces a poem, an apology email, or a wrong answer: by working out which small piece of text is most likely to come next, adding it, and doing the whole thing again.
That one idea is the mechanism. The rest of this article follows a single prompt through the machine, step by step, and then shows why this explains both the magic and the mistakes.
Why it is worth ten minutes of your time
If you think of ChatGPT as a search engine, you will trust it in the wrong places. If you think of it as "just autocomplete", you will underuse it. Both mental models lead to bad decisions, whether you are a founder choosing where to put AI in a product or someone deciding whether to believe an answer about a medicine.
A better model takes about ten minutes to build. Here it is.
Figure 1. One trip through these six steps produces a single token. The loop then repeats, usually hundreds of times, until the answer is complete. Simplified: real products wrap instructions, conversation history, and tools around this core.
Step 1: Your words are cut into tokens
The model cannot read letters or words. Before anything else happens, a small program called a tokeniser chops your text into tokens: chunks that are sometimes a whole word, sometimes part of a word, sometimes just a punctuation mark. Each token is then swapped for an ID number.
OpenAI's own rule of thumb is that, in English, one token is roughly four characters, or about three quarters of a word. It is an estimate, and it changes with the language.
Figure 2. Real output from o200k_base, the tokeniser OpenAI published for its GPT-4o generation of models. Newer models may split text differently. Source: generated with the open-source tokeniser, see Sources.
Two details in that picture matter more than they look.
First, the space belongs to the token. " strawberry" with a space in front is one token. "strawberry" without it is three: st, raw, berry. The model is handed ID numbers, not letters, which is one reason language models have a long history of fumbling questions like "how many r's are in strawberry?" Nobody gave it the letters to count.
Second, tokens are not equally generous to every language. With the same tokeniser, "Hello" is one token while "नमस्ते" is four. More tokens means more computation, and more cost, for the same meaning.
Step 2: Each token becomes a list of numbers
An ID like 14065 means nothing by itself. So each ID is used to fetch a long list of numbers, called an embedding. Think of it as coordinates.
A map uses two numbers to place a city. An embedding uses hundreds or thousands of numbers to place a token in a space of meaning, where tokens used in similar ways end up near each other. "King" sits closer to "queen" than to "carburettor".
Here is where the map analogy stops being accurate: nobody chose what those directions mean. They were learned from data, and most of them do not correspond to anything as tidy as "north" or "royalty".
The model also records each token's position, because "dog bites man" and "man bites dog" contain the same tokens and mean different things.
Step 3: The transformer lets every token look at the others
Now the numbers pass through the part that gives GPT its last letter: the transformer, an architecture introduced by Google researchers in a 2017 paper with the confident title "Attention Is All You Need".
The key trick is attention. Take the sentence "The trophy didn't fit in the suitcase because it was too big." What does "it" refer to? You know instantly that it is the trophy. Attention is the mechanism that lets the token "it" pull in information from "trophy" and "suitcase" and "big", weighing each by how relevant it is.
Every token does this with every earlier token, at the same time. Then the result is processed, and the whole thing repeats in the next layer, and the next. Modern models stack many such layers. Early layers tend to sort out grammar and local detail; later ones handle more abstract relationships. By the top of the stack, the numbers for the final token no longer just mean "is". They mean something closer to "the thing that comes after the capital of France is".
Step 4: The model scores every possible next token
That final list of numbers is converted into a score for every token in the vocabulary, which for this tokeniser is roughly 200,000 options. The scores are turned into probabilities that add up to 100%.
Figure 3. The shape of a prediction. Values are illustrative, not measured from any model. For a well-known fact the probability piles up on one token. For "Write me a story that begins with" it would be spread across thousands.
Notice what the model has produced. Not an answer. A ranked list of what could come next.
Step 5: One token is picked, and the loop starts again
The app now chooses a token from that list. It usually does not simply take the top one every time. It samples: likely tokens are chosen often, less likely ones occasionally. A setting called temperature controls how adventurous this is.
This is why asking the same question twice can give you two differently worded answers. It is not indecision. Dice are involved by design, because always choosing the single most likely token tends to produce flat, repetitive text.
The chosen token is glued onto the end of the text, and the entire process runs again with the slightly longer text as input. Token by token, until the model predicts a special "stop" token. That is also why the answer appears to type itself out: you are watching the loop run.
Where the "knowledge" comes from
If there is no database, how did " Paris" get such a high score?
Through training, which happened long before you typed anything. Roughly, in two stages:
- Pre-training. The model is shown an enormous amount of text with the next token hidden, and asked to guess it. Each wrong guess nudges its internal numbers, called parameters, slightly. Repeat this billions of times. GPT-3, described in a 2020 paper, already had 175 billion parameters. To get good at guessing the next token of everything, a model has to absorb grammar, facts, styles, and patterns of reasoning. Knowledge is not stored as sentences. It is smeared across those parameters.
- Fine-tuning for conversation. A raw model continues text; it does not helpfully answer. When OpenAI launched ChatGPT in November 2022, it said the model had been trained further using human feedback, with people rating and ranking responses, so that it behaves like an assistant.
After training, the parameters are frozen. The model does not learn from your conversation as it happens.
The chat is an illusion (a useful one)
Here is the part that surprises most people. The model has no memory of your conversation.
Each time you send a message, the app builds one long document: hidden instructions from the company, the entire conversation so far, and your new message. The model reads all of it from scratch and predicts what comes next. The limit on how much it can read at once is called the context window.
Everything else is built on this trick of putting text into the document:
- Memory features save notes about you and insert them into later conversations.
- Web search works because the model writes a request for a search, the app runs it, and the results are pasted into the document for the model to read.
- "Thinking" modes let the model write out working first, which you may not see, and then write the answer with that working in front of it.
The model is the engine. ChatGPT, the product, is the car built around it.
The other side: is it "just autocomplete"?
In mechanism, yes. In what that mechanism has to learn, no.
Your phone's keyboard also predicts the next word, using a tiny model and a few words of context. Predicting the next token of a physics derivation or a legal argument is a different kind of problem: you cannot do it well without something that functions like understanding the content.
Researchers who study the insides of these models have found evidence of more structure than the phrase "autocomplete" suggests. Anthropic, which makes a competing model, reported in 2025 that when its model writes rhyming poetry, it appears to choose the rhyme word in advance and then write the line to arrive at it. That is planning, emerging from a system trained only to predict the next token.
What this does not settle is whether any of it amounts to understanding in the human sense. Researchers disagree, and we are not going to pretend otherwise.
Why this explains the mistakes
Once you hold this model in your head, the famous failures stop being mysterious.
- Confident wrong answers. The model always produces a fluent next token. There is no built-in step where it checks a fact. In a 2025 paper, OpenAI researchers argued that this is reinforced by how models are graded: most tests reward a lucky guess and give nothing for "I don't know", so models learn to guess. OpenAI's own summary is that newer models hallucinate less, but that it remains a fundamental challenge.
- Odd failures at simple things. Counting letters and exact arithmetic are awkward for a system that sees tokens and predicts likely text. Products increasingly hand such jobs to a calculator or code tool for that reason.
- Out-of-date knowledge. Training stops on a date. Anything after it is unknown unless search puts it into the document.
The SaaS100 perspective
This section is our analysis, not established fact.
We think the most useful sentence about ChatGPT is this: it is a text predictor that has to be given the right text.
That turns into practical habits. If the answer depends on facts, put the facts in front of it or make it search, and ask it to show where each claim came from. If the task has a right answer, such as a sum or a count, have it use a tool. If the stakes are high, treat the output as a strong first draft from a well-read colleague who never admits to not knowing.
For businesses, the same sentence explains why most serious AI products are not "a model". They are systems that fetch the right information, place it in the context, and check what comes back. The model is the easy part to rent. The system around it is the work.
What to take away
ChatGPT does not know things the way a database knows them, and it does not think the way you do. It does one thing, astonishingly well: given some text, it predicts what comes next.
Ask a question and you get a likely continuation, which is usually a correct answer and occasionally a convincing imitation of one. Knowing which of those you are looking at is now a basic skill, and it starts with knowing what the machine is doing.
Quick questions
Does ChatGPT search the internet for every answer? No. By default it generates from what it learned in training. When search is switched on or the app decides it is needed, results are fetched and added to the text the model reads.
Does ChatGPT learn from my conversation as we talk? Not in the sense of changing the model. Within a chat it can use everything in the conversation because that text is sent again each time. Whether conversations are used to train future models is a separate matter of the provider's data policy and your settings.
Why does it give different answers to the same question? Because the next token is sampled from a probability list rather than always being the top choice.
Sources and further reading
- Vaswani et al., "Attention Is All You Need" (2017). The paper that introduced the transformer. https://arxiv.org/abs/1706.03762
- Brown et al., "Language Models are Few-Shot Learners" (2020). The GPT-3 paper; source for the 175 billion parameter figure. https://arxiv.org/abs/2005.14165
- OpenAI, "Introducing ChatGPT" (30 November 2022). Launch post describing training with human feedback. https://openai.com/blog/chatgpt
- OpenAI Help Center, "What are tokens and how to count them?" Source for the four-characters rule of thumb. https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them
- OpenAI,
tiktokentokeniser library (theo200k_baseencoding used for Figure 2). https://github.com/openai/tiktoken - Kalai, Nachum, Vempala and Zhang, "Why Language Models Hallucinate" (September 2025). https://arxiv.org/abs/2509.04664 and OpenAI's summary: https://openai.com/index/why-language-models-hallucinate/
- Anthropic, "Tracing the thoughts of a large language model" (March 2025). Source for the rhyme-planning finding. https://www.anthropic.com/research/tracing-thoughts-language-model
Disclosure: token examples in this article were generated by SaaS100 using the open-source tokeniser. Probabilities in Figure 3 are illustrative.
Building something with language models and want it to be reliable, not just impressive in a demo? Talk to SaaS100 Studio.
