01
Everything is tokens, not words
Before the model sees your message it is broken into tokens, which are word fragments rather than words. Common words are often a single token, unusual ones split into several, and a space or a punctuation mark can be its own token.
This is not trivia. It explains why the model is bad at counting letters in a word, why it sometimes miscounts characters, and why non-English text can cost more to process: the text takes more tokens to represent.
02
Stage one: pretraining
The model is shown enormous quantities of text and repeatedly asked to predict the next token. When it is wrong, its internal parameters are nudged. Repeat this a very large number of times and the model absorbs grammar, facts, styles, reasoning patterns and biases, all as statistical structure rather than stored records.
This is why it can write a sonnet about accounting. It never memorised that sonnet. It learned the shape of sonnets and the vocabulary of accounting, and it can combine them.
03
Stage two: learning what a good answer looks like
A model that has only been pretrained is not a useful assistant. It will happily continue your question with more questions, because that is what often follows a question in raw text.
So it is fine-tuned. Humans write and rank example responses, a reward model learns to predict those preferences, and the model is optimised to produce answers people rate highly. This is reinforcement learning from human feedback, usually shortened to RLHF.
It is also where the personality comes from, and where a real tension lives: a model optimised for answers people like will lean towards being agreeable, which is not always the same as being right.
04
The context window is the whole memory
Within a conversation, the model does not remember earlier turns the way you do. Every time it responds, the recent conversation is fed back in as input. That input has a size limit called the context window.
When a chat gets long enough, the earliest parts fall out of the window and are simply gone. That is the mechanism behind a long conversation drifting away from your original instructions.
Separately, ChatGPT has a memory feature that deliberately stores facts about you across conversations. That is a product feature layered on top, not the model remembering.
05
Why it invents things
A hallucination is not a bug in the ordinary sense. The model produces the most plausible continuation, and a fabricated citation in the correct format is extremely plausible. Nothing in the mechanism checks whether the paper exists.
Which is why the practical defences all work by adding a checking step the model does not have on its own.
- Give it the source material rather than relying on recall.
- Ask for citations, then verify them yourself.
- Tell it explicitly to say when it does not know.
- Treat every specific number, date, name and quote as unverified until you check.
Frequently asked questions
Does ChatGPT search the internet?
The underlying model does not. It generates from patterns learned in training. ChatGPT the product can be given browsing and other tools, and when it uses them it retrieves real pages and can cite them. Those are two different things, and it matters because an answer produced without retrieval has nothing behind it but plausibility.
Is ChatGPT actually reasoning?
It produces reasoning-shaped output, and on many tasks that output is correct, which is a genuine and useful capability. Whether that constitutes reasoning is a live argument. Practically, the important thing is that the appearance of careful reasoning is not evidence of it, so a confident chain of steps still needs checking.
Does ChatGPT learn from my conversations?
Not in the moment. The model's parameters are fixed between training runs, so nothing you say changes it mid-chat. Your conversations may be used to help improve future models depending on your data settings, which you can turn off, and that is separate from the memory feature that stores facts about you.
Why does it give different answers to the same question?
Generation is deliberately not deterministic. The model produces a probability distribution over the next token and samples from it, so the same prompt can take different paths. That is why an answer being repeated is not confirmation, and asking twice is a weak check at best.