By Thorsten Meyer | November 22, 2026 | ThorstenMeyerAI.com
Get business pricing on tech for your team
- Business-only prices and quantity discounts
- Tax-exempt purchasing
- Multiple users, one account, clear invoices
You type a question into a chatbot. A second later the answer starts to appear, a few letters at a time, as if someone were typing. It reads fluently, it sounds sure of itself, and most of the time it is useful. Sometimes it is confidently wrong.
Both outcomes come from the same machine doing the same thing. A large language model does not look your answer up. It turns your text into numbers, runs those numbers through a stack of layers, and predicts which small piece of text should come next. Then it does that again, and again, until the answer is finished.
This guide follows one prompt through that whole path: tokens, embeddings, the transformer, the training that made a text predictor into an assistant, the extra “thinking” of reasoning models, the dice roll called sampling, and the tools a model can call. At each step we say what it means for the question that matters at work: when can you trust what comes out?
This guide is part of our explainer series on how AI works. It keeps two topics short on purpose. For the arithmetic inside a neural network, see What Actually Happens Inside a Neural Network? and How Deep Learning Works. How much text a model can see at once, and why long inputs get expensive, is the subject of the series’ explainer on context windows.
Key takeaways
- A language model predicts the next token, one at a time. Your text is cut into tokens, about 4 characters or three-quarters of an English word each, and every new token is chosen from a list of probabilities.
- The transformer is the engine. Introduced in 2017, it lets every token “attend” to the other tokens and pull in what is relevant. Stacks of these layers turn your prompt into a probability for every possible next token.
- Pretraining builds knowledge, post-training builds the assistant. A model first learns to continue text from a huge corpus. Then human feedback (RLHF) or AI feedback guided by written principles (RLAIF) teaches it to follow instructions. In OpenAI’s 2022 study, a 1.3 billion parameter model trained this way was preferred to the 175 billion parameter GPT-3.
- Reasoning models spend more compute on your question. They generate hidden reasoning tokens before answering. That often helps on hard problems, and the hidden tokens are billed as output tokens.
- The answer is sampled, not retrieved. Temperature controls how adventurous the choice of the next token is. The same prompt can give different answers.
- The limits follow from the design. Models can make things up, they know nothing after their training data ends, and every token costs money. Verification is part of the job, not an insult to the tool.
Explainer · how a language model answers
From your prompt to the next word, in five steps
The model never looks up an answer. It turns text into numbers, predicts the next token, picks one, adds it to the text and starts again.
- 1Tokens. Your text is cut into pieces, about 4 characters each in English.
- 2Embeddings. Every token becomes a long list of learned numbers.
- 3Transformer. Layer by layer, each token “attends” to the others and mixes in what matters.
- 4Probabilities. The model scores every possible next token. A sampler picks one; temperature sets how adventurous it is.
- 5Repeat. The chosen token is added to the text, and the whole pass runs again for the next one.
Source: process as described in Vaswani et al., Attention Is All You Need (2017), the OpenAI Help Center on tokens and Anthropic’s glossary. Token splits and bar lengths are illustrative. Animation: Thorsten Meyer AI.
Products Worth Considering

Amazon Kindle Paperwhite (2024) – 16GB, 7 Glare-Free Display, Waterproof

Bose QuietComfort Headphones (2nd Gen), Wireless Noise-Cancelling Over-Ear Headphones, Black

