Why the same question gets a different answer

Explain sampling and temperature, and put the variation between answers to use.

Open an AI assistant, ask it a question and copy the reply somewhere. Then press regenerate, or start a fresh chat and type exactly the same question, and put the second reply beside the first. The two will almost always be worded differently, and sometimes they will say different things. The tool is built to work this way, and once you know how it works you can make use of it.

Take two colleagues sitting side by side. They ask the same assistant how annual leave carries over under the Employment Act. One is told unused leave can be carried forward. The other is told it depends on the employment contract. They used the same words and the same tool on the same afternoon, and neither did anything wrong. Two people can type the same question into the same tool at the same time and get different answers.

How the next token gets chosen

Lesson 3.2, "It writes by predicting the next token, again and again", showed the loop the model runs. At every step it produces probabilities for the next token, and then one token has to be chosen. The way that choice is made decides whether you get the same answer twice.

The simplest method is to always take the single most likely token. This tends to produce flat, repetitive text that can get stuck going in circles. Most assistants sample instead: they pick a token at random, weighted by the probabilities. Likely tokens win most often, but not every time. Take the invented example from Lesson 3.2, where "the" has a 25 percent chance of being the next token and "Monday" has an 18 percent chance. Over many attempts, "the" is chosen about a quarter of the time and "Monday" a bit less than a fifth of the time.

Each single draw involves only a little randomness. Over a few hundred tokens, though, those small random choices add up. Two answers to the same question can end up different in wording, in structure and sometimes in what they claim.

Temperature and the weight of early words

The people who build these tools set how adventurous the sampling is with a setting usually called temperature. At low temperature, the most likely tokens get an even bigger share of the chances, so the output is predictable and much the same each time. At high temperature, the chances are spread more evenly and less likely tokens are picked more often. The writing becomes more varied and more surprising, and it is more likely to wander.

Most chat apps don't show you this setting, because the company picks a sensible middle value for you. ChatGPT, for example, does not let you set temperature. If you use the API, a developer playground or an in-house tool built on one of these models, you may be able to set temperature and other sampling settings such as top_p, but only for models and settings that support sampling controls. OpenAI's current reasoning models drop temperature and top_p whenever reasoning effort is switched on, so check OpenAI's developer documentation for which models and settings accept them. Where these controls do appear, they all work on the same idea.

Each token depends on everything before it, so an early choice can send the whole answer down one path. Say you ask whether an expense is tax deductible, and the probabilities for the first word are split between "Yes" and "It". If sampling lands on "Yes", the rest of the reply tends to justify a yes. If it lands on "It", the answer is more likely to explain that it depends on your circumstances. The model can't go back and reconsider its first word, so a slightly unlucky early draw can produce a confidently wrong reply. That's how pressing regenerate can sometimes fix a bad answer completely when nothing in the question has changed. It also means one strange reply doesn't prove the tool is useless, and one good reply doesn't prove it is reliable.

Using the variation for ideas and for facts

Whether the randomness helps or hurts depends on the job. Get into the habit of treating any single answer as one draw from a range of possible answers.

For brainstorming, you want the variation. Say you run a hawker stall and ask for ten names for a new set meal. Ask again and you get a fresh batch. If you regenerate three or four times, you have a wider pool to choose from than any single answer gives you.

For facts, variation is a warning light. If you ask the same factual question twice in fresh chats and get two different answers, at least one of them is wrong, or the honest answer depends on details your question left out. In either case you can't rely on a single reply, so check the answers against the source. For the two colleagues and their leave question, the source is the Ministry of Manpower's website.

Agreement between attempts is weaker evidence than disagreement. Two answers can agree and both be wrong, because the model can be consistently mistaken about something it learned badly. How much the draws disagree tells you how far to trust any one of them. In practice, the routine looks like this:

Treat any single answer as one draw from a range of possible answers. For creative work, regenerate several times and choose from the pool. For factual work, ask the same question more than once in fresh chats and compare the answers. If the answers differ, take it that at least one is wrong or the question is missing details. Check the answers against the authoritative source, and don't treat agreement between them as proof.

Trying it on a fact you can check

Pick a question where you can look up the right answer afterwards. Ask it several times in fresh chats and compare the replies with the source. Seeing the spread on a fact you can verify is far more convincing than reading about it.

Ask an assistant the same factual question three times, each in a fresh chat. Write down where the answers agree, where they differ and which differences matter.

Course

Junxiong-WFG Organisation is an authorised representative of AIA Financial Advisers Private Limited (Reg. No. 201715016G).