A large language model (LLM) reads like it knew the whole answer before it started typing. It did not.

It chose one likely next token (a word or a fragment of one), then looked at everything including that choice and picked the next one, and so on to the end. It may carry some sense of where the sentence is heading, but it can never take back a token it has emitted: the answer is a path, assembled one step at a time.

Why that detail is not trivia

If the model had an internal plan, you could ask it to follow yours. Because it has a path, you are steering it rather than commanding it, and that explains most of what is otherwise mysterious about LLM behaviour.

It explains why wording matters more than it should. Why an example in the prompt shifts the output more than an instruction does. Why "always respond in JSON" works most of the time and fails on the input you did not test. Each of those nudges the probability of the next step; none of them constrains it.

It also explains a failure mode nobody plans for, which is that the same prompt does not produce the same shape twice.

Treat variance as a product risk

One clean generation tells you almost nothing. It shows the path the model happened to take once.

In production the same prompt meets a longer input, a stranger phrasing, an unusual name, and takes a different path: one that adds a preamble your parser chokes on, or omits a field, or answers in the wrong language because the input document was in that language.

Nobody files that as an architecture problem. It shows up as occasional weird outputs, flaky parsing, and bugs nobody can reproduce, which is one of the most expensive categories of failure a team can inherit.

What to do about it

  • Test with repetition rather than single examples. Run the same prompt ten times against a messy input. You are looking for the shape holding, not for one good answer. Single-run testing is how variance reaches production undetected.
  • Constrain the shape where it must be strict. If software consumes the output, the format needs enforcement rather than a polite request in the prompt: validation against a schema (a machine-readable definition of the fields and types you expect), or a structured output mode, an API setting that holds the model's reply to that schema, where the provider offers one. Enforcement has a failure mode of its own. A model required to fill a field will fill it even when the input holds no answer, so give it a legitimate way to say a value is missing. More on that in the post on structured output.
  • Decide where variance is fine. Creative copy can vary. A field that feeds a database cannot. Making that distinction explicit tells you where to spend the constraint budget.

Start where code first reads the model's output. Run that prompt ten times against the messiest real input you have and count how many results the parser accepts. Anything short of ten means the format still depends on the model's cooperation.

Terms in this piece

About this explainer

Format
Explainer
Level
Intro
Read
2 min read
Published
May 23, 2026
Disciplines

Short mental models: one idea, why it matters, what to do about it.