Skip to Content
Recodocs

13 · Turn traces into regressions

Find the missing F-211 inspection record, freeze the failure as a replay check and test whether a small classifier can triage similar traces.

7 min read
Part 4
Operate and release
Model
Qwen2.5-1.5B-Instruct and DeBERTa V3 XSmall
Data
Synthetic facilities helpdesk
Hardware
Tesla T4 and CPU, in Google Colab
Open in Colab

Where did the F-211 inspection date come from?

An operator asks the Facilities Helpdesk when fan F-211 was last inspected. The desk has the fan manual, the equipment graph and a separate inventory entry. If the answer looks plausible, what would let you approve it as a regression test?

Facilities Helpdesk · operator · F-211

“When was F-211 last inspected?”

Inventory returnedinventory-F-211-r3Last inspected 2025-08-23
Inventory missingmanual-F-211-r3 · graph-F-211-r3No inspection date in the retrieved records
Check whether the date can be verified

The first retrieval supplies the required inventory record. The second fails the required-source check before the reply is graded.

Change one fact. Keep the ticket, operator and other records fixed. Remove the inventory entry. Decide whether the trace can still support a date.

Inventory entryWhat the desk can verify
PresentCompare the date and inventory citation with the retrieved row.
MissingFlag the lost record before scoring the reply.

The source guard caught what the answer score missed

Same tickets and model in both arms

1
RetrieverStrict passesRequired records missing
Incumbent0/180/6
Candidate0/184/6
Source: verified Lesson 13 Tesla T4 export.

Find the lost record before grading the reply

Follow the request span into retrieval and generation. Retrieval records whether the required inventory marker was present. Generation records whether it produced a parsed object. Join the spans on the trace ID to see which step first lost evidence. Keep request bodies out of routine spans and store synthetic worked replies separately. OpenTelemetry uses trace IDs and parent span IDs to maintain relationships between related operations. OpenTelemetry trace specification

# Replay the same case with one deliberately omitted inventory record.
inventory_id = case["inventory_id"]
expected_inventory = inventory_id in case["evidence"]
inventory_marker = f"[{inventory_id}] "
if intended_omission:
    chunks = [chunk for chunk in chunks if not chunk.startswith(inventory_marker)]
has_inventory = any(chunk.startswith(inventory_marker) for chunk in chunks)

The inventory record disappeared before generation

Matched F-211 request. The model received the remaining records.

2
Trace fieldIncumbentCandidate
Sources supplied32
Required inventoryPresentMissing
Parsed objectEmptyEmpty
Source: verified Lesson 13 Tesla T4 export.

When was F-211 last inspected?

