How AI writes its answers: one piece at a time
An AI chat app does not work out a whole answer and then show it. It writes one small piece at a time, and a weighted roll of the die picks each piece. This lesson follows one question from Enter to the last word, and shows what that means for your limits, your long chats and the Thinking switch.
9 min read · Last checked 14 October 2026
Take this lesson into your AI
Open in ChatGPT (new tab)Open in Claude (new tab)Same question, 2 different answers
Watch this part · 51 sSame question, two different AI answers. Why?
Ask an AI chat app this: "Plan 5 days in New Zealand, with the places where The Lord of the Rings was filmed." The plan might open at the Hobbiton set near Matamata, in the North Island. Open a new chat and send the same words. This time day 1 could be in the South Island.
The films were shot at more than 150 places across both islands, so both plans are reasonable. But which one is right, and is the app broken?
Nothing is broken. This is how these apps write, whether you use ChatGPT, Claude, Gemini or another. Once you see how, other things fall into place: why an answer appears word by word, why a long chat runs out, and why Thinking takes longer.
Autocomplete that has read a library
Watch this part · 1:15How AI writes answers: autocomplete that read a library
Type "see you" on your phone and the keyboard offers "tomorrow", "soon", "later". It is guessing the next word from the words before it.
A language modelLarge Language ModelA model trained on a huge amount of text to predict the next token. Further training turns it into an assistant that follows instructions. does a far bigger version of the same job. Given the text so far, it predicts what comes next. For the trip question it gives every possible next piece a score. "Day" might come first, "Here" close behind, "New" a little lower, and thousands of other pieces share what is left.
One piece is picked and added to the text. Then the whole text goes back in, and the next piece is picked. This repeats until the answer is finished.
That is why you see an answer arrive word by word. The app shows you the start while the rest is still being written.
The scores come from training, which is the subject of the next lesson. The point for now is what the model is not doing. It is not looking your answer up. It is predicting, piece by piece, what a good answer looks like. That is also why it can sound sure and still be wrong.
It reads pieces, not words
Watch this part · 1:31What are AI tokens? Explained in 90 seconds
Those pieces are called tokensTokenThe small piece of text a language model reads and writes, often part of a word. Prices, limits and the context window are all counted in tokens.. A token can be a whole word, part of a word, a single character or a punctuation mark. Even a space changes how text is cut.
Why not whole words? There are too many. English alone has over 500,000, before you count names and typing mistakes. Why not single letters? Every word would turn into a long chain, and the text would be too long to work with. Pieces are the middle ground. Common words stay whole. Rare words split into parts that still mean something, such as "annoyingly" into "annoying" and "ly".
As a rule of thumb for English, 1 token is about 4 characters, or three-quarters of a word.
Our own count
OpenAI publishes its tokenizerTokenizerThe part that cuts text into the tokens a model reads, and turns the model's tokens back into text. Each model family has its own., so we ran our sentences through it on 14 October 2026.
- The trip question is 20 tokens. Most are whole words, each with the space in front of it. The "5" is a token of its own.
- In "How many r's are in strawberry?", the word strawberry is 1 token.
- Typed alone, with no space in front, the same word is 3: "st", "raw" and "berry".
So when you ask how many r's are in strawberry, the model gets 1 piece. It never sees the letters. To count them it has to take that piece apart without being able to look at it. A question a child can answer tripped these models up for a long time for this reason.
The same sentence costs more in some languages
Take one line from the trip: "Where can I see the Hobbit village?"
| Language | Tokens |
|---|---|
| English | 8 |
| German | 9 |
| French | 11 |
| Greek | 17 |
It is the same question, and in Greek it takes more than twice the pieces. Each maker also cuts text in its own way, so one sentence can be a different number of tokens in ChatGPT, Claude and Gemini. Pictures and sound become tokens too. For Gemini a small image is 258 tokens and each second of audio is 32.
Tokens are the currency
Watch this part · 1:38Tokens are AI's money
Everything is counted in tokens: the words you send, the words you get back and, as you will see below, the thinking.
In the apps you do not see a price per token. You see limits, and the limits are counted in the same currency. Claude and Gemini both measure your usage by how long and how complex your conversations are. On both, the allowance refills every 5 hours, up to a weekly limit. So a plan works like a wallet that refills. Spend it on long, heavy chats and it runs out sooner.
There is a second limit of a different kind: how much one conversation can hold at once. This is the context windowContext WindowEverything a model can see at once while it writes an answer, counted in tokens. When the window is full, something has to be left out.. In the Gemini app it runs from 32,000 tokens with no plan to 1 million on the top plans. Claude's newest models hold up to 1 million on paid plans.
Here is the part that surprises people. With every message you send, the model reads the whole conversation again from the top: each earlier question, each earlier answer, then your new one. So a long PDF pasted into a chat is not paid for once. Its tokens come along with every message after it.
3 habits follow from this.
- Start a new chat when the topic changes.
- Paste the part you need, not the whole file.
- Do not drag a giant conversation along when a fresh one would do.
A weighted die picks each piece
Watch this part · 2:04Why AI gives a different answer every time: temperature explained
Back to the 2 trip plans. Where did the difference come from?
The simplest rule would be to take the top-scoring piece every time. That gives the same answer on every run, but on longer text it starts to repeat itself. So most apps roll a weighted die. The favourite gets the most sides, the runner-up fewer, and every piece with any chance at all gets a sliver.
Most rolls land on the favourite. Some do not. And one different pick early on changes everything after it, because each new piece is built on the ones before. Start with "Day 1: Auckland" and the plan heads for Hobbiton. Start with "Here is a plan" and it may open in the south.
A setting called temperatureTemperatureA setting that controls how much chance goes into each word a model picks. Low gives focused, predictable answers; high gives more varied ones. reshapes the die. Turn it down and the favourite gets even more sides, so answers are focused and predictable. Turn it up and the sides even out, so answers are more varied. DeepSeek, for example, recommends 0 for coding and maths and 1.5 for creative writing and poetry. You want the same answer to a sum every time, and a few surprises in a poem.
In the chat apps this is set for you. Developers used to set it themselves, and that is going away. Anthropic's newest Claude models return an error for anything but the default, Google deprecated it for Gemini in July 2026, Kimi K3 fixes it at 1, and DeepSeek's models ignore it in thinking mode. Even at 0, the exact same words are not guaranteed.
The cat sat on the …
- mat50%
- sofa22%
- floor17%
- roof7%
- keyboard4%
- moon1%
Low temperature: the likeliest word nearly every time. High: the unlikely words get a real chance. The scores are made up to show the effect.
So a different answer is not a broken answer. You can use this.
- For ideas (a trip, a name, an opening line): ask 2 or 3 times and keep the best parts.
- For a fact: ask once, then check the source.
What "Thinking" is
Many AI apps now have a Thinking switch, under one name or another. The idea is the same in all of them. Before the final answer, the model writes rough notesChain of ThoughtHaving a model write out the steps of its reasoning before it gives an answer. Once a prompting trick, now built into "thinking" models.. It breaks the problem down, plans the steps and weighs the options, and only then answers. It is like doing a sum on scrap paper before you write the result in the box.
For the trip, the notes might run: 5 days. The filming places are spread over both islands. Hobbiton is in the north and many others are in the south. That is too much driving for 5 days, so pick one island or fly between them. The answer then comes out already organised.
The notes are written the same way as everything else, one token at a time, and they are charged as output tokens. Some apps show you the notes and some show only a summary, but the notes were written either way. That is why Thinking takes longer and uses up your limit faster.
What you get back is better answers on problems with steps in them: maths, code, planning. And strawberry? With room to think, a model can write the word out letter by letter and then count.
More and more, the model decides for itself. Claude weighs each request: a simple factual question may get no thinking at all, and a multi-step maths problem gets a lot. Gemini 3.8 Flash thinks by default at a medium level. Kimi K3 thinks on every answer, and you can only turn it down.
A simple rule covers most cases.
- A word, a fact, a quick rewrite: fast mode is quicker and just as good.
- A plan, a comparison, a tricky sum: let it think.
The 4 things to keep
- An AI writes one token at a time, like autocomplete that has read a library. It reads the same whether it is right or wrong.
- Tokens are pieces of words, and every limit is counted in them. A long chat is read again with each message.
- A weighted die picks each piece, which is why one question can come back with 2 different answers.
- Thinking is scrap paper before the answer. It is slower and uses more of your limit, and it is better on hard problems.
What changes for you
I used to think an AI works out its whole answer and then shows it, so a different answer the second time meant something was wrong. Now I know it writes one piece at a time and a weighted die picks each piece, so I ask again when I want ideas and check a source when I need a fact.
Try it with your own AI
Watch the die roll
This takes about 10 minutes in any assistant. Every prompt goes into a new chat, so that no answer can lean on the one before it.
- Send the first prompt. Open a new chat and send it again. Compare where each plan spends day 1.
- Send the second prompt in 3 new chats and write down the 3 names.
- Send the third prompt in 3 new chats and write down the 3 numbers.
- If your assistant has a Thinking switch, turn it on and send the first prompt once more. Time it against the first run.
Prompt 1. A question with many good answers
Plan 5 days in New Zealand, with the places where The Lord of the Rings was filmed. Keep it under 150 words.
Prompt 2. A question where nearly anything fits
Suggest one name for a bakery that sells only pies. Reply with the name only.
Prompt 3. A question with one right answer
What is 17 times 23? Reply with the number only.
What to look for
- The 2 trip plans will not match word for word. Find the first place where they part. Everything after that point was built on a different piece.
- The bakery names should differ. Many names fit, so the die has many sides with a real chance.
- The sum should come back as 391 all 3 times. When one continuation is far ahead of the rest, the die lands on it almost every time.
- The same bakery name 3 times does not mean the die is missing. Your assistant has one strong favourite for that prompt. Ask for a name for a shop that sells only left-handed scissors and try again.
- With Thinking on, the answer takes longer to start. Look at whether the plan now deals with the 2 islands, by picking one or by adding a flight. That choice was made in the notes before the first word of the answer.
Check yourself
3 questions, each in a new situation
1. You ask an assistant to recommend a restaurant, then ask again in a new chat and get a different one. A friend says that proves the app is broken. What is the better explanation?
Not quite. The model scores every possible next piece and the app picks among them by weighted chance. One different pick near the start changes every piece after it. A new chat has no memory of the first answer, and nothing was looked up in a list.
2. You drop a 60-page report into a chat, then ask 20 questions about it. Near the end you hit your usage limit much sooner than usual. Why?
Not quite. With every message the model reads the whole conversation from the top, and the report is part of it. So its tokens are counted 20 times, once per question. Pasting only the pages you need, or starting a new chat for a new topic, cuts that.
3. Your assistant has a Fast mode and a Thinking mode. Which of these jobs is worth the wait for Thinking?
Not quite. Thinking is rough notes written before the answer, and it pays off where there are steps to work through, such as a comparison with several fees over time. The other 3 have a strong favourite answer already, so the notes add time and tokens and little else.
Sources
Where each fact comes from
This page was last checked against these sources on 14 October 2026.
- 1Glossary
Anthropic, Claude API documentation · 14 October 2026
Language models such as Claude's are pretrained to predict the next word from the text before it, on a large body of text. Temperature controls how random the model's predictions are. Higher values give more varied output and lower values give more predictable output. Even with temperature set to 0 the results are not fully the same every time.
- 2Generation strategies
Hugging Face, Transformers documentation · 14 October 2026
Greedy search picks the most likely next token at each step. It works for short outputs and breaks down on longer ones because it begins to repeat itself. Sampling picks a token at random according to the model's probabilities, so every token with a chance above zero can be chosen, and it reduces repetition.
- 3Streaming API responses
OpenAI API documentation · 14 October 2026
With streaming, the start of the model's output can be shown while the model is still generating the rest. This describes OpenAI's API.
- 4Understanding and counting tokens
OpenAI Help Center · 14 October 2026
A token can be a character, part of a word, a whole word or punctuation, and spaces affect how text is divided. For English, 1 token is about 4 characters or three-quarters of a word. The same text can give different token counts depending on the model, its encoding and the language. Output tokens include, for reasoning models, reasoning tokens that are not shown as answer text.
- 5LLM Course, chapter 2: Tokenizers
Hugging Face · 14 October 2026
English has over 500,000 words, which is too many for a tokenizer that works word by word. Splitting into single characters makes the text far longer. Subword tokenizers keep frequent words whole and split rare words into parts that still carry meaning, such as "annoyingly" into "annoying" and "ly".
- 6tiktoken
OpenAI, on GitHub · 14 October 2026
OpenAI publishes its tokenizer, and the library's model list maps the GPT-5 models to the o200k_base encoding. The token counts in this lesson are our own test. We ran each sentence through o200k_base on 14 October 2026.
- 7Understand and count tokens
Google, Gemini API documentation · 14 October 2026
Pictures and sound are turned into tokens too. For Gemini, an image of up to 384 pixels on each side counts as 258 tokens and audio counts as 32 tokens a second.
- 8Context windows
Anthropic, Claude API documentation · 14 October 2026
Each turn's input holds all of the earlier conversation plus the new message, and earlier turns are kept in full.
- 9How do usage and length limits work?
Anthropic, Claude help centre · 14 October 2026
Claude has a session limit that resets every 5 hours and weekly limits. Usage depends on the length and complexity of your conversations, the features and model you use and the effort level. The context window is how much Claude can work with in one chat, and on paid plans the newest models support up to 1 million tokens.
- 10Gemini Apps limits and feature availability
Google, Gemini Apps Help · 14 October 2026
Gemini Apps limits take into account the complexity of the prompt, the models and features used and the length of the chat. The limit refreshes every 5 hours until a weekly limit is reached. The context window is 32,000 tokens without a plan, 128,000 on AI Plus and 1 million on AI Pro and AI Ultra.
- 11The Temperature Parameter
DeepSeek API documentation · 14 October 2026
DeepSeek recommends a temperature of 0.0 for coding and maths and 1.5 for creative writing and poetry.
- 12Thinking Mode
DeepSeek API documentation · 14 October 2026
In thinking mode the model writes out its reasoning before the final answer, to make the answer more accurate. Thinking mode does not support the temperature setting. A value sent with the request has no effect.
- 13Kimi K3 quickstart
Moonshot AI, Kimi API documentation · 14 October 2026
Kimi K3 fixes temperature at 1.0 and top-p at 0.95. It always has thinking mode on, and its reasoning effort can be set to low, high or max.
- 14Claude Platform release notes
Anthropic · 14 October 2026
Setting temperature, top_p or top_k to a non-default value returns a 400 error on Claude Opus 4.8, as on Opus 4.7, and on Claude Sonnet 5. On Claude Haiku 5.5 these sampling parameters can return a 400 error too.
- 15Gemini API release notes
Google · 14 October 2026
On 21 July 2026 the sampling parameters temperature, top_p and top_k were deprecated in the Gemini API.
- 16Thinking models
Moonshot AI, Kimi API documentation · 14 October 2026
A thinking model breaks the problem down, plans steps and weighs alternatives before it answers. This improves results on complex reasoning and code, at the cost of more time and more tokens.
- 17Reasoning tokens
OpenRouter documentation · 14 October 2026
Reasoning tokens are counted as output tokens and charged as output tokens.
- 18Adaptive thinking
Anthropic, Claude API documentation · 14 October 2026
Claude decides for each request whether to think. A simple factual question may get an answer with no thinking, and a multi-step maths problem gets deeper reasoning.
- 19Gemini thinking
Google, Gemini API documentation · 14 October 2026
Thinking improves Gemini's reasoning and planning on complex tasks such as coding, advanced maths and data analysis. Gemini models adjust the amount of thinking to the request. Gemini 3.8 Flash has thinking on by default at a medium level, with low and high to choose from.
- 20The Lord of the Rings trilogy filming locations
Tourism New Zealand · 14 October 2026
The trilogy was filmed at more than 150 locations in both the North and the South Islands. The Hobbiton set is near Matamata, in the North Island.
