Skip to main content
← All posts
AISeptember 2, 20266 min read

What AI is actually doing when it answers you

No magic, no mysticism. A plain walkthrough of tokens, context and why the same question can get two different answers.

It is predicting, not looking things up

A language model does not open a filing cabinet. It reads everything you sent it, breaks that text into tokens, and predicts the next chunk of text over and over until it decides to stop.

That single fact explains most of what confuses people. It explains why the model sounds confident when it is wrong, why it can invent a function that does not exist, and why it can be brilliant on one attempt and mediocre on the next.

Context is the whole job

Everything the model knows about your problem in this moment is the text you gave it. Your instructions, the file you pasted, the earlier turns of the conversation — that is the world.

So when an answer is vague, the first question is rarely 'is this a bad model'. It is 'did I actually tell it the things it needed'. Half the prompt advice on the internet is a long way of saying: put the missing information in.

Why two runs disagree

Sampling is deliberately a little random, so identical prompts drift. That is a feature when you want ideas and a problem when you want a fixed shape of answer.

The fix is structure. Ask for a list with a set number of items, name the fields you want back, give an example of a good answer. Constraints cut the space the model can wander into.

Try it rather than read about it

The Prompt Room is free and takes about a minute. You write a vague request, watch a weak answer come back, then repair the prompt and watch the answer change. Reading this post is useful. Doing that once sticks better.

Rather do it than read it?

The Prompt Room is free and takes about a minute.