Skip to content

Promotion gates: is the new version good enough?

Write the conditions a version must meet before it's approved or becomes champion, compare it with the champion on the same rows, and record any override.

Advanced ~14 min13 steps

You will be able to

  • Explain why two models should be compared on the same rows, with a margin
  • Write gates on a version's scores, the champion's scores and its reproducibility check
  • Predict what a gate with no value to judge does
  • Override a held promotion with a reason that stays on record

Read first

01

Better by how much?

Predict

Predict first

A new version beats the champion by half a point of AUC on the test rows. What should happen next?

Promote it: higher is betterCompare them on the same rows, against a marginReject it: the gain is too small to matter
Reveal

Compare them on the same rows, against a margin. Half a point could be noise. And "better" may be the wrong question: a fresher or simpler model can be worth having even if it only ties. What you usually need to know is whether it's worse by more than you can accept.

02

Two models, the same rows

Read

Two models scored on the same rows share most of their noise: a hard row is hard for both. Comparing two separate intervals throws that away.

A paired bootstrapPaired bootstrapResampling the same rows for two models and recomputing the difference, so row-to-row luck doesn't count against either. resamples rows, keeps each row's two predictions together, and recomputes the difference each time:

Δ∗=metric∗(candidate)−metric∗(champion)\Delta^{*} = \text{metric}^{*}(\text{candidate}) - \text{metric}^{*}(\text{champion})

The app does this 2,000 times on the held-out rows. A version is non-inferiorNon-inferiority testAsks whether a new option is no worse than the standard by more than a margin chosen in advance, rather than whether they differ. when the 95% interval of Δ∗\Delta^{*} stays above −m-m, where mm is your margin. For a metric where lower is better, such as RMSE, the interval has to stay below +m+m.

03

Not worse by more than you can accept

Explore

Non-inferiority is one half of an equivalence test: only the side that would hurt has to clear.

BExplorable · Two one-sided tests

How do you show that two things are the same, not merely that you found no difference?

What can you conclude here?

How sure?
0.10
1.00
50
0.40
−margin+margin0

Inconclusive: neither test rejects

Equivalent when the whole 90% interval sits inside the margins. TOST p = .068; ordinary test p = .618.

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

Shrink the margin, then raise n, and watch when the interval fits. Notice that a large p from the ordinary test isn't what gets you there. The evidence comes from a narrow interval.

This explorable uses the 90% interval that equivalence tests use. The gate's two-sided 95% interval is stricter: a one-sided test at 97.5%97.5\% on the side that matters.

04

Gates are conditions

Read

A gate is a condition in the same language as alert rules. Add a gate offers these templates:

noninferior(metric = "roc_auc", margin = 0.01)
roc_auc >= 0.7
reproduces()
rows() >= 1000

A bare metric name reads the version's test score when it has one, and otherwise its cross-validated score. cv_roc_auc and test_roc_auc ask for one explicitly, champion.roc_auc reads the champion's score, and rows() counts the training rows.

The templates fill in your model's primary metric where these show roc_auc.

05

When a gate has nothing to read

Predict

Predict first

A blocking gate reads f1 >= 0.6, but this version never recorded an F1. What happens when you try to approve it?

It passesIt failsIt holds the step, because it can't be judged
Reveal

It holds the step, and shows No value to judge. No evidence isn't a pass. Compare that with an alert rule, which stays quiet without evidence: alerts need a reason to speak up, while gates need a reason to open.

The one exception: if there's no champion yet, non-inferiority gates have nothing to compare with, so they pass and a note says so.

06

Read the comparison

Explore

A check with a paired gate draws each metric's interval next to its margin.

Non-inferiority to the championIs the candidate no worse than the champion by more than the margin we accept?
View data
metricdifferencelowhighmargin
ROC AUC0.0064−0.00800.01600.0100
F1−0.0059−0.01200.00600.0100
Log loss (flipped)−0.0168−0.0300−0.00600.0100

Right favors the candidate, and metrics where lower is better are flipped so this stays true. Passing means the whole interval sits to the right of the dashed margin.

