What happens when you ask an AI a question
From pressing enter to the last word: tokens, the desk the model reads from, one-token-at-a-time writing, thinking, web search, and where your words go.
In mid-2024, asking a popular chatbot how many r's are in “strawberry” was a reliable party trick: many confidently answered two. The same systems could write a sonnet or explain a tax form. The failure looks absurd until you learn one fact: the model never saw the letters. Following that one fact through the whole journey of a question explains most of what these tools get right and wrong.
1. Your words become tokens
A language model reads tokens: chunks of text from a fixed vocabulary, typically 32,000 to 256,000 pieces. Here is how the tokenizer used by OpenAI's GPT-4 (named cl100k_base) actually splits three inputs:
| You type | The model receives | Tokens |
|---|---|---|
| Hello world | Hello · ␣world | 2 |
| strawberry | str · aw · berry | 3 |
| 2026-10-12 | 202 · 6 · - · 10 · - · 12 | 6 |
Each token becomes a number, and from then on the model works only with numbers. “strawberry” arrives as three numbers, none of which spells out its letters. To count the r's, the model has to have learned indirectly how “str”, “aw” and “berry” are spelled. The date row explains a second classic weakness: a number like 2026 arrives as “202” and “6”, which is one reason long arithmetic goes wrong.
2. Everything the model reads goes on one desk
Your question is never sent alone. The app adds its own hidden instructions (often 1,000 to 5,000 tokens you never see), the earlier messages in the chat, and sometimes documents or search results. All of it goes on one desk, and the size of the desk is the context window: as of late 2026, commonly 128,000 to 1,000,000 tokens, or roughly 300 to 2,000 printed pages.
Whatever is on the desk, the model can use. Anything not on the desk does not exist for this answer. When a long chat outgrows the desk, the app has to drop or summarise older messages, which is why an assistant can “forget” something you said an hour ago.
3. It writes one token at a time
The model's single skill is predicting the next token given everything on the desk. It does not draft the whole reply first. It produces one token, adds it to the desk, and predicts again, until it predicts that the reply is finished. That is why words stream onto the screen, and why an answer that takes a slightly wrong turn early tends to keep going: every later token is chosen to fit the ones before it, mistakes included.
The pick is not always the top-scoring token. A setting called temperature controls how often a less likely token gets chosen, which is why the same question can get two differently worded answers. That is deliberate, not a fault.
4. Some models think first
Since late 2024 many assistants use reasoning models: OpenAI's o-series, Claude with extended thinking, Gemini's thinking models and DeepSeek-R1 among them. Before writing the reply you see, they write a long working-out, from a few hundred to tens of thousands of tokens, that the app usually hides or shows only as a summary. It is the same one-token-at-a-time loop, run for longer, in the spirit of chain-of-thought prompting.
This is why some answers sit on “Thinking…” for 10 to 60 seconds, and why newer models count the r's correctly: they spell the word out in their working before answering. Thinking helps with multi-step problems like maths, code and planning. It does not help with facts the model has never seen, because more reasoning over a missing fact is still missing the fact.
5. Some models look things up
When an assistant shows “Searching the web…”, the model has not gone online. It writes a short, structured request, and the app does the searching. This is tool use, and the same mechanism lets assistants run a calculation, read a file or check a calendar.
Search fixes the knowledge cutoff for that one answer, but the answer is now only as good as the pages that came back. A web page can also contain hidden text written to instruct the model rather than inform it, a trick called prompt injection. Treat a searched answer like a colleague's summary of what they found: check the links for anything that matters.
Why the answer can still be wrong
Put the five steps together and the failure modes have clear causes:
- Nothing relevant was on the desk, so the model produced something that fits the pattern of an answer. A fluent, invented answer is a hallucination, and it reads exactly as confidently as a correct one.
- The wrong thing was on the desk: an outdated page, a misleading search result, a document from a different customer.
- The question needs letters or digits the tokens hide, like counting characters or adding 14-digit numbers, unless the model works it out step by step or uses a calculator tool.
- An early token took a wrong turn, and everything after it was written to fit.
Where your words go
For the big assistants, nothing runs on your phone: your message, and anything you paste or upload, travels to the provider's servers. What happens next depends on the plan, not the model. Consumer apps may keep conversations and, depending on your settings, use them to improve future models. Business and developer plans from the major providers generally do not train on your data by default and keep it for a limited time, for example to monitor abuse. Before pasting a contract, a payslip or a patient's notes, check the data settings of the exact product and plan you are using.
Key takeaways
- Most of the strange failures, from miscounted letters to fumbled long numbers, come from the model seeing tokens rather than characters.
- Thinking and searching are both ways of putting better material on the desk before answering; neither changes the basic one-token-at-a-time loop.
- Reasoning helps with problems that need steps, not with facts that were never provided.
- Your best lever as a user is the desk: paste the source you trust, and ask for the link behind anything that matters.
Sources
- Attention Is All You Need — Vaswani et al., 2017paper
- tiktoken: a fast BPE tokeniser for use with OpenAI's models — OpenAI, 2022docs
- Chain-of-Thought Prompting Elicits Reasoning in Large Language Models — Wei et al., 2022paper
- ReAct: Synergizing Reasoning and Acting in Language Models — Yao et al., 2022paper
- Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection — Greshake et al., 2023paper