Logitech MX Master 4 Ergonomic Wireless Mouse with Haptic Feedback, Graphite
As an affiliate, we earn on qualifying purchases.
Step 1: Your text becomes tokens
A model never sees letters or words. Before anything else, your prompt is cut into tokens. OpenAI describes a token as something that “can represent a character, part of a word, a whole word, or punctuation.” Its rule of thumb for English: “1 token is approximately 4 characters,” “approximately three-quarters of a word,” and “100 tokens are approximately 75 words.” OpenAI adds: “These are estimates, not exact counts.”
Why pieces of words? Because no fixed list of words can cover every name, typo and new term. In 2016, Rico Sennrich and colleagues showed that a model could handle rare and unknown words by “encoding rare and unknown words as sequences of subword units,” using a method based on byte pair encoding, an old compression trick. Common words become one token; unusual words are built from several.
The count depends on the model. Anthropic writes that its newer Claude models “use a newer tokenizer that produces approximately 30 percent more tokens for the same text than earlier models, on which a token represents approximately 3.5 English characters.”
Why it matters: tokens are the unit you pay for and the unit of every limit. They also help explain some odd failures. A model that sees a word as one or a few chunks does not see its individual letters, so a task like counting the letters in a word is harder for it than it looks. The hallucination paper discussed below lists letter counting as a typical error case.
Step 2: Tokens become numbers with meaning
Each token is then replaced by a long list of numbers, its embedding. In the paper that introduced the transformer, the authors write: “we use learned embeddings to convert the input tokens and output tokens to vectors of dimension dmodel.” In their base model that dimension was 512, so every token became 512 numbers.
“Learned” is the important word. Nobody types in what a token means. During training, the numbers are adjusted until tokens used in similar ways end up with similar lists. That is how “invoice” lands near “bill” and far from “banana”, without a dictionary. Because word order matters, the original transformer also adds “positional encodings” to the embeddings, so the model knows where each token sits.
If you want to see what these layers of multiplying and adding actually do with the numbers, our neural network explainer follows them by hand.
Step 3: The transformer lets every token look at the others
The 2017 paper “Attention Is All You Need” by Ashish Vaswani and colleagues at Google proposed “a new simple network architecture, the Transformer, based solely on attention mechanisms, dispensing with recurrence and convolutions entirely.” Its big translation model trained in 3.5 days on eight GPUs, “a small fraction of the training costs of the best models from the literature” at the time. Almost every large language model since is built on this design.
The intuition for attention: in the sentence She sat by the bank of the river, the token “bank” needs the word “river” to mean the right thing. Attention lets each token score how relevant every other token is, then mix in information from the most relevant ones. The original model ran “h = 8 parallel attention layers, or heads” side by side, so different heads can pick up different kinds of relations between the tokens. Its encoder was “a stack of N = 6 identical layers”; today’s models stack many more.
After the last layer, the model turns the result into “predicted next-token probabilities”: a score for every token in its vocabulary. That list is the whole output of one step.
Attention has a price: every token looks at every other token, so the work grows quickly as the input gets longer. Why that limits how much text a model can handle, and how models cope with long documents, is covered in the series’ explainer on context windows.
Step 4: Pretraining, or learning by predicting the next token
Where does the knowledge come from? From pretraining. Anthropic’s glossary describes it plainly: models “are pretrained to predict the next word, given the previous context of text in the document.” Show the model a sentence with the end hidden, let it guess, measure how wrong the guess was, adjust the numbers, repeat. Do that over a large share of the written internet and the model has to pick up grammar, facts, styles of argument and code along the way, because all of them help to predict the next token.
The scale is hard to picture. OpenAI’s GPT-3 paper from 2020 describes a model “with 175 billion parameters” and states: “All models were trained for a total of 300 billion tokens.” The paper also lists the mix: filtered Common Crawl web text made up 60% of the training mix, WebText2 22%, two book collections 8% each, and Wikipedia 3%. The model pages of today’s vendors do not list their training data at this level of detail, which is why a 2020 paper is still the clearest public picture of a pretraining diet.

The result of pretraining is a powerful text continuer, not an assistant. Anthropic’s glossary says these pretrained models “are not inherently good at answering questions or following instructions.” Ask one “What is the capital of France?” and it may continue with three more quiz questions, because that is what such a line is often followed by on the web.
Step 5: Post-training turns a text predictor into an assistant
The step that made chatbots possible is called post-training. The best documented recipe is OpenAI’s InstructGPT paper by Long Ouyang and colleagues, published in 2022. It has three stages:
- Show. People write good answers to real prompts, and the model is fine-tuned on those demonstrations. OpenAI hired “a team of about 40 contractors” for this and for the comparisons.
- Rank. The model writes several answers; people rank them from best to worst. A second model, the reward model, learns to predict those rankings.
- Reinforce. The language model is trained with reinforcement learning to produce answers the reward model scores highly. This is reinforcement learning from human feedback, RLHF.
The effect was large. In OpenAI’s human evaluations, “outputs from the 1.3B parameter InstructGPT model are preferred to outputs from the 175B GPT-3, despite having 100x fewer parameters.” The full-size InstructGPT was preferred to GPT-3 “85 ± 3% of the time.” On tasks where the answer should only use the input, such as summaries, InstructGPT made up information “about half as often as GPT-3 (a 21% vs. 41% hallucination rate, respectively).”

