Skip to content

Replay Ground Truth, Not Plausibility: Verifying a New AI-Facing Data Format

TL;DR — A new structured format for LLM-generated output was accepted on spot-checks of fresh cases — plausibility, not proof. The fix: hand-encode six previously-decided, already-verified cases in the new format as immutable fixtures, and require exact reproduction of the original signed results — range direction included — across all three scenarios. All six reproduce; one known gap, a zero-value line the new blocks omit, is carved out of the suite explicitly rather than silently ignored.

When a pipeline migrates to a new structured representation that an LLM will populate going forward, the format itself becomes a contract. The model reads the schema, fills fields, and downstream logic interprets the result. If the schema silently drops a field, inverts a sign convention, or reorders a range boundary, the output can still look correct to a human reviewer while being structurally wrong. A golden-output regression test encoded in the new format is the cheapest objective signal that the contract holds before the format is trusted with novel inputs.

The concrete situation: a mature pipeline produced signed numeric results across three scenarios. A new block-based schema was introduced to structure the output an LLM would generate in future runs — the same blocks-in, arithmetic-out design described in Keep the LLM Out of the Arithmetic.

The natural acceptance check was to run fresh inputs through the new format and see whether the results looked reasonable. They did. The question that was never asked: whether the new schema could reproduce the six previously-decided, already-verified historical cases — the outputs whose correctness was already established. Acceptance rested on plausibility, not reproduction. The gap was not a bug in the schema; it was the absence of a test that could have caught one.

Two failure mechanisms were at work:

  1. Absence of a regression anchor. The acceptance criterion was “new output is plausible” — a subjective gate. Without a fixed set of known-good inputs and outputs encoded in the new format, there is no objective pass/fail signal. Plausibility review scales with reviewer attention, not with correctness.

  2. Implicit trust in structural equivalence. Because the new schema contained the same logical fields as the representation it replaced, equivalence was taken on faith. In practice, field ordering, sign conventions, range direction, and the treatment of zero-value entries are format-specific decisions that a visual inspection will not surface.

  1. Select fixtures. Identify six previously-decided cases whose outputs had already been independently verified. These become immutable reference points.
  2. Hand-encode in the new format. Write each of the six cases by hand into the new block schema — no model, no pipeline, no conversion code touches the fixtures. The format will be populated by an LLM in production; its test data must come from a source that never runs through the thing being tested.
  3. Assert exact reproduction. Run the pipeline against the hand-encoded fixtures and confirm the output matches the original signed results exactly — sign and range direction included — across all three scenarios.
  4. Carve out the known gap. One structural limitation exists: a zero-value line the new block schema does not capture. Rather than silently ignoring it or forcing a workaround, document it as a named exception in the test suite, tracked for a future schema revision.

Deliberately not done:

  • No model or pipeline output was used to generate the fixtures. Hand-encoding isolates schema correctness from the code that will populate it.
  • No tolerance or “close enough” threshold was applied. The acceptance bar is exact signed reproduction.
  • No new cases were added to the regression set at this stage. The six historical cases are the contract; new cases belong in a separate exploratory suite.
Metric Before (spot-checks of new cases) After (fixture regression)
Cases validated Ad-hoc, uncounted 6 previously-decided cases
Scenarios covered Unspecified 3 scenarios, all asserted
Sign / direction check Not explicitly verified Correct range direction asserted per case
Zero-value handling Silent — gap invisible 1 known gap explicitly carved out and documented
Acceptance criterion “Looks reasonable” Exact signed reproduction

What the fix did not solve: the six fixtures cover the scenarios and edge cases that were already decided. They do not guarantee that a novel input outside the historical envelope will map correctly through the new schema. The zero-value gap remains a structural limitation of the block format until the schema is revised. And hand-encoding is a one-time cost that does not scale automatically — if the schema evolves again, the fixtures must be re-derived. The regression suite is a floor, not a ceiling.

flowchart LR
    A[Six verified historical cases] --> B[Hand-encode in new block schema]
    B --> C[Run pipeline]
    C --> D[Assert exact signed output across 3 scenarios]
    D --> E{All six match?}
    E -->|Yes| F[Pass: 6/6 with correct range direction]
    E -->|No| G[Fail: investigate schema mapping]
    D --> H[Known gap: zero-value line omitted]
    H --> I[Named carve-out with tracking note]
  1. Before accepting any new structured format that a model will populate, identify a set of already-verified historical outputs as immutable fixtures.
  2. Hand-encode those fixtures in the new format; never let the model, converter, or pipeline under test generate its own test data.
  3. Assert exact reproduction — value, sign, direction, ordering — not approximate or “plausible” output.
  4. Enumerate known gaps in the new format and carve them out of the test with named exceptions. A gap that passes silently is a gap that will fail in production.
  5. Treat the fixture set as a contract: any schema change that alters the output of an existing fixture is a breaking change, not a refactor.
  6. Keep the regression suite separate from exploratory or new-case testing. The former is the gate; the latter is discovery. Conflating them dilutes the signal.

When a new representation sits between a generative model and a downstream consumer, the only defensible acceptance test is that known-good historical results reproduce exactly through the new path. Replay ground truth; never audition a format on its own fresh output.

This is the fifth post in a series on verification and decision patterns for LLM-powered features. The fixtures are the verification half of the blocks-and-code architecture: the seam split made the pipeline checkable, and this is the check. And the discipline is the same one that made provenance enforcement cheap to regress — freeze the ground truth once, then make every future change prove itself against it. The cost of a missing regression anchor is paid in production, not in review.