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.
- 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
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?
“When was F-211 last inspected?”
inventory-F-211-r3Last inspected 2025-08-23Check 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 entry | What the desk can verify |
|---|---|
| Present | Compare the date and inventory citation with the retrieved row. |
| Missing | Flag the lost record before scoring the reply. |
The source guard caught what the answer score missed
Same tickets and model in both arms
1| Retriever | Strict passes | Required records missing |
|---|---|---|
| Incumbent | 0/18 | 0/6 |
| Candidate | 0/18 | 4/6 |
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 field | Incumbent | Candidate |
|---|---|---|
| Sources supplied | 3 | 2 |
| Required inventory | Present | Missing |
| Parsed object | Empty | Empty |
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
The shape check passed defective replies
Hand-authored fixtures with an explicit expected grade
3| Grader | False passes | False fails | Agreement |
|---|---|---|---|
| Shape only | 6 | 0 | 45.5% |
| Strict outcome | 0 | 0 | 100.0% |
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 class | Labeller correct |
|---|---|
| wrong tool or args | 8/8 |
| tool or api error | 8/8 |
| premature stop | 8/8 |
| looping | 8/8 |
| bad plan | 8/8 |
| hallucination | 8/8 |
| skipped verification | 0/8 |
| ignored instructions | 0/8 |
| no failure | 8/8 |
# Compare logits with the full target distribution for each trace.
loss = -(target * torch.log_softmax(logits.float(), -1)).sum(-1).mean()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 target | Epoch | Test gold | Test labeller |
|---|---|---|---|
| Labeller agreement | 3 | 77.8% | 100.0% |
| Gold labels | 3 | 77.8% | 100.0% |
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 coverage | Accuracy |
|---|---|
| All gold classes | 77.8% |
| Without skipped verification | 87.5% |
| Gold class | Complete test | Reduced test |
|---|---|---|
| wrong tool or args | 8 | 8 |
| tool or api error | 8 | 8 |
| premature stop | 8 | 8 |
| looping | 8 | 8 |
| bad plan | 8 | 8 |
| hallucination | 8 | 8 |
| skipped verification | 8 | 0 |
| ignored instructions | 8 | 8 |
| no failure | 8 | 8 |
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.
Temperature scaling changes confidence and preserves the chosen labels
Temperature fitted on separate calibration families. Scores shown on the full test set.
7| Test metric | Before | After |
|---|---|---|
| Calibration error | 31.7% | 37.0% |
| Negative log likelihood | 1.510 | 1.506 |
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
| Decision | Evidence to use |
|---|---|
| Block a retrieval change | A required record is absent in the replay. |
| Choose a trace classifier checkpoint | Gold labels on independent validation families. |
| Decide whether confidence can triage a trace | Test 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
| Item | Setting |
|---|---|
| Replay | 6 discovery tickets and 18 matched gate tickets across 6 gate families |
| Generator | Qwen/Qwen2.5-1.5B-Instruct at 989aa7980e4cf806f80c7fef2b1adb7bc71aa306 |
| Decoding | Greedy, up to 48 new tokens |
| Encoder | microsoft/deberta-v3-xsmall at 4b419818330868dff6a60ad3e6b1c730f8b8c0c6 |
| Classifier training | fp16 mixed precision, 6 epochs, batch size 24 |
| Learning rates | Encoder 0.00002, head 0.0004 |
| Classifier splits | Disjoint 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.
- Disable the controlled inventory omission. Predict which required-source checks change, then compare the gate failure IDs and strict grades.
- Fix one blind spot in the scripted labeller. Predict which class’s agreement improves, then inspect the per-class audit and gold test accuracy.
- 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