Type a question into a modern chatbot and it answers in fluent, confident paragraphs — sometimes brilliantly, sometimes with facts it invented on the spot. It can feel like talking to someone. But inside the machine there is no someone. There is a very large statistical model doing one deceptively simple thing, billions of times over: guessing what comes next.
Step one: chopping language into tokens
A chatbot never sees words the way you do. Before any processing, your text is split into tokens — small chunks of characters. A short word like "cat" is one token. A longer word like "unbelievable" might be split into three. Punctuation, spaces and common letter combinations all become tokens too. A rough rule of thumb published by OpenAI is that one token equals about three-quarters of an English word, so a 100-word question works out to roughly 130 tokens. Everything the model knows, it knows about sequences of these tokens.
The transformer: paying attention
The breakthrough that made today's chatbots possible came in 2017, when Google researchers published a paper with a famous title: "Attention Is All You Need." It introduced the transformer, a design built around a mechanism called attention. As the model processes a sentence, attention lets it weigh which other words matter most to each word. In "The animal didn't cross the street because it was too tired," attention is what links "it" to "animal" rather than "street." Stack dozens of these layers on top of each other, and the model builds a rich, context-sensitive picture of what a passage is doing — not by understanding it, but by tracking patterns in how words relate to one another.
Training: read first, then finishing school
A large language model is built in two stages. In pretraining, it is fed a vast library of text — books, articles, websites, code — and set a single endless homework task: hide a token and guess it. Every wrong guess nudges its internal parameters, the adjustable numbers that define the model. GPT-3, a landmark model released in 2020, had 175 billion of them, and the largest models today are bigger still. Out of this simple exercise emerge surprising abilities: translation, summarizing, writing code, and reasoning through problems step by step.
Raw pretraining produces a model that continues text, not one that chats helpfully. So developers add a second stage: fine-tuning with human feedback. Human reviewers rank example answers — helpful over harmful, honest over evasive — and the model is adjusted to favor the better style. This process, called RLHF, is why a chatbot answers your question instead of simply continuing your sentence with more questions of its own.
Why it sometimes sounds sure but is wrong
Here is the crucial limitation. The model is not consulting a database of verified facts; it is producing the most plausible-sounding continuation. Usually plausibility and truth coincide, because true statements dominated its training material. But when its knowledge runs out, the machinery does not stop — it keeps generating smooth, confident text anyway. Researchers call these inventions hallucinations. It is the single most important thing to understand about chatbots: fluency is their native skill; accuracy is a side effect. Treat them like a brilliant, well-read assistant that cannot cite its sources and struggles to say "I don't know" — impressive, genuinely useful, and always worth double-checking.