Skip to content
mentoor

Topic 1 of 5 · 4 min read

Why the same prompt varies

Goal: Explain the sources of different answers to the same prompt and tell which one a given case shows.

The same prompt can give different answers because the model picks its words by weighted chance, and a few other things on the server shift the odds as well.

Check yourself · 1 of 3

You run the same prompt twice in a chat assistant and get two differently worded answers. What is the most likely reason?

Choose one answer

Why it matters

Many people think of an AI assistant as a calculator: same input, same output. It is not. If you do not know why answers differ, you will blame the wrong thing. You may think you "broke" the prompt when you only rolled the dice again, or you may trust one lucky answer as if it were the model's settled view.

Three sources of variation

  1. Random sampling. At each step the model scores every possible next token and turns the scores into probabilities. Then it picks one by weighted chance. If "Paris" has 90% and "Lyon" has 5%, you will get Lyon now and then. One different early word changes everything after it, because the rest of the reply is built on it.
  2. Server-side nondeterminism. Even when the choice is made the same way, the numbers can differ in the last decimal places. The order in which a busy server adds up numbers can change with how many other requests it is handling. A tiny difference can flip a close call between two tokens.
  3. Model changes. Providers update models behind a name. A name like latest or a chat app can point to a new version next month. The same prompt then behaves differently, with no change on your side.

A fourth cause lives in the product, not the model: hidden system prompts, memory, search results or earlier messages in the chat. Two people who type the same words may not send the same input.

How to tell which one you are seeing

  • Rerun the exact request five times. Wording that shifts but means the same points to sampling.
  • Different answers with sampling turned to its lowest setting point to server effects.
  • A change that appears for everyone on one day points to a model update.
  • A change only in your chat points to context, memory or settings.

Before and after

Before: "The AI gave me a great summary yesterday and a worse one today, so something is wrong with my prompt."

After: "I will run the same prompt five times and compare. If the quality swings between runs, it is sampling, and one good run proves little. If all five are worse, I will check whether the model version or the chat context changed."

What goes wrong

  • Treating one good output as proof that a prompt works. Test it several times.
  • Treating a different answer as a bug. Variation is how the system is built.
  • Ignoring versions. Without a pinned model, you cannot say whether the model or the prompt changed.
  • Comparing two prompts with one run each. The gap you see may be pure chance.

Examples

Five runs, one prompt

Prompt: "Give me a tagline for a tea shop." Run it five times and you may get five different lines. That is normal sampling. Now run "What is the capital of France?" five times. Almost every run says Paris, because one token holds nearly all the probability.

Which source is it?

  • Same chat, answers differ each time you press regenerate: sampling.
  • A script with the lowest randomness setting gives a rare different word: server effects.
  • All your results shifted last Tuesday and nothing in your code changed: a model update.
  • A colleague gets a different answer from the same words: different context, memory or settings.

Key points

  • A model picks each next token by weighted chance, so the same prompt can give different answers.
  • One different early token changes the rest of the reply, because later words build on earlier ones.
  • Servers can add small numeric differences even when the sampling is set to be fixed.
  • Providers can change the model behind a name, so a prompt can change without any edit from you.
  • Judge a prompt by several runs, not by one good or bad answer.

Common mistakes

  • Calling one good output proof that the prompt works.
  • Blaming a prompt change when the cause was a rerun.
  • Using a moving model name in work that must stay stable.
  • Comparing two prompts with a single run each.

Check yourself · 2 of 3

Your team's AI prompt gave steady results for weeks. On Monday all outputs shifted in tone and nobody edited the prompt. What is the best first thing to check?

Choose one answer

Check yourself · 3 of 3

You want to compare two versions of a prompt fairly. Which plan is best?

Choose one answer

Practice items, not counted towards your mastery.

Start here