← Back

When a token-generation test uses the wrong golden

A coding agent told me my model had failed the release test. The model had picked Poland.

I was adding four-bit support for Qwen3.8-27B to Doppler, my model-execution runtime. Four-bit weights use less memory, so I wanted to know whether the smaller version worked. It loaded, generated text, and then failed a comparison against a higher-precision model.[1]

The prompt was The capital of France is. Both models answered Paris and kept going, listing countries and capitals. They agreed through twelve pairs. After Austria and Vienna, the reference headed toward Denmark and Copenhagen. My four-bit version, Q4, chose Poland and Warsaw.

The test stopped at generation index 97, the first different token. Nothing in the prompt required Denmark to come next. Poland had the right capital. What, exactly, was I supposed to fix?

The same twelve country-capital pairs lead to two valid continuations: Denmark and Copenhagen in BF16, Poland and Warsaw in Q4. Exact transcript comparison rejects the difference.
Both runs used greedy decoding. At zero-based generation index 97, they selected different countries; both resulting capital-city pairs were correct. Retained transcripts and settings.

The test had already picked a country

The saved reference transcript was the golden: every token my runtime produced had to match it. That is useful when both implementations are supposed to perform the same calculation. Here, the reference used BF16 weights, a higher-precision version of the model. I had changed the numbers and then required the answer to remain identical.

Both runs chose the highest-scoring next token, without random sampling. That makes each run deterministic under its own settings. It does not make two different sets of weights choose the same words. Reducing weight precision can change which token wins a close comparison. Once the models choose different tokens, they are also reading different histories.[1]

That explains how they can diverge. It does not tell us the score margin at Poland, and a plausible answer would not clear a broken runtime. I could still have decoded the weights incorrectly or mishandled the cache. I needed a comparison that could distinguish those bugs from the change I had deliberately made.

Give both runtimes the same job

The next check used an independent implementation reading the actual retained Q4 weights. Give both implementations the same prompt and token history, then compare the scores they calculate for the next token. Now a disagreement points toward a calculation we can inspect.

We set numerical limits from independent controls before running new holdout prompts. Those scoped checks passed.[2] Saving my runtime's Poland transcript as the new golden would have been easier. It would also have made the runtime its own answer key.

I still needed to know whether the smaller model gave useful answers. An initial six-task check passed in both precisions. Separate browser checks exercised conversations, cancellation and reuse. Those were reasons to continue testing, not a verdict on everything the model could answer.[3][4]

Then it really was wrong

A later task asked the model to trace this calculation and return the number:

values = [2, 5, 8]
result = sum(
    x * 2 for x in values
    if x > 3
)

Keep 5 and 8, double them, add them. The answer is 26. Q4 returned 22.

This time the independent implementation reproduced Q4's mistake. With matching F16 weights, it answered 26. The prompt, model revision, tokenizer and generation rules stayed fixed.[5] That is evidence of a quality loss from quantization on this task. These were independent CPU controls; they did not qualify Doppler's F16 GPU implementation.

Warsaw and Copenhagen were both acceptable continuations. Twenty-two was a wrong answer. An exact transcript test had treated the first disagreement as decisive, while the later task gave us a concrete reason to reject an answer.

Historical managed buffer-pool peaks: F16 50.6 GiB and Q4 16.3 GiB, with a common zero baseline.
The practical stake: less managed memory made Q4 worth investigating. These counters exclude other process and driver memory; they do not establish speed or universal device fit. Historical runs.

The memory savings made this worth investigating. Historical managed buffer-pool peaks were 50.6 GiB for F16 and 16.3 GiB for Q4. Those counters cover part of memory use, and the runs were not a matched speed comparison.[1] I wanted the smaller model to work. That made it more important to test the right thing.

I want a failed test to send the agent to a broken calculation. This one sent it to a country with the correct capital. We kept the failure in the record and added the comparisons that could tell us which problem we actually had.

Sources and run boundaries

  1. Historical Q4 failure, generation settings and memory accounting, greedy BF16 transcript, and F16 run. The coding-agent account is the author's recollection of the investigation; these receipts establish the harness result, not an agent-reasoning transcript. The mismatch index is zero-based; GiB values divide retained byte counters by 230.
  2. October 16 Q4 qualification: independent reference, calibrated limits, holdouts and retained failures. Scoped to AMD native WebGPU, a 4,096-token context limit and 256-token prefill chunks. Unchunked long prompts had caused device loss.
  3. Six-task Q4/F16 comparison. No general-quality or human-preference conclusion.
  4. Recorded Reploid browser conversations. Whole-model native execution reached over WebRTC; no browser weight requests. This is not evidence for partitioned execution or continuous availability.
  5. October 17 matching Q4/F16 code-tracing control and method, contracts and qualification limits. One exact prompt; independent CPU Transformers equations, F32 arithmetic and F16 KV storage. The retained self-consistent greedy paths are Q4 22, stop and F16 26, stop. No general-quality conclusion or Doppler F16 GPU qualification; the comparison receipt remains accepted: false.