Look for a metric whose point estimate is inside the margin while its interval crosses the line. That's a version you can't call non-inferior yet, which isn't the same as calling it worse.

07

When the split plans differ

Read

Two versions from one experiment share a split plan, so their held-out rows match directly.

When the plans differ, the app scores the champion on the candidate's held-out rows, and says so in a note. Some of those rows may have been in the champion's training data, which favors the champion. So treat that comparison as conservative, and retrain on a shared plan when the decision is close.

08

Set the margin before you look

Reflect

A margin is a decision about the business, not a statistical result. It answers: how much accuracy would you give up for what the new version offers, such as fresher data, a simpler model or lower cost?

Choose one for a model you know, and write down why. If you choose it after seeing the comparison, it will tend to land wherever lets the version through.

09

Set up a gate

In the app

Open a version's Gates & policy tab.

  1. Use Add a gate, then press Save. The policy belongs to the model, not to one version.
  2. Under Gates guard, choose the steps it covers. By default, these are Stage: Approved and Becoming champion.
  3. Press Check this version against the gates to see the result without promoting anything.

Turn off Blocking for a gate that should only warn.

10

Overriding, on the record

Read

Anyone can override a held step, by writing a reason in the promotion dialog. There's no silent way past: Override and go ahead stays disabled until a reason is there.

The Audit log keeps every guarded step: what was asked, what the gates said, and the reason. An override can be the right call, such as an urgent fix for a known fault. The log means someone can ask about it later.

11

Check your understanding

Checkpoint

Check yourself

The margin is 0.01. Candidate minus champion on AUC has a 95% interval from −0.006 to 0.014. Is the candidate non-inferior?

Show the answer

Answer: a

Non-inferiority asks whether the candidate could be worse by more than the margin. Being better isn't required, so including zero is fine.

Check yourself

With the same margin, another candidate's interval runs from −0.03 to 0.03. What can you conclude?

Show the answer

Answer: c

A wide interval that crosses the margin doesn't show harm or safety. A gate holds the step here because the evidence falls short.

Check yourself

Why resample rows for both models together?

Show the answer

Answer: a

Pairing doesn't change either model's score. It lets row-to-row luck cancel out of the difference.

12

Compute it yourself

In the app

Given held-out outcomes and both models' scores on the same rows, you can reproduce the idea of the check. These scripts use their own random generators, so their intervals won't match the app's exactly.

Python
import numpy as np
import pandas as pd
from sklearn.metrics import roc_auc_score

df = pd.read_csv("holdout_scores.csv")  # y, champion, candidate on the same rows
rng = np.random.default_rng(1)

diffs = []
for _ in range(2000):
    s = df.iloc[rng.integers(0, len(df), len(df))]
    if s["y"].nunique() == 2:
        diffs.append(roc_auc_score(s["y"], s["candidate"]) - roc_auc_score(s["y"], s["champion"]))

low, high = np.percentile(diffs, [2.5, 97.5])
margin = 0.01
print(round(low, 4), round(high, 4), "non-inferior" if low > -margin else "not shown")
R
auc <- function(y, s) {
  r <- rank(s)
  n1 <- sum(y == 1)
  n0 <- sum(y == 0)
  (sum(r[y == 1]) - n1 * (n1 + 1) / 2) / (n1 * n0)
}

df <- read.csv("holdout_scores.csv")  # y, champion, candidate on the same rows
set.seed(1)
diffs <- replicate(2000, {
  i <- sample(nrow(df), replace = TRUE)
  auc(df$y[i], df$candidate[i]) - auc(df$y[i], df$champion[i])
})

ci <- quantile(diffs, c(0.025, 0.975))
margin <- 0.01
print(round(ci, 4))
if (ci[1] > -margin) "non-inferior" else "not shown"
13

Recap

Recap
  • Compare models on the same rows, and ask whether the new one is worse by more than a margin you chose in advance.
  • Gates read the version's scores, the champion's scores and the reproducibility check.
  • A gate with nothing to judge holds the step, since no evidence isn't a pass.
  • Overriding takes a written reason, and the audit log keeps it.

Concepts in this lesson