One of the most confusing things about modern AI is that the same language model can give completely different answers to what appears to be the same question.
Ask it one way and you might get a detailed explanation. Ask it slightly differently and the tone changes. The structure changes. Sometimes even the conclusion changes.
At first, this can seem strange. If the model “knows” something, shouldn’t the answer remain the same?
Not necessarily.
The reason becomes clearer when you understand how large language models generate text.
A language model does not retrieve a finished answer from a hidden database inside itself. It generates a response one token at a time, using the context available at each stage to predict what should come next.
That simple mechanism explains a great deal about how AI responses work—and why the way you phrase a prompt can have such a large effect.
The response doesn’t exist yet
When people interact with AI, it is easy to imagine a hidden answer sitting somewhere inside the model, waiting to be retrieved.
You ask a question.
The model finds the answer.
Then it returns it.
But that is not really how text generation works.
A language model constructs its response incrementally:
One token → another token → another token → and so on.
Each new token is generated based on the context available at that point, including the user’s input, the conversation history, and the tokens the model has already produced.
The response is therefore not simply retrieved as a completed object.
It is constructed step by step during generation.
How next-token prediction works
The deeper you look at language-model generation, the more important this process becomes.
The model does not generate an entire paragraph as one indivisible operation. It repeatedly predicts what token should come next given the preceding context.
Conceptually:
Context → predict next token → add token to context → predict next token → repeat
What appears to us as a coherent answer is therefore the result of many individual prediction steps connected together.
And every prediction depends on context.
That detail matters because changing the context can change the predictions.
Once an early prediction changes, the new token becomes part of the context for subsequent predictions. This can influence what comes next, which can influence the token after that, and so on.
A small difference at the beginning can therefore lead the generation process along a substantially different path.
Why context matters so much
One of the biggest misconceptions about AI is that a prompt is simply an instruction.
A prompt does more than issue a command. It creates context.
That context influences which patterns in the model become relevant during generation.
Consider these two requests:
Explain gravity.
And:
Explain gravity to a five-year-old using a simple analogy.
The topic is the same: gravity.
But the context is different.
The second prompt introduces:
- An audience
- A tone
- A teaching style
- A level of complexity
Those additional constraints influence what kinds of responses are likely to follow.
The model does not necessarily need to consciously formulate a strategy such as “I will now switch to a child-friendly explanation.” Instead, the additional context changes the conditions under which the model generates its response.
Why a small change can create a different response
This helps explain why wording matters so much.
A language model is not simply interpreting a prompt, forming a complete answer internally, and then executing that plan.
It is generating a sequence of tokens based on the context available at each step.
Suppose two prompts differ by only a few words.
Those words can change the probabilities of the first generated tokens. Those tokens then become part of the context for the next prediction. The next predictions are influenced by them, and the process continues.
Conceptually:
Small change in input → different early prediction → different context → different later predictions
This is why two prompts that seem nearly identical to a person can sometimes produce noticeably different responses.
A useful analogy is changing the first turn on a road trip. A small change at the beginning can eventually put you on a completely different route.
Why AI can appear to contradict itself
Another common misconception is that an AI model has stable opinions or beliefs that it consults when answering questions.
People sometimes ask:
“Why did the model contradict itself?”
The answer becomes less mysterious once you understand context-dependent generation.
A language model does not necessarily maintain a fixed set of personal opinions that it retrieves for every question. Its response is generated based on the context presented to it.
For example, ask:
“What are the risks of artificial intelligence?”
The context encourages a discussion of potential risks.
Now ask:
“Write a persuasive argument explaining why artificial intelligence is completely safe.”
The context is different, so the model can generate a response supporting a very different position.
This does not necessarily mean that the model “changed its mind.”
The context changed, so the generated response changed.
The hidden power of prompts
This is why prompting can have such a significant effect on AI responses.
Every instruction contributes to the context.
Every example contributes to the context.
Every constraint contributes to the context.
Every formatting requirement contributes to the context.
If a request is vague, the model has fewer signals about the kind of response you want.
If the request is specific, the additional context can narrow the range of plausible responses.
For example:
Write about climate change.
provides relatively little information about the desired output.
Compare it with:
Explain climate change to high school students in three short paragraphs. Include the main causes, major effects, and one real-world example.
The second prompt provides much more context.
It specifies the audience, structure, scope, and style.
The model now has more information about the type of response that should follow.
This is the foundation of prompt engineering.
The model is not simply answering a question
The deeper you look at language models, the less they resemble traditional question-answering systems.
A traditional question-answering system might be imagined as:
Question → retrieve answer → return answer
A language model works differently:
Context → predict token → update context → predict next token → continue
The distinction matters.
The model is not simply searching for a complete answer hidden somewhere inside itself. It is generating a sequence based on the context available during the process.
This is also why the same underlying model can produce different responses to similar questions.
Change the context, and you can change the generation process.
From generation to prompt engineering
Once you understand that context shapes generation, prompting starts to look different.
The goal is not simply to give the model a command.
The goal is to provide context that makes the desired type of response more likely.
That can involve:
- Clear instructions
- Constraints
- Examples
- Relevant background information
- Output formats
- Audience information
- Specific goals
The more precisely the context reflects what you want, the less the model has to infer about the intended response.
This does not mean that a longer prompt is always better. The useful question is whether the additional context reduces meaningful ambiguity.
And that leads to the next question:
How should you design prompts that provide the right context and constraints?
That is the subject of prompt engineering.
The bigger lesson
The deeper I look at language models, the less they feel like simple question-answering systems and the more they feel like context-driven generation systems.
They don’t simply react to a question.
They generate responses based on the entire context available to them.
Every word contributes.
Every example contributes.
Every instruction contributes.
Together, these elements influence what happens next.
That means interacting effectively with an AI model is not simply about asking the perfect question. It is about creating the right context for the response you want.
And that path begins with understanding how the model generates text.
