Set canary gates that do not halt on noise

L3SeniorDesign12 minSystem designDesign review

RolesAI Evaluation and ReliabilityInference EngineeringLLM Product Engineering

The question

You run a canary for a new model. The team wants a rule that stops the rollout when the canary and the baseline differ on any metric. Design the gates so that they catch a real regression and let a healthy rollout through.

Answer it first, aloud or on paper. Then open the answer.

The answer

Show short answer

Write each gate as a multiplier above the baseline, never as equality. Gate on five metrics: latency percentiles, cost per request, error and refusal rate, output length distribution and user feedback rate. Put every threshold above the run-to-run variance, which the lesson measured at up to 15 percent on identical inputs, and hold each step long enough to collect the samples the gate needs.

Show full answer

Why equality fails

Identical inputs produce different outputs. Floating-point reductions on the GPU run in a different order for each batch shape, the batch size changes between runs, and sampling above temperature zero adds its own randomness. The lesson reports up to 15 percent accuracy variation between runs on the same eval set. "Stable" therefore means inside the expected variance, not identical to the baseline.

The five gates

MetricBreach
Latency P50, P95, P99canary P99 above 1.5x the baseline
Cost per requestmore than 20 percent above the baseline
Error and refusal rate2x the baseline
Output length, mean and P99a shift in the distribution
User feedback, thumbs-down and tickets1.5x the baseline

Measure the noise floor first

Before the canary, run two arms of the same baseline model and record the spread of each metric between them. That spread is the floor. A gate below it halts every rollout, including a good one. The lesson's exercise asks for the multipliers when the eval noise is plus or minus 7 percent, and the answer is a gate above that band.

Hold each step long enough

The progression runs 1, 10, 25, 50, 75 and 100 percent. Gates check every 5 to 15 minutes. At 1 percent of a load of 1,000 per minute, the canary sees 10 requests per minute, which is 50 to 150 data points per window. That is enough to read latency and errors, but one or two samples decide the P99, so the P99 gate must hold for more than one window. It is too few for user feedback. Each step must pause until the gate has its samples.

Keep the exit cheap

A halt is only useful when the rollback is fast. Keep the traffic share in a policy flag and the model in a registry with a pinned digest, so that a breach reverts in seconds.

Follow-ups

  1. L3SeniorHow do you learn the size of the noise before the canary starts?

    Show expected answer

    run two canary arms of the same baseline and record the spread of each metric between them.

  2. L3SeniorUser feedback at the first step is too thin to gate on. What do you do?

    Show expected answer

    gate the early steps on latency, cost, errors and length, and apply the feedback gate from the step that has enough samples.

  3. L4StaffA gate fires at one step, and the metric is normal again on the next check. Continue or halt?

    Show expected answer

    halt and look. A gate that flaps sits inside the noise or sees an intermittent regression, and both need a decision before more users see the model.

Wrong answers

Show the wrong answers that interviewers hear
  • “Stop on any difference from the baseline.”

    Two runs of the same model differ, so that rule stops every rollout.

  • “Gate on the mean latency.”

    A mean hides the tail. Gate on the percentiles.

  • “Allow zero cost increase.”

    A better model can cost more. The lesson sets the breach at 20 percent, and the product decides whether the gain pays for it.

Taught in

The progressive delivery lesson lists the five gates, the non-determinism ceiling and the step cadence.