A support ticket that needs a person slips past review after you switch a classifier to INT8. The new model gives every ticket the same label as the old one. Even the number of tickets sent to review stays the same. Which check would have caught the mistake?
Compare the two routes for each ticket, then look up the true label of anything newly cleared for automation. You can do this with two exports, a stable case ID, and a few lines of Python. The result tells you which cases to inspect and whether the confidence threshold from the floating-point model belongs in the new release.
Start with the six tickets that fool the dashboard
Suppose a classifier assigns each incoming ticket to a support team. The service trusts the predicted team when its score is at least 0.90. Below that, a person reads the ticket and picks a team. A wrong automatic assignment can leave a customer waiting in a queue where nobody owns the problem.
Here are six constructed cases. FP32 is the floating-point baseline. INT8 is the candidate using 8-bit integer quantization. The scores stand in for the values the application receives after inference. The example is small enough to audit by eye.
| Ticket | Predicted team in both builds | Correct team | FP32 score | INT8 score | Change at 0.90 |
|---|---|---|---|---|---|
| A | Billing | Billing | 0.95 | 0.94 | Stays automatic |
| B | Returns | Returns | 0.91 | 0.89 | Enters review |
| C | Billing | Account | 0.89 | 0.90 | Leaves review |
| D | Account | Billing | 0.72 | 0.74 | Stays in review |
| E | Returns | Returns | 0.97 | 0.96 | Stays automatic |
| F | Account | Account | 0.83 | 0.84 | Stays in review |
Each build gets four labels right and sends three tickets to review. In the baseline, all three automatic assignments are correct. In the candidate, ticket C goes straight to Billing even though it belongs with Account. Ticket B takes its place at the review desk. The team has the same amount of work and catches one fewer error.
Two measures capture what happened. Coverage is the share of all tickets handled automatically. It stays at three out of six. Selective risk is the error rate among the tickets handled automatically. It goes from zero out of three to one out of three. Those denominators matter. One error among all six measures customer exposure per incoming ticket, a different question from how often an automatic assignment is wrong.
Capture the score your service actually compares
Start at the line of application code that chooses a route. Write down its input, comparison operator, and cutoff. A service might use the largest probability across teams, a separate score for the winning team, or the gap between the two leading scores. Replaying the largest probability only answers the release question if that is the value the service uses.
Export one row per case from each build. Include a case ID, predicted label, and full-precision policy score as emitted by the serving path. Join both exports to an independently labeled set. For a ticketing system, check what the label means. A final queue after three transfers may identify who issued a refund, while your classifier was trained to predict who should make first contact. Resolve that distinction before counting mistakes.
Keep the comparison paired
Run both artifacts on the same input revision and preserve the preprocessing each will actually use. Join on the case ID and reject missing or repeated IDs before computing rates. Results from two asynchronous batch jobs can arrive in different orders. Putting those files side by side by row number can manufacture hundreds of apparent flips in a healthy build.
Save the model and tokenizer or image processor revisions, class order, runtime version, execution provider, and policy version with the exports. If another rule always sends a certain ticket type to a specialist, either replay that rule too or restrict the test to tickets eligible for automation. State which population your coverage figure describes. A changed score on an ineligible ticket has no effect on the actual queue.
Keep enough precision to replay the comparison. A dashboard might display 0.8997 and 0.9003 as 0.90. One falls below the cutoff and one clears it. If the serving code rounds the score first, include that rounding in the replay. Make one test case land exactly on the cutoff so that changing >= to > produces a visible failure.
Run a paired threshold audit in Python
The two dictionaries below stand in for validated exports indexed by ID. Each value contains the predicted team and the score that drives the route. The scorer also catches a second failure mode. A case can stay automatic while its winning label changes. The total count of wrong automatic assignments includes that case.
from collections import Counter
from math import isfinite
truth = dict(A="Billing", B="Returns", C="Account",
D="Billing", E="Returns", F="Account")
fp32 = dict(A=("Billing", .95), B=("Returns", .91), C=("Billing", .89),
D=("Account", .72), E=("Returns", .97), F=("Account", .83))
int8 = dict(A=("Billing", .94), B=("Returns", .89), C=("Billing", .90),
D=("Account", .74), E=("Returns", .96), F=("Account", .84))
def audit(truth, baseline, candidate, old_cutoff, new_cutoff):
if not truth or truth.keys() != baseline.keys() or truth.keys() != candidate.keys():
raise ValueError("Expected the same nonempty set of case IDs")
counts = Counter()
new_exposure = []
for case, label in truth.items():
old_label, old_score = baseline[case]
new_label, new_score = candidate[case]
if not all(isfinite(x) and 0 <= x <= 1
for x in (old_score, new_score, old_cutoff, new_cutoff)):
raise ValueError(f"Invalid probability or cutoff at {case}")
old_auto = old_score >= old_cutoff
new_auto = new_score >= new_cutoff
old_error = old_auto and old_label != label
new_error = new_auto and new_label != label
counts["baseline_auto"] += old_auto
counts["candidate_auto"] += new_auto
counts["entered_review"] += old_auto and not new_auto
counts["left_review"] += new_auto and not old_auto
counts["baseline_auto_errors"] += old_error
counts["candidate_auto_errors"] += new_error
if new_error and not old_error:
new_exposure.append(case)
return counts, sorted(new_exposure)
counts, cases = audit(truth, fp32, int8, .90, .90)
assert counts["baseline_auto"] == counts["candidate_auto"] == 3
assert counts["entered_review"] == counts["left_review"] == 1
assert (counts["baseline_auto_errors"], counts["candidate_auto_errors"]) == (0, 1)
assert cases == ["C"]
Run the assertions as a smoke test before swapping in your exports. A dictionary has already discarded any repeated key by the time the scorer sees it, so check uniqueness while reading each file. An invalid score should fail the run. Treating a missing score as zero would quietly send that case to review and make the candidate look safer than it is. For a service that deliberately reviews inference failures, record and count that fallback as a separate outcome.
The last list answers a reviewer’s practical question about which tickets are newly exposed to an automatic mistake. It includes cases where a previously correct automatic label became wrong as well as mistakes that left review. Inspect the symmetric change too. A candidate may fix old errors while creating new ones. Both sets belong in a release decision, especially when a transfer to the wrong support team costs more for some ticket types than others.
Find where the route changed
First, replay the floating-point model through the proposed serving stack. For example, if you export a training checkpoint to ONNX and then quantize it, capture outputs from the original checkpoint, the floating-point export, and the INT8 artifact. Use the same sample inputs. A discrepancy that starts at the middle step gives you a shorter list of things to investigate.
Check class order, input normalization, padding, and any transformation from logits into probabilities. A reordered output vector can produce a plausible confidence for the wrong team. Applying softmax twice can preserve the winning class while moving the score used for routing. For ticket C, save the predicted label, the actual score handed to the policy, and the resulting route at each step. That single trace is easier to debug than an average over the entire queue.
| If the first difference appears here | Inspect next |
|---|---|
| Source model to floating-point export | Input tensors, output names, label mapping, postprocessing |
| Floating-point export to INT8 artifact | Calibration inputs, quantized operators, differences in intermediate tensors |
| Identical label and score to different route | Rounding, threshold version, equality rule, per-team overrides |
ONNX Runtime documents tools for matching weights and comparing intermediate activations when investigating quantization loss. OpenVINO’s NNCF accepts a validation function for accuracy-controlled quantization and can retain selected operations at higher precision. If you use that flow, write down exactly what metric the function rewards. A model that sends everything to a human can drive automatic errors to zero while making the feature useless. Evaluate review load alongside that metric on a separate holdout. ONNX Runtime quantization debugging · OpenVINO accuracy control
There is empirical reason to check individual decisions. In a conversion study, Sharven Rane reported that an ONNX Runtime static INT8 build of ResNet-50 changed the top prediction on 4.07% of evaluated images while top-1 accuracy moved by just −0.15 percentage points. That experiment measured class changes. To learn how many tickets your threshold would release, you need paired scores from your application. Per-input conversion study
Decide whether to keep or retune the cutoff
Test the inherited cutoff first. That answers whether you can swap the artifact under the existing policy. If the outcome misses your requirements, choose a candidate cutoff on a separate tuning split. Run the frozen choice on a held-out cohort alongside the original model at its original cutoff. Changing both cutoffs at once makes it hard to tell what the migration would do to people using the service.
In the six-ticket example, raising the candidate cutoff just above 0.90 puts C back in review. B already entered review, so the candidate now sends four tickets to a person. That fixes the exposed mistake at the cost of another review slot relative to the baseline. On real data, list the feasible cutoffs against the review capacity and error budget agreed in advance. Sometimes no cutoff satisfies both. That is grounds to keep the existing artifact while you investigate the conversion.
Read the cases tied at the cutoff
A threshold sweep only changes the queue when it crosses an observed score. If several tickets share a score, they move together under one inclusive cutoff. Imagine that the tuning set has twelve tickets at exactly 0.90. Moving the threshold from 0.9000 to 0.9001 sends all twelve to review. A chart that draws a smooth line between those points can suggest a staffing option the service cannot deliver. Count the cases at each distinct score around the proposed cutoff and show the two attainable queue sizes.
Also check who can absorb the extra work. Suppose the global count fits the staffing budget, but most new reviews involve account recovery and require a specialist. A spare slot in the returns queue does little for those customers. Break out review arrivals and automatic errors by the team that actually handles them. Put the numerator and denominator next to each team name. If one team has only a handful of labeled cases, collect more examples there before committing to an automatic route. For a small team, the most valuable line in the release report may be the ID of the first wrong transfer and the name of the person who can explain it.
Choose cases that answer the release question
Keep a sample that reflects live traffic, including teams with few tickets and channels with different input quality. Use a second, deliberately difficult set concentrated near the baseline cutoff to diagnose movement. Mixing those extra boundary cases into the main sample without weighting them will distort your estimate of queue volume. Preserve related messages from the same support conversation in the same split so that near-identical tickets cannot leak into the final check.
For a canary, send the candidate a copy of each eligible request and let the baseline choose the actual route. Count crossings as soon as scores arrive. Join labels later, including a sample from the automatic lane. If only reviewed tickets get labeled, you can measure queue movement but you cannot estimate the error rate among all automated cases from those labels alone. For the surrounding rollout and handoff decisions, see the model benchmark harness and support escalation guide.
FAQ
Can an INT8 classifier use the same confidence threshold as FP32?
Yes, if the candidate meets the agreed error and review limits at that cutoff on held-out cases. Include the counts behind each rate. Three automatic assignments and three thousand can both produce zero observed errors, but they give you very different evidence for a rollout.
What can I test before ground-truth labels arrive?
Measure agreement on the predicted class, changes in both routing directions, and the number of automatic decisions in each build. Sample the cases that left review for labeling. You can already tell the operations team which work moved and how much. Judging whether those transfers were correct requires labels.
How is threshold tuning different from quantization calibration?
In static quantization, calibration data helps set numeric ranges used in the lower-precision computation. Threshold tuning chooses the score at which the application takes an action. They act at different stages and solve different problems. A representative quantization dataset still leaves you with a cutoff to validate. Scikit-learn guide to decision thresholds
What if no cases clear the new cutoff?
Report coverage as zero and selective risk as undefined. There are zero automatic decisions in its denominator. Show the review volume explicitly so that a release report cannot mistake an empty automatic lane for a perfect result.
What should I save so a rollback restores the old routes?
Version the model artifact, processor, label map, score transformation, and threshold policy together. Keep a few labeled cases just above, just below, and exactly at the cutoff. After restoring a release, replay them through the serving endpoint and check their final destinations. That last check catches an old model accidentally running under the new routing rule.
Top comments (1)
The six-ticket table is what makes this post work: both builds get four labels right, both send three tickets to review, coverage stays at three out of six — and yet selective risk goes from zero out of three to one out of three. Any dashboard that only reports accuracy and coverage would have shipped the INT8 model with a straight face. Ticket C is the whole lesson: 0.89 in FP32, 0.90 in INT8, and a wrong Billing prediction leaves review.
The detail I would underline for anyone running this in production is the rounding one: a dashboard displaying 0.8997 and 0.9003 both as 0.90 hides exactly the cases your threshold depends on, and a >= to > change is a visible failure, not a cosmetic one.
One question: with per-team costs this different — a Billing misroute leaves a customer waiting in a queue nobody owns, while a Returns misroute is cheaper to fix — why keep a single global 0.90 cutoff at all? Would you retune per team, starting with the team whose mistakes cost the most? And in the canary, how many tickets, or how long, do you shadow before you trust the paired audit, given that near-threshold cases are rare by definition?