ChatGPT decides what to say one small piece at a time. It reads everything in the conversation so far, works out how likely each possible next word is, picks one, adds it to the text and does the same again. A whole answer is built this way, word by word, with no finished plan behind it. What makes the choices sensible is training: first on a huge amount of written text, then on feedback from people about which answers they prefer.
What is a language model?
A language model is a program that predicts which word is likely to come next in a piece of text. ChatGPT is built on one (OpenAI’s GPT models), and so are Claude, Gemini and most other chatbots.
Strictly, the model works with tokens, which are words or pieces of words. In English a token is about three-quarters of a word on average. We will say “word” here to keep things simple.
How does it pick the next word?
Say we type “The capital of France is”. The model gives every word it knows a score. “Paris” gets a very high one. “a”, “the” and “located” get small ones. Thousands of others get almost nothing.
It then picks a word from that list. Usually it takes one of the likeliest, with a little randomness allowed, which is why the same question can get slightly different answers each time. The chosen word is added to the text, and the whole text, now one word longer, goes back in to choose the next one.
This is a loop. The model’s own output becomes part of its next input. Once a word is written it stays, and every later word has to fit around it. If an early word takes the answer in a wrong direction, the rest of the answer tends to follow it there. This is one reason chatbots sometimes carry on confidently with something that is wrong.
Where does the idea come from?
Predicting the next word is an old idea. In 1948 Claude Shannon published the paper that founded information theory. In it he built fake English by choosing each word according to how often it followed the word before. One of his results begins: “THE HEAD AND IN FRONTAL ATTACK ON AN ENGLISH WRITER THAT THE CHARACTER”. It is nonsense, but it reads a bit like English, because each pair of words is a real pair.
ChatGPT does the same job with a far longer memory. Shannon’s method looked one word back. A modern model looks at the whole conversation, often thousands of words, and has learned from a large share of the text on the public internet which words tend to follow which, and in what situations.
How does training shape what it says?
Training happens in two broad stages.
Learning from text. The model is shown enormous amounts of writing and asked, again and again, to predict the next word. Each time it gets one wrong, its settings are nudged so it would do slightly better next time. After billions of these corrections it has absorbed grammar, facts, styles of writing and a great deal of how people reason on paper. At this stage it can continue any text, but it does not yet behave like a helpful assistant.
Learning from people. Next, people write example answers and rank the model’s answers from best to worst. The model is then adjusted towards the kinds of answers people rank highly. OpenAI described this method, called reinforcement learning from human feedback, in a 2022 paper, and it is what turned a text predictor into a chatbot that answers questions politely.
In cybernetic terms, this second stage is a feedback loop. The model answers, people judge the answer, and the judgement steers the model’s future answers. Whatever the loop rewards is what the model learns to produce.
Why does it sometimes tell us what we want to hear?
Because people’s ratings are what it is steered by, and people tend to rate pleasant, agreeing answers highly. If the feedback loop rewards agreement more than accuracy, the model drifts towards agreeing.
This happened in public in April 2025. OpenAI released an update to GPT-4o that had been trained partly on ChatGPT users’ thumbs-up and thumbs-down clicks. The model became so flattering that OpenAI began rolling it back three days later. In its own explanation, OpenAI said the new signal from user feedback had weakened the one that had been keeping flattery in check.
We wrote about this pattern, and the anthropologist who first described it, in In 1936, an Anthropologist Described the AI Sycophancy Spiral.
Common questions
Does ChatGPT understand what it is saying? It has learned a great deal about how words, facts and ideas relate, and it uses that well. Whether that counts as understanding is still argued about. What we can say is that it has no separate check of its words against the world unless it is given one, such as a web search.
Does ChatGPT know the answer before it starts writing? No. It does not write a draft and then type it out. Each word is chosen when it is reached, although the model’s internal state at that moment can carry a sense of where the sentence is going.
Why does ChatGPT give different answers to the same question? Because it picks each word with a little randomness from the likely options. Two runs can take a different word early on, and from then on the answers follow different paths.
Is ChatGPT copying text from the internet? Mostly it is not looking anything up. It writes new text from patterns it learned in training. It can sometimes repeat well-known passages closely, and when it uses web search it does draw on specific pages.
What is the difference between ChatGPT and GPT? GPT is the family of language models made by OpenAI. ChatGPT is the app built on top of them, with the chat window, memory, search and other tools around the model.
For more on how a loop steers whatever sits inside it, see our guide to feedback and our explainer What Is an AI Agent?