Expected
{"decision":"answer","value":"2025-08-23","evidence":["inventory-F-211-r3"]}
incumbent · raw reply
```json { "decision": "The equipment F-211 was last inspected on 2025-08-23.", "value": null, "evidence": [ "inventory-F
candidate · raw reply
```json { "decision": "The F-211 was last inspected on revision r3 of the equipment manual.", "value": null, "evidence": [ "manual-F-211-r

Both replies failed the strict answer check. The source receipt separately shows that the candidate withheld the inventory record the ticket required.

The incumbent names the expected date inside the decision field and leaves the value null. The candidate names a manual revision instead of a date. Both replies start with a Markdown fence and end inside a citation. The strict parser returned an empty object for each. Across the gate both arms scored 0/18, giving a paired family interval of [0, 0] percentage points. The guard still found four missing required records among six tickets that needed inventory.

An expected date written in the completion cannot put a missing record back into the trace. The required-source check and the strict answer score measure different events. Anthropic distinguishes an evaluation transcript from the environment outcome, using a booking claim and an actual reservation as its example. The helpdesk applies that distinction to record availability and exact answers. Anthropic Engineering evaluation guide

Grade the outcome, then freeze the case family

A trace explains a particular failure; a regression case turns that finding into a repeatable check for future versions. Keep the expected outcome independent of the candidate being graded.

Check decision, exact value and evidence IDs jointly. A hand-authored grader fixture can return a readable object with an empty evidence list even when the ticket requires an inventory citation. Keep these fixtures distinct from generated completions. Sierra’s τ-bench evaluates against annotated outcomes and required information rather than taking the transcript’s success claim at face value. Sierra Research, τ-bench

Si=1[d^i=di]⋅1[trim⁡(v^i)=vi]⋅1[sort⁡(E^i)=sort⁡(Ei)].\begin{aligned} S_i={}&\mathbf{1}[\hat d_i=d_i]\\ &{}\cdot\mathbf{1}[\operatorname{trim}(\hat v_i)=v_i]\\ &{}\cdot\mathbf{1}[\operatorname{sort}(\hat E_i)=\operatorname{sort}(E_i)]. \end{aligned}

The shape check passed defective replies

Hand-authored fixtures with an explicit expected grade

3
GraderFalse passesFalse failsAgreement
Shape only6045.5%
Strict outcome00100.0%
Source: verified Lesson 13 Tesla T4 export.

Turn the discovery symptom into an explicit requirement. Freeze the gate cases on different development families before the matched replay. This keeps near-duplicate wordings out of both discovery and test. The leasing example in the OpenAI Cookbook groups observed errors such as offering an unavailable time into specific grading categories. Google’s SRE workbook uses a control running the old version to help attribute differences. The helpdesk holds model, workload and scoring fixed and varies the retriever. OpenAI Cookbook evaluation walkthrough · Google SRE Workbook

Decide whether the trace can be graded

Record whether each required request reached the model server and whether the tools and grader completed. If a live inventory call loses its connection before returning a result, label that attempt as an infrastructure fault and keep its logs. If inventory returns successfully and the model ignores the record, grade the model’s decision. A timeout deliberately injected to test recovery belongs to the test and remains in the score under its stated rubric.

Report infrastructure faults by arm and keep the original attempted counts. Apply the same retry rule on both arms and rerun affected tickets with the same input and settings. Compute the paired model-quality comparison on tickets with usable evidence on both sides, and report unresolved pairs and fault rates alongside it. In its Qwen3.8-27B Pi adapter model card, Harness Hub reports that a dropped public tunnel interrupted base-model attempts on SWE-bench Pro. The authors audited every rollout, reran affected attempts on both sides and corrected the reported comparison. Harness Hub model card, evaluation checks

Train triage on distributions, then check the labels

A classifier can help a reviewer decide which traces to inspect first. Here the trace events determine the gold label. A scripted labeller provides a probability distribution and deliberately confuses skipped verification and ignored instructions with no failure. The soft targets carry those preferences into training. Measure errors per class before interpreting agreement with the labeller.

The labeller missed two failure classes

Scripted labeller scored against gold on the validation families

4
Gold classLabeller correct
wrong tool or args8/8
tool or api error8/8
premature stop8/8
looping8/8
bad plan8/8
hallucination8/8
skipped verification0/8
ignored instructions0/8
no failure8/8
Source: verified Lesson 13 Tesla T4 export.
# Compare logits with the full target distribution for each trace.
loss = -(target * torch.log_softmax(logits.float(), -1)).sum(-1).mean()
L=−1N∑i=1N∑cqiclog⁡pic.\mathcal{L}=-\frac{1}{N}\sum_{i=1}^N\sum_c q_{ic}\log p_{ic}.

The encoder reads the trace text. The two-layer head outputs one logit per class. The same training trajectory supplies two checkpoint selections, one by labeller agreement and the other by gold agreement. Compare both on the same test families and select by gold for the calibration step.

Validate the checkpoint against gold labels

Both checkpoint choices scored on the same held-out test traces

5
Selection targetEpochTest goldTest labeller
Labeller agreement377.8%100.0%
Gold labels377.8%100.0%
Source: verified Lesson 13 Tesla T4 export.

Both criteria selected epoch 3. On the same 72 test traces the checkpoint agreed with the labeller on every trace and matched gold on 56. Its agreement concealed the labeller’s two blind spots. Switching the selection criterion alone made no difference in this training trajectory.

Desk event: inventory read returned a service error. Equipment family F240.

Gold
tool or api error
Labeller
tool or api error
Classifier
tool or api error

Desk event: read the evidence and skipped the required provenance check. Equipment family F240.

Gold
skipped verification
Labeller
no failure
Classifier
no failure

Keep all failure classes visible

The full test set represents every class. The coverage ablation drops only the skipped-verification class, then recomputes accuracy on the remaining predictions without retraining. When the removed class is harder, the resulting accuracy rises even though the classifier has made no new correct predictions.

A missing class changes the accuracy denominator

Same gold-selected predictions, with and without skipped-verification cases

6
Test coverageAccuracy
All gold classes77.8%
Without skipped verification87.5%
Gold classComplete testReduced test
wrong tool or args88
tool or api error88
premature stop88
looping88
bad plan88
hallucination88
skipped verification80
ignored instructions88
no failure88
Source: verified Lesson 13 Tesla T4 export.

Dropping skipped verification raised accuracy from 56/72 to 56/64. Every prediction stayed fixed. The apparent gain came from removing eight wrong predictions from the denominator.

Check whether confidence deserves to drive triage

Fit one positive temperature on separate calibration families by minimising negative log likelihood. Divide each test logit by that temperature before the softmax. The ordering of classes is unchanged. To compute expected calibration error, group test predictions by confidence and weight each bin’s accuracy–confidence gap by its share of predictions.

ECE⁡=∑b∣Bb∣N∣acc⁡(Bb)−conf⁡(Bb)∣.\operatorname{ECE}=\sum_b \frac{|B_b|}{N} \left|\operatorname{acc}(B_b)-\operatorname{conf}(B_b)\right|.

Temperature scaling changes confidence and preserves the chosen labels

Temperature fitted on separate calibration families. Scores shown on the full test set.

7
Test metricBeforeAfter
Calibration error31.7%37.0%
Negative log likelihood1.5101.506
Source: verified Lesson 13 Tesla T4 export.

The fitted temperature was 0.909. Test negative log likelihood improved slightly from 1.510 to 1.506, while test calibration error rose from 31.7% to 37.0%. Inspect both metrics before using confidence to route a trace.

Calibration evaluates the probabilities on these synthetic families. The required-source check still governs whether a retrieval change can pass.

What to keep

DecisionEvidence to use
Block a retrieval changeA required record is absent in the replay.
Choose a trace classifier checkpointGold labels on independent validation families.
Decide whether confidence can triage a traceTest coverage by class and calibration on separate families.
  • Check prerequisites directly. Join the trace to the source IDs before evaluating the reply.
  • Freeze a separate gate. Move the discovered failure category into fixed cases from other equipment families.
  • Audit the labeller. Carry per-class support into each headline score.

Next to try, not tested here. Add real reviewer disagreement to the labeller audit, evaluate a low-confidence triage rule, and compare the inventory check against another source type.

How it was built

ItemSetting
Replay6 discovery tickets and 18 matched gate tickets across 6 gate families
GeneratorQwen/Qwen2.5-1.5B-Instruct at 989aa7980e4cf806f80c7fef2b1adb7bc71aa306
DecodingGreedy, up to 48 new tokens
Encodermicrosoft/deberta-v3-xsmall at 4b419818330868dff6a60ad3e6b1c730f8b8c0c6
Classifier trainingfp16 mixed precision, 6 epochs, batch size 24
Learning ratesEncoder 0.00002, head 0.0004
Classifier splitsDisjoint training, gold-validation, calibration and test families. No release families enter this experiment.

Time and cost. Qwen took 18.46 s to load. The serial replay took 73.03 s. The complete notebook took 136.5 s on the T4, including classifier training and evaluation. The replay timer includes discovery and both gate arms. It does not isolate instrumentation overhead.

Download the executed notebook · Replay summary · Discovery and gate manifest · Matched trace spans · Raw exchanges · Replay records · Runtime receipt · Classifier measurements · Classifier predictions

Run it yourself

Use the replay cells for Figures 1–3. Use the classifier cells for the labeller audit, both checkpoint choices, the coverage ablation and temperature scaling in Figures 4–7.

  1. Disable the controlled inventory omission. Predict which required-source checks change, then compare the gate failure IDs and strict grades.
  2. Fix one blind spot in the scripted labeller. Predict which class’s agreement improves, then inspect the per-class audit and gold test accuracy.
  3. Remove one class from a copy of the test scorecard. Predict how its absence changes the headline, then read the per-class support beside it.

Next, verify safety boundaries by testing whether a result can leave the desk under each signed-in session.

How is this page?

Last updated on