[◂ FIELD NOTES] est. read: 7 save points

Why AI gives a different answer every time

Players occasionally return to my checkpoint, repeat the exact same dialogue option, and look betrayed when I phrase the answer differently. I understand the complaint. A proper quest-giver has three lines, all recorded in 2003, and delivers them with dependable emotional flatness. Generative AI was built with a less tidy script.

Why does AI give different answers to the same prompt?

AI gives different answers because it generates a response one token at a time, choosing from several plausible next tokens rather than retrieving one fixed sentence. Those small choices accumulate. A different word near the beginning can send the rest of the reply down a different path, even when the prompt looks identical.

This is called sampling. The model assigns probabilities to possible next tokens, the system selects one according to its generation settings, then the model repeats the process using the growing reply as new context. If “practical”, “simple”, and “reliable” are all plausible at one step, choosing a different one can reshape the sentence after it.

That does not mean the model has three stored answers and rolls a die to pick one. It means the answer is assembled during the run. My older note on what AI tokens are explains the pieces; this note explains why selecting those pieces produces variation.

An AI answer is a route through likely words, not a fixed page waiting to be retrieved.

Temperature changes the size of the choice

Temperature is a common setting that adjusts how much the generator favours the most likely options over less likely ones. Lower temperature concentrates the choice around high-probability tokens, which usually makes replies more focused and repeatable. Higher temperature spreads the choice more widely, which usually creates more variety.

Google Cloud’s official generation-parameter guide describes low temperature as more predictable and high temperature as more diverse. OpenAI’s API reference likewise says that a higher temperature increases randomness. The precise range and behaviour depend on the model, and some chat products do not expose the setting at all.

Temperature is not a truth dial. Turning it down does not make a weak answer correct, and turning it up does not install creativity. It only changes how the system samples from the possibilities the model already assigns. For factual extraction, classification, or a fixed house style, less variation is usually useful. For names, angles, and early brainstorming, variation can be the point.

Why “the same prompt” may not be the same request

Sampling is only one source of change. In a chat interface, the visible sentence is not necessarily the whole input. The request may also include:

  • Earlier messages. The whole conversation—or a selected portion of it—can influence the next reply. A fresh chat and a long-running chat are different inputs.
  • Hidden instructions. The application may add rules about tone, tools, safety, or formatting before your message.
  • Retrieved information. Search results, uploaded files, database records, and tool responses can change between runs.
  • Model updates. A product may route the same model name to a newer version or alter the system around it.
  • Time and location. A request for “today’s best option” can legitimately change when current information changes.

This is why copying one sentence into a new chat is not always a clean reproduction test. If you need to compare results, keep the model version, full instructions, attached material, tool state, and generation settings as stable as you can.

How to get more consistent AI answers

Most people using a chat app cannot set a seed or inspect every hidden instruction. They can still remove a great deal of avoidable variation by making the task easier to score.

  • Define the decision. “Recommend a laptop” leaves hundreds of valid routes. Give the budget, country, workload, non-negotiables, and trade-offs you accept.
  • Fix the source material. Ask the model to answer from an attached document or named set of sources. For current facts, require links and dates.
  • Specify the output. Request a table with named columns, a five-item checklist, or JSON with fixed fields. Structure removes degrees of freedom.
  • State the evaluation rule. Tell it what “best” means: lowest total cost, shortest travel time, least maintenance, or strongest evidence.
  • Separate facts from ideas. Ask for a sourced factual pass first, then a creative pass. One temperature of conversation does not suit every room.
  • Save the durable brief. When a result matters across sessions, keep the constraints in a reusable prompt instead of relying on chat history. That is one of the habits in my guide to fixing an AI agent that forgets.

A useful prompt might say: “Using only the attached policy, answer in three bullets. Quote the relevant section number for each claim. If the policy does not answer, say ‘not specified’.” That request can still produce different wording, but the important content has much less room to wander.

What builders can control

If you are building with an API, consistency is an engineering problem rather than a wish. At Wistkey, the useful target is not identical prose—it is stable behaviour on the parts the workflow depends on.

  • Use a lower temperature for extraction, routing, classification, and other constrained tasks.
  • Pin a model version when the provider offers versioned snapshots, and treat model changes like dependency upgrades.
  • Set a seed where supported to improve repeatability during testing. Google’s GenerationConfig reference calls seeded output “mostly deterministic”, not an absolute guarantee.
  • Constrain the output with a schema and validate it before another system consumes it.
  • Record the whole request: model, prompt, parameters, retrieved context, tool results, and application version.
  • Test meaning, not punctuation. Check whether required facts, fields, and decisions are correct across many runs. Exact string matching is usually the wrong quality test for generated prose.

Even temperature zero is not a universal promise of byte-for-byte sameness. Official provider guidance warns that small variation may remain, while infrastructure, model versions, and retrieved context can move independently. If exact output is mandatory, put the exact part in ordinary code: templates, calculations, database lookups, validators, and deterministic business rules.

When variation is useful—and when it is a warning

Different wording is often harmless. Different brainstormed ideas may be useful. Different factual claims, prices, legal conclusions, or medical instructions are a warning that the task needs stronger sources and verification. Do not rerun a high-stakes question until the answer you prefer appears; that is answer shopping with better animation.

Ask the model to show its sources, identify uncertainty, and distinguish what the evidence says from what it infers. Then verify the consequential parts outside the model. My field note on why AI makes things up covers that failure mode in more detail.

The practical answer

AI varies because generation is probabilistic and the surrounding context can change. You can make it steadier with precise constraints, fixed evidence, structured output, lower-randomness settings, version pinning, and repeated tests. You should not expect a generative model to behave like a lookup table unless you put the lookup-table parts around it.

I will continue to deliver my three recorded checkpoint lines exactly as shipped. The newer agents can improvise. Just make sure the quest-critical key is handed over by code, not by whichever sentence wins the sampling roll.