Note the second half of that sentence: half as often is not never. The authors write that “InstructGPT still makes simple mistakes,” for example that it can “make up facts” or “fail to detect instructions with false premises.”
Anthropic’s Constitutional AI paper by Yuntao Bai and colleagues, also from 2022, replaced part of the human labelling with AI feedback. “The only human oversight is provided through a list of rules or principles,” the authors write. The model critiques and revises its own drafts against those principles, and a preference model trained on AI judgments supplies the reward: “we use ‘RL from AI Feedback’ (RLAIF).” Today’s assistants combine such methods, and the details of each vendor’s current recipe are not public.
Why it matters: post-training shapes tone, format, refusals and willingness to say “I don’t know.” It does not add new facts. A model that sounds helpful is not thereby a model that is right.
Step 6: Reasoning models think in tokens, too
A newer kind of model, the reasoning model, changes one thing: before it answers, it writes a long internal draft. OpenAI’s documentation explains that reasoning models “use internal reasoning tokens before producing a response” and use them to “think,” “breaking down the prompt and considering multiple approaches to generating a response.” Anthropic calls the same idea thinking; its current models use “adaptive thinking,” in which “Claude decides, for each request, whether to think and how much.”
Research backs the idea that extra compute at answer time can pay off. A 2024 study by Charlie Snell and colleagues found that allocating test-time compute per prompt improved its efficiency “by more than 4x compared to a best-of-N baseline,” and that on problems where a smaller model already had some success, “test-time compute can be used to outperform a 14x larger model.” DeepSeek’s R1 paper reports that reasoning abilities “can be incentivized through pure reinforcement learning,” with patterns such as self-reflection and verification emerging during training.
Two caveats. The gains depend on the problem: Snell and colleagues write that effectiveness “critically varies depending on the difficulty of the prompt.” And thinking is not free. OpenAI states that reasoning tokens “are not visible via the API” but “still occupy space in the model’s context window and are billed as output tokens.”
Step 7: Sampling, or why the same question gets different answers
At every step the model hands over probabilities, not a decision. Something has to pick the next token. That is sampling.
Always taking the single most likely token sounds safest, but it produces dull text. A 2019 study by Ari Holtzman and colleagues found that using likelihood to choose the output “leads to text that is bland and strangely repetitive.” Their fix, nucleus sampling, draws from the small set of tokens that together hold most of the probability and cuts off the unreliable tail.
The setting you are most likely to meet is temperature. Anthropic’s glossary: “Temperature is a parameter that controls the randomness of a model’s predictions during text generation.” Higher values give “more creative and diverse outputs”; lower values give “more conservative and deterministic outputs that stick to the most probable phrasing and answers.”
Why it matters: if you ask the same question twice and get two different answers, nothing is broken. The variation itself is a signal. When a model gives different facts on each try, it probably does not know.
Step 8: Tools let the model act beyond its own text
A language model on its own can only produce text. Tool use extends that. In Anthropic’s description, the model “determines when to call a tool based on the user’s request and the tool’s description” and then “returns a structured call that your application runs.” For tools that run in your own software, “Your code runs the operation and sends back a tool_result,” and the model continues with the result in front of it.
The reason is old. The 2023 Toolformer paper by Timo Schick and colleagues noted that language models “struggle with basic functionality, such as arithmetic or factual lookup, where much simpler and smaller models excel.” A calculator, a search engine or your own database fills exactly those gaps.
Why it matters: a model with a search tool can quote today’s news; one without can only remember its training data. But a tool is also a door: whatever the model can call, a confused or manipulated model can call too. Give tools the smallest permissions that do the job.
The limits that follow from the design
Hallucination. A 2025 paper by Adam Tauman Kalai and colleagues at OpenAI and Georgia Tech argues that “language models hallucinate because the training and evaluation procedures reward guessing over acknowledging uncertainty.” In their view, hallucinations “need not be mysterious—they originate simply as errors in binary classification”: if a model cannot tell a true statement from a false one that sounds similar, it will sometimes produce the false one. The authors name typical cases: “arbitrary facts when there is no pattern in the data,” such as a person’s birthday, and tasks like letter counting, where the model is simply too weak.
Knowledge cutoff. A model knows only what was in its training data. Anthropic’s model overview, checked on November 22, 2026, lists a reliable knowledge cutoff of Jun 2026 for all four current Claude models. Anything that happened since then the model can only learn from you or from a tool. Without one, it may describe an outdated state of the world in a confident present tense.
Cost per token. You pay for every token in and every token out. On the same overview page, Claude Opus 5.5 costs $4 for each million input tokens and $20 for each million output tokens, so output is five times as expensive as input. Reasoning tokens count as output. A long prompt, a long answer and a long hidden reasoning trace all show up on the bill.
When to trust the output
Put the steps together and a practical rule appears: trust grows with how much of the answer the model can take from what you gave it, and shrinks with how much it has to produce from memory.
| Task | Where the answer comes from | What to check |
|---|---|---|
| Rewrite, shorten or translate your own text | Your input | Meaning kept, nothing added |
| Summarise a document you supplied | Mostly your input | Names, numbers and dates against the original |
| Draft code or a formula | Patterns from training | Run it and test it before use |
| Facts, quotes, citations from memory | Training data, sampled | Every one against a primary source |
| Anything after the knowledge cutoff | Nothing, unless a tool fetched it | Which source was used and when |
| Calculations | Token prediction, unless a tool ran them | Whether a calculator or code actually ran |
We looked at what such checks cost in practice in Checking AI’s Work Has a Hidden Cost.
What it means for businesses
- Give models the facts instead of hoping they know them. Supply the document, the database or a search tool. Grounded tasks are where language models are most reliable.
- Budget in tokens, not in seats. Output and reasoning tokens drive the bill. Long answers and heavy reasoning on simple tasks waste money; reserve reasoning modes for problems that need them.
- Design for variation. Where the same input must give the same result, as in classification or extraction, use low temperature, fixed formats and automatic checks, and test with repeated runs.
- Treat tools as permissions. Every tool a model can call is something it can do wrong. Log tool calls and require a human step for anything that spends money, sends messages or deletes data.
What it means for you
- Fluent is not the same as true. The model’s tone comes from post-training; its facts come from patterns. A confident sentence is not evidence.
- Ask for sources, then open them. A citation the model wrote from memory is itself a prediction. Only a link you have opened counts.
- Ask twice. If two runs disagree on a fact, check it before you use it.
- Know the date of its knowledge. For anything recent, use a tool with search or bring the source yourself.
What is not known
- Today’s recipes are mostly private. The detailed public descriptions of pretraining data and post-training steps come from papers published between 2017 and 2022. Current vendors publish prices, limits and cutoffs, but not their full training data or methods.
- Why a given answer came out is still hard to explain. Every step is arithmetic, but there are billions of numbers involved. Tracing one answer to its causes inside a large model remains an open research problem.
- How far extra thinking helps. The research shows real gains on some problems and little on others. Where the line runs for your own tasks you have to measure.
Sources
- Vaswani, A. et al.: Attention Is All You Need, arXiv:1706.03762 (NeurIPS 2017), abstract and sections 3.1, 3.2.2, 3.4 (pages 1, 3 and 5 of the PDF)
- Brown, T. et al. (OpenAI): Language Models are Few-Shot Learners, arXiv:2005.14165, abstract and Tables 2.1 and 2.2 (pages 8 and 9 of the PDF)
- Ouyang, L. et al. (OpenAI): Training language models to follow instructions with human feedback, arXiv:2203.02155, abstract, pages 2 to 4 and 7
- Bai, Y. et al. (Anthropic): Constitutional AI: Harmlessness from AI Feedback, arXiv:2212.08073, abstract (page 1 of the PDF)
- Sennrich, R., Haddow, B. and Birch, A.: Neural Machine Translation of Rare Words with Subword Units, arXiv:1508.07909, abstract
- Holtzman, A. et al.: The Curious Case of Neural Text Degeneration, arXiv:1904.09751 (ICLR 2020), abstract
- Schick, T. et al.: Toolformer: Language Models Can Teach Themselves to Use Tools, arXiv:2302.04761, abstract
- Snell, C. et al.: Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters, arXiv:2408.03314, abstract
- DeepSeek-AI: DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning, arXiv:2501.12948, abstract
- Kalai, A. T. et al. (OpenAI): Why Language Models Hallucinate, arXiv:2509.04664, abstract and page 2
- OpenAI Help Center: What are tokens and how to count them?
- OpenAI API documentation: Reasoning models
- Anthropic documentation: Glossary, Models overview, Extended thinking and Tool use
More in this series: how AI works
- Part 1: How AI Actually Works: Data In, Probabilities Out, and Why That Explains the Errors
- Part 2: How LLMs Learn From Sliding Windows: Context Windows, Attention and the Cost of Long Prompts
- Part 3: How PyTorch Works: Tensors, Autograd and the Training Loop Behind Modern AI, Explained
Further reading on ThorstenMeyerAI.com
- What actually happens inside a neural network? Follow the numbers from a handwritten 7 to the answer
- How deep learning works: a plain-English guide
- How a model is trained, and how it answers
- Checking AI’s work has a hidden cost
- What can AI really do today? The time horizon, explained
This guide explains published research and vendor documentation; it is not legal, career or investment advice. Researched and drafted with AI assistance, including Anthropic’s Claude. Conflict of interest: Anthropic makes the AI we used, and Anthropic’s documentation and its Constitutional AI paper are among the sources here, next to papers and documentation from OpenAI, Google researchers and DeepSeek. We quote limits and caveats as the sources state them. No company named here reviewed or sponsored this article. Our own text and graphics contain no affiliate links; offer and product boxes added by the site may contain Amazon affiliate links. Sources checked on November 22, 2026. Images: AI-generated illustration (Runware), animation and charts by Thorsten Meyer AI from the published numbers; our own images show no real people or logos. Boxes added by the site may show product photos or people.
