Orion GeoAIBlog

How Orion works · Part 11

Testing a system that isn’t allowed to be creative

One sentence about energy labels moved an answer about sewers. How we test Orion: real questions with verified answers, no randomness in decisions, and what we found when identical prompts disagreed.

A grid of pinned test questions: most answer the same every run, some are expected refusals, a few are close calls pinned by their set of states

You change one sentence in the instructions about energy labels. You run the energy-label questions. Better. You ship it.

The next morning, a question about sewer pipes picks a different column than it did yesterday.

Nothing about sewers changed. Nothing in the code changed. One sentence about energy labels moved an answer about sewers.

This is what testing a language-model system is like. In ordinary software a change has a blast radius you can reason about. In a prompt, everything is connected to everything, and the connections aren’t written down anywhere. We learned that the hard way, more than once. This post is about how we test Orion now, and why.

A suite of real questions, with answers worked out by hand

The backbone is a suite of about two hundred real municipal questions, the kind a policy advisor would actually ask, each with a reference answer worked out directly in SQL on the data. Some answers are numbers. Some are lists of districts. Some are refusals: where the data genuinely can’t answer, the honest “I can’t” is the expected result, and a number there counts as a failure.

Every change runs against the questions it could affect, and a change that moves a pinned answer is stopped until the move is explained.

The reference answers get audited too

This sounds obvious and isn’t. When Orion and a reference answer disagree, it’s tempting to assume Orion is wrong. Sometimes it is. Sometimes the reference is.

Some of ours were built with the same raw-row queries that were fooled by duplicated data (post 9), so they agreed with Orion’s wrong numbers. Others encoded an assumption nobody had checked. So a disagreement is always settled by a new query on the data, never by trusting either side. Several reference answers have been corrected that way.

Two answers agreeing is not evidence. Only the data is.

There’s a sharper version of this rule we try to follow: before believing a comparison, check that the sample actually contains a case that could disagree. A test that can’t fail doesn’t tell you anything.

No creativity where decisions are made

Language models normally sample: they pick among likely words with a bit of randomness, which is what makes them sound natural. For a system whose answers are tested, that’s poison. A question that passes on Monday and fails on Tuesday with identical code can’t be tested at all.

So every step in Orion that decides something, such as routing, analysis, dataset choice or planning, runs without random sampling. Same input, same output. Only the final prose summary is allowed to vary, because nobody grades the wording.

That’s the theory. Here’s what we found when we measured it.

Identical prompt, different answer

Within one running session of the system, with the model loaded, answers are byte-identical run after run. We checked. But after a restart, of the application or of the model server, some questions came back different, with the exact same prompt and the same fixed settings.

Not most questions. The close calls: questions where two readings are almost equally likely, and a tiny numerical difference in how the model server processes the request tips the balance. We ran the same questions five times in one evening across restarts to be sure. Close-call questions flipped between two, occasionally three, states. Stable questions never moved.

What changed in our testing because of it:

The prompt that was quietly cut in half

One more story, because it cost us the most confusion. As the instructions grew, a set of questions started failing in a strange way: the model began using dataset names that didn’t exist. Confidently, and consistently.

The cause: the prompt had grown past the model’s context window, and the model server doesn’t complain when that happens. It silently drops the beginning. The part it dropped was the part that listed the real dataset names. So the model did what models do with a gap: it filled it in.

Prompt length is a budget. Every change that makes a prompt longer is now checked against the measured token count, not an estimate. The cheapest change in the whole system is a check in code that adds nothing to any prompt.

What we optimise for

Put together, the rules look like this:

  1. One change at a time. Never the model, the search and the instructions together. When three things change and the answers move, you’ve learned nothing.
  2. Checks in code over instructions to the model. Code behaves the same every time and can be tested exactly.
  3. Test what the change can move, plus what might shift, not everything every time. Runs are slow; attention is slower.
  4. New wrong answers first. After any change, the first question is whether it created a confident wrong answer anywhere, not whether the pass count went up.

None of this is glamorous. It’s the same discipline a good GIS team applies to a production database: know what changed, check the numbers against the data, and be suspicious of anything that agrees